Skip to content

Commit 78dff37

Browse files
committed
Update generate-csr.yaml
1 parent db3657f commit 78dff37

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
- name: Generate CSR
3+
hosts: localhost
4+
gather_facts: false
5+
vars:
6+
csr_path: "<example.tld>_csr.pem"
7+
private_key_path: "<example.tld>__key.pem"
8+
common_name: "*.<example.tld>_"
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

0 commit comments

Comments
 (0)