forked from IBM/z_ansible_collections_samples
-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_keyring.yml
26 lines (23 loc) · 1015 Bytes
/
create_keyring.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
- name: Create z/OS keyring via TSO commands.
hosts: zos_host
gather_facts: false
environment: "{{ environment_vars }}"
vars:
owner_id: "{{ owner_id | default('IBMUSER') }}"
keyring: "{{ keyring | default('SharedRing1') }}"
tasks:
- name: Check if keyring already exists and create it if it doesn't.
block:
- name: Check if keyring to be created already exists.
ibm.ibm_zos_core.zos_tso_command:
commands:
- RACDCERT LISTRING({{ keyring }}) ID({{ owner_id }})
register: keyring_check
failed_when: false
changed_when: false
- name: Create a new keyring via TSO commands, skip if it already exists.
ibm.ibm_zos_core.zos_tso_command:
commands:
- RACDCERT ADDRING({{ keyring }}) ID({{ owner_id }})
- RACDCERT LISTRING({{ keyring }}) ID({{ owner_id }})
when: "'IRRD114I Ring ' + keyring + ' does not exist.' in keyring_check.output[0].content[0]"