Skip to content

Commit

Permalink
Merge pull request #630 from sigmafeud/var_syntax
Browse files Browse the repository at this point in the history
Syntax fix in vpn and xmpp tasks.
  • Loading branch information
jplock committed Dec 8, 2016
2 parents a02bd29 + ec3f62c commit fb28ed8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions roles/vpn/tasks/openvpn.yml
Expand Up @@ -21,13 +21,13 @@

- name: Create directories for clients
file: path={{ openvpn_path}}/{{ item }} state=directory
with_items: openvpn_clients
with_items: "{{ openvpn_clients }}"

- name: Generate RSA keys for the clients
command: openssl genrsa -out client.key {{ openvpn_key_size }}
chdir={{ openvpn_path }}/{{ item }}
creates=client.key
with_items: openvpn_clients
with_items: "{{ openvpn_clients }}"

- name: Set the proper permissions on all RSA keys
file: path={{ openvpn_path }}
Expand Down Expand Up @@ -73,13 +73,13 @@
command: openssl req -new -key client.key -out client.csr -subj "{{ openssl_request_subject }}/CN={{ item }}"
chdir={{ openvpn_path }}/{{ item }}
creates=client.csr
with_items: openvpn_clients
with_items: "{{ openvpn_clients }}"

- name: Generate certificates for the clients
command: openssl x509 -CA {{ openvpn_ca }}.crt -CAkey {{ openvpn_ca }}.key -CAcreateserial -req -days {{ openvpn_days_valid }} -in client.csr -out client.crt
chdir={{ openvpn_path }}/{{ item }}
creates=client.crt
with_items: openvpn_clients
with_items: "{{ openvpn_clients }}"

- name: Generate HMAC firewall key
command: openvpn --genkey --secret {{ openvpn_hmac_firewall }}
Expand All @@ -93,13 +93,13 @@
- name: Register client certificate contents
command: cat client.crt
chdir={{ openvpn_path }}/{{ item }}
with_items: openvpn_clients
with_items: "{{ openvpn_clients }}"
register: openvpn_client_certificates

- name: Register client key contents
command: cat client.key
chdir={{ openvpn_path }}/{{ item }}
with_items: openvpn_clients
with_items: "{{ openvpn_clients }}"
register: openvpn_client_keys

- name: Register HMAC firewall contents
Expand All @@ -111,9 +111,9 @@
template: src=client.cnf.j2
dest={{ openvpn_path }}/{{ item[0] }}/{{ openvpn_server }}.ovpn
with_together:
- openvpn_clients
- openvpn_client_certificates.results
- openvpn_client_keys.results
- "{{ openvpn_clients }}"
- "{{ openvpn_client_certificates.results }}"
- "{{ openvpn_client_keys.results }}"

- name: Generate Diffie-Hellman parameters (this will take a while)
command: openssl dhparam -out {{ openvpn_dhparam }} {{ openvpn_key_size }}
Expand Down
2 changes: 1 addition & 1 deletion roles/xmpp/tasks/prosody.yml
Expand Up @@ -28,7 +28,7 @@

- name: Create Prosody accounts
command: prosodyctl register {{ item.name }} {{ prosody_virtual_domain }} "{{ item.password }}"
with_items: prosody_accounts
with_items: "{{ prosody_accounts }}"

- name: Set firewall rules for Prosody
ufw: rule=allow port={{ item }} proto=tcp
Expand Down

0 comments on commit fb28ed8

Please sign in to comment.