|
@@ -79,15 +79,40 @@
|
79
|
79
|
creates=client.crt
|
80
|
80
|
with_items: openvpn_clients
|
81
|
81
|
|
82
|
|
-- name: Create the client configs
|
83
|
|
- template: src=client.cnf.j2
|
84
|
|
- dest={{ openvpn_path }}/{{ item }}/{{ openvpn_server }}.ovpn
|
85
|
|
- with_items: openvpn_clients
|
86
|
|
-
|
87
|
82
|
- name: Generate HMAC firewall key
|
88
|
83
|
command: openvpn --genkey --secret {{ openvpn_hmac_firewall }}
|
89
|
84
|
creates={{ openvpn_hmac_firewall }}
|
90
|
85
|
|
|
86
|
+- name: Register CA certificate contents
|
|
87
|
+ command: cat ca.crt
|
|
88
|
+ chdir={{ openvpn_path }}
|
|
89
|
+ register: openvpn_ca_contents
|
|
90
|
+
|
|
91
|
+- name: Register client certificate contents
|
|
92
|
+ command: cat client.crt
|
|
93
|
+ chdir={{ openvpn_path }}/{{ item }}
|
|
94
|
+ with_items: openvpn_clients
|
|
95
|
+ register: openvpn_client_certificates
|
|
96
|
+
|
|
97
|
+- name: Register client key contents
|
|
98
|
+ command: cat client.key
|
|
99
|
+ chdir={{ openvpn_path }}/{{ item }}
|
|
100
|
+ with_items: openvpn_clients
|
|
101
|
+ register: openvpn_client_keys
|
|
102
|
+
|
|
103
|
+- name: Register HMAC firewall contents
|
|
104
|
+ command: cat ta.key
|
|
105
|
+ chdir={{ openvpn_path }}
|
|
106
|
+ register: openvpn_hmac_firewall_contents
|
|
107
|
+
|
|
108
|
+- name: Create the client configs
|
|
109
|
+ template: src=client.cnf.j2
|
|
110
|
+ dest={{ openvpn_path }}/{{ item[0] }}/{{ openvpn_server }}.ovpn
|
|
111
|
+ with_together:
|
|
112
|
+ - openvpn_clients
|
|
113
|
+ - openvpn_client_certificates.results
|
|
114
|
+ - openvpn_client_keys.results
|
|
115
|
+
|
91
|
116
|
- name: Generate Diffie-Hellman parameters (this will take a while)
|
92
|
117
|
command: openssl dhparam -out {{ openvpn_dhparam }} {{ openvpn_key_size }}
|
93
|
118
|
creates={{ openvpn_dhparam }}
|