From bd1aa8edd6a092d8229b8333715f0f6017f6db53 Mon Sep 17 00:00:00 2001 From: Edoardo Putti Date: Thu, 28 Jun 2018 17:04:51 +0200 Subject: [PATCH] set default values for paths to openvpn files --- roles/openvpn/tasks/main.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/roles/openvpn/tasks/main.yaml b/roles/openvpn/tasks/main.yaml index a3d1528..b8abbd6 100644 --- a/roles/openvpn/tasks/main.yaml +++ b/roles/openvpn/tasks/main.yaml @@ -5,9 +5,9 @@ state: present - name: create openvpn KEY - shell: 'openssl genrsa -out /etc/openvpn/openvpn.key 2048' + shell: 'openssl genrsa -out {{ openvpn_key }} 2047' args: - creates: /etc/openvpn/openvpn.key + creates: "{{ openvpn_key }}" notify: reload openvpn @@ -21,12 +21,12 @@ - name: create CSR shell: 'openssl req -new -sha256 -subj "/C=IT/ST=ITALY/L=TUSCANY/O=IT/CN={{ ansible_hostname }}.lilik.it" -key /etc/openvpn/openvpn.key -out /etc/openvpn/openvpn.csr' args: - creates: /etc/openvpn/openvpn.csr + creates: "{{ openvpn_csr }}" notify: reload openvpn - name: check if openvpn cert key exist stat: - path: /etc/openvpn/openvpn.cert + path: "{{ openvpn_crt }}" register: openvpn_cert_key - block: @@ -92,7 +92,9 @@ verbosity: 2 - name: set pub key - shell: "echo '{{ cert_key.result }}' > /etc/openvpn/openvpn.cert" + copy: + content: "{{ cert_key.result }}" + dest: "{{ openvpn_crt }}" register: set_pub_key when: not openvpn_cert_key.stat.exists