-
Notifications
You must be signed in to change notification settings - Fork 1
/
9.0-playbook_replace_certs.yml
36 lines (34 loc) · 1.12 KB
/
9.0-playbook_replace_certs.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
29
30
31
32
33
34
35
36
# Example Playbook to configure PPDM Certificates
- name: Set PPDM Certificates
hosts: localhost
gather_facts: no
connection: local
vars_files:
- ./vars/main.yml
tasks:
- name: Checking Required Variables - privateKey
fail:
msg: "We do not have privateKey !"
when: (privateKey is not defined) or (privateKey|length <= 5)
- name: Checking Required Variables - certificateChain
fail:
msg: "We do not have certificateChain !"
when: (certificateChain is not defined) or (certificateChain|length <= 5)
- name: Setting Base URL
set_fact:
ppdm_baseurl: "https://{{ ppdm_fqdn | regex_replace('^https://') }}"
- name: Get PPDM Token for https://{{ ppdm_fqdn | regex_replace('^https://') }}
include_role:
name: get_ppdm_token
vars:
ppdm_password: "{{ ppdm_new_password }}"
- debug:
msg: "{{ access_token }}"
verbosity: 1
name: do we have a token ?
- name: Set PPDM Certificates
include_role:
name: set_ppdm_certificates
vars:
newprivateKey: "{{ privateKey }}"
newcertificateChain: "{{ certificateChain }}"