Debian Codegraph @

ansible_collections/dellemc/openmanage/roles/idrac_certificate/molecule/generateCSR-10579/converge.yml

raw symbols SCIP
1 ---
2 - name: Converge
3 hosts: all
4 gather_facts: false
5 vars:
6 cert_export_path: "{{ lookup('env', 'path_for_import_cert') }}"
7
8 tasks:
9 - name: Set fact
10 ansible.builtin.set_fact:
11 per_mode: "0755"
12
13 - name: Create Directory
14 ansible.builtin.file:
15 path: "{{ cert_export_path }}"
16 state: directory
17 mode: "{{ per_mode }}"
18 register: idrac_certificate_created_directory
19 check_mode: false
20
21 - name: Generate HTTPS CSR signing request
22 ansible.builtin.import_role:
23 name: idrac_certificate
24 vars:
25 hostname: "{{ lookup('env', 'IDRAC_IP') }}"
26 username: "{{ lookup('env', 'IDRAC_USER') }}"
27 password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
28 validate_certs: false
29 command: "generate_csr"
30 certificate_type: "HTTPS"
31 certificate_path: "{{ cert_export_path }}"
32 cert_params:
33 common_name: "sample.domain.com"
34 organization_unit: "OrgUnit"
35 locality_name: "Bangalore"
36 state_name: "Karnataka"
37 country_code: "IN"
38 email_address: "[email protected]"
39 organization_name: "OrgName"
40 subject_alt_name:
41 - "hostname1.chassis.com"
42
43 - name: Setting up HTTPS CSR certificate path for exported file
44 ansible.builtin.stat:
45 path: "{{ idrac_certificate_out.certificate_path }}"
46 register: csr_cert_file
47 no_log: true
48
49 - name: Verifying HTTPS generate CSR certificate
50 ansible.builtin.assert:
51 that:
52 - csr_cert_file.stat.exists
53 - not idrac_certificate_out.changed
54 - not idrac_certificate_out.failed
55 - idrac_certificate_out.msg == "Successfully performed the 'generate_csr' certificate operation."