Debian Codegraph @

ansible_collections/hetzner/hcloud/tests/integration/targets/setup_selfsigned_certificate/tasks/main.yml

raw
1 ---
2 - name: Create temporary file for test_certificate
3 ansible.builtin.tempfile:
4 suffix: "{{ hcloud_certificate_name }}"
5 register: _tmp_certificate_file
6
7 - name: Create certificate privatekey file
8 community.crypto.openssl_privatekey:
9 path: "{{ _tmp_certificate_file.path }}.key"
10 return_content: true
11 register: _certificate_privatekey_file
12
13 - name: Create certificate signing request file
14 community.crypto.openssl_csr:
15 privatekey_path: "{{ _tmp_certificate_file.path }}.key"
16 path: "{{ _tmp_certificate_file.path }}.csr"
17 country_name: DE
18 locality_name: Bavaria
19 state_or_province_name: Munich
20 organization_name: Dis
21 common_name: www.example.com
22
23 - name: Create certificate file
24 community.crypto.x509_certificate:
25 privatekey_path: "{{ _tmp_certificate_file.path }}.key"
26 csr_path: "{{ _tmp_certificate_file.path }}.csr"
27 path: "{{ _tmp_certificate_file.path }}.crt"
28 provider: selfsigned
29 return_content: true
30 register: _certificate_file
31
32 - name: Save certificate files content
33 ansible.builtin.set_fact:
34 test_certificate_privatekey_content: "{{ _certificate_privatekey_file.privatekey }}"
35 test_certificate_content: "{{ _certificate_file.certificate }}"