From 8e0cca6b666d03f05a725fd519022e298c085c52 Mon Sep 17 00:00:00 2001 From: Jack Ivanov Date: Mon, 26 Sep 2016 15:43:19 +0300 Subject: [PATCH] some fixes --- ADVANCED.md | 2 +- roles/local/tasks/main.yml | 12 ++++++++++++ roles/vpn/tasks/main.yml | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ADVANCED.md b/ADVANCED.md index a9384f1..00de5fe 100644 --- a/ADVANCED.md +++ b/ADVANCED.md @@ -68,7 +68,7 @@ *Requirement variables:* - server_ip - server_user -- IP_subject +- IP_subject_alt_name ### Deployment diff --git a/roles/local/tasks/main.yml b/roles/local/tasks/main.yml index de8de4c..4be2433 100644 --- a/roles/local/tasks/main.yml +++ b/roles/local/tasks/main.yml @@ -6,6 +6,18 @@ ansible_python_interpreter: "/usr/bin/python2.7" easyrsa_p12_export_password: "{{ easyrsa_p12_export_password }}" cloud_provider: local + when: server_ip != "localhost" + +- name: Add the instance to an inventory group + add_host: + name: "{{ server_ip }}" + groups: vpn-host + ansible_ssh_user: "{{ server_user }}" + ansible_python_interpreter: "/usr/bin/python2.7" + ansible_connection: local + easyrsa_p12_export_password: "{{ easyrsa_p12_export_password }}" + cloud_provider: local + when: server_ip == "localhost" - name: Waiting for SSH to become available local_action: "wait_for port=22 host={{ server_ip }} timeout=320" diff --git a/roles/vpn/tasks/main.yml b/roles/vpn/tasks/main.yml index f658228..3b9ea12 100644 --- a/roles/vpn/tasks/main.yml +++ b/roles/vpn/tasks/main.yml @@ -96,7 +96,7 @@ - name: Build the server pair shell: > - ./easyrsa --subject-alt-name='DNS:{{ IP_subject_alt_name }},IP:{{ IP_subject_alt_name }}' build-server-full {{ IP_subject_alt_name }} nopass&& + ./easyrsa --subject-alt-name='DNS:{{ IP_subject_alt_name }},IP:{{ IP_subject_alt_name }}' build-server-full {{ IP_subject_alt_name }} nopass && touch '{{ easyrsa_dir }}/easyrsa3/pki/server_initialized' args: chdir: '{{ easyrsa_dir }}/easyrsa3/'