Debian Codegraph @

ansible_collections/dellemc/openmanage/roles/idrac_certificate/molecule/__get_ssl_key.yml

raw symbols SCIP
1 ---
2 - name: Install cryptography python package
3 ansible.builtin.command:
4 cmd: pip install cryptography>=1.2.3
5 register: cmd_output
6 changed_when: cmd_output.rc == 0
7 failed_when: cmd_output.rc != 0
8 check_mode: false
9
10 - name: Install OpenSSL package (RHEL/CentOS/AlmaLinux/Rocky)
11 ansible.builtin.package:
12 name: openssl
13 state: present
14 check_mode: false
15 no_log: false
16
17 - name: Generate private RSA key using OpenSSL (certified-compliant)
18 ansible.builtin.command: >
19 openssl genpkey -algorithm RSA
20 -out "{{ lookup('env', 'path_for_import_cert') }}/cert.key"
21 -pkeyopt rsa_keygen_bits:2048
22 args:
23 creates: "{{ lookup('env', 'path_for_import_cert') }}/cert.key"
24 no_log: false
25 check_mode: false
26
27 - name: Generate self-signed certificate using OpenSSL
28 ansible.builtin.command:
29 cmd: >
30 openssl req -x509 -new -nodes
31 -key "{{ lookup('env', 'path_for_import_cert') }}/cert.key"
32 -sha256 -days 365
33 -out "{{ lookup('env', 'path_for_import_cert') }}/cert.pem"
34 -subj "/CN=localhost"
35 check_mode: false
36 no_log: false
37 changed_when: true