iam_cert.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. ---
  2. - name: upload certificates to AWS IAM
  3. iam_cert23:
  4. state: present
  5. name: "{{ openshift_aws_iam_cert_name }}"
  6. cert: "{{ openshift_aws_iam_cert_path }}"
  7. key: "{{ openshift_aws_iam_cert_key_path }}"
  8. cert_chain: "{{ openshift_aws_iam_cert_chain_path | default(omit) }}"
  9. register: elb_cert_chain
  10. failed_when:
  11. - "'failed' in elb_cert_chain"
  12. - elb_cert_chain.failed
  13. - "'msg' in elb_cert_chain"
  14. - "'already exists and has a different certificate body' in elb_cert_chain.msg or 'BotoServerError' in elb_cert_chain.msg or 'Traceback' in elb_cert_chain.msg.module_stderr"
  15. when:
  16. - openshift_aws_create_iam_cert | bool
  17. - openshift_aws_iam_cert_path != ''
  18. - openshift_aws_iam_cert_key_path != ''
  19. - openshift_aws_elb_cert_arn == ''
  20. - debug:
  21. msg: "{{ elb_cert_chain }}"
  22. verbosity: 1
  23. - name: set_fact openshift_aws_elb_cert_arn
  24. set_fact:
  25. openshift_aws_elb_cert_arn: "{{ elb_cert_chain.arn }}"
  26. when:
  27. - openshift_aws_create_iam_cert | bool
  28. - openshift_aws_iam_cert_path != ''
  29. - openshift_aws_iam_cert_key_path != ''
  30. - openshift_aws_elb_cert_arn == ''