File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ - name : Generate CSR
3+ hosts : localhost
4+ gather_facts : false
5+ vars :
6+ csr_path : " <example.tld>_csr.pem" # Change to domain you will have to create CSR for
7+ private_key_path : " <example.tld>_key.pem" # Change to domain you will have to create CSR for
8+ common_name : " *.<example.tld>" # Change to domain you will have to create CSR for
9+ tasks :
10+ - name : Create directory
11+ file :
12+ path : " certificate/"
13+ state : directory
14+ mode : ' 0755'
15+
16+ - name : Generate private key
17+ openssl_privatekey :
18+ path : " ./certificate/{{ private_key_path }}"
19+ size : 2048
20+ register : private_key
21+
22+ - name : Generate CSR
23+ openssl_csr :
24+ path : " ./certificate/{{ csr_path }}"
25+ privatekey_path : " ./certificate/{{ private_key_path }}"
26+ common_name : " {{ common_name }}"
27+ organization_name : " <org name>"
28+ organizational_unit_name : " <org ou>"
29+ country_name : " <country code>"
30+ locality_name : " <local area>"
31+ state_or_province_name : " <state>"
32+ email_address : " <mail@example.tld"
33+ backup : yes
34+ register : csr
Original file line number Diff line number Diff line change 1+ ansible == 10.3.0
2+ ansible-core == 2.17.3
3+ cryptography == 43.0.0
You can’t perform that action at this time.
0 commit comments