forked from IBM/z_ansible_collections_samples
-
Notifications
You must be signed in to change notification settings - Fork 1
/
list_cert.yml
28 lines (25 loc) · 1.12 KB
/
list_cert.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
27
28
###############################################################################
# © Copyright IBM Corporation 2020, 2021
###############################################################################
- name: List certificates via TSO commands.
hosts: zos_host
gather_facts: false
environment: "{{ environment_vars }}"
vars:
cert_type: "{{ cert_type | default('SITE') }}" # CERTAUTH, SITE or USER
cert_label: "{{ cert_label | default('TESTSITE') }}"
owner_id: "{{ owner_id | default('') }}" # Only required if cert_type is USER
tasks:
- name: List cert, print results whether it exists or not.
block:
- name: 'Displaying cert {{ cert_label }}.'
vars:
format_cert_type: "{{ 'ID(' + owner_id + ')' if cert_type == 'USER' else cert_type }}"
ibm.ibm_zos_core.zos_tso_command:
commands: "RACDCERT {{ format_cert_type }} LIST(LABEL('{{ cert_label }}'))"
register: list_cert
changed_when: false
always:
- name: Print results from list cert command.
ansible.builtin.debug:
var: list_cert.output[0].content