---
- fail:
    msg: "{{ item.name }} needs to be defined."
  when: "{{ item.cond }}"
  with_items:
  - name: "{{ r_openshift_aws_iam_kms_alias }}"
    cond: "{{ r_openshift_aws_iam_kms_alias is undefined }}"
  - name: "{{ r_openshift_aws_iam_kms_region }}"
    cond: "{{ r_openshift_aws_iam_kms_region is undefined }}"

- name: Create IAM KMS key with alias
  oo_iam_kms:
    state: present
    alias: "{{ r_openshift_aws_iam_kms_alias }}"
    region: "{{ r_openshift_aws_iam_kms_region }}"
  register: created_kms

- debug: var=created_kms.results
