diff --git a/docs/deploy-from-ansible.md b/docs/deploy-from-ansible.md index ccbb05e..9816f0b 100644 --- a/docs/deploy-from-ansible.md +++ b/docs/deploy-from-ansible.md @@ -248,7 +248,7 @@ You need to source the rc file prior to run Algo. Download it from the OpenStack Required variables: - server - IP or hostname to access the server via SSH -- endpoint - Public IP address of your server +- endpoint - Public IP address or domain name of your server - ssh_user diff --git a/playbooks/cloud-post.yml b/playbooks/cloud-post.yml index 283ed60..1561153 100644 --- a/playbooks/cloud-post.yml +++ b/playbooks/cloud-post.yml @@ -1,7 +1,7 @@ --- - name: Set subjectAltName as afact set_fact: - IP_subject_alt_name: "{% if algo_provider == 'local' %}{{ IP_subject_alt_name }}{% else %}{{ cloud_instance_ip }}{% endif %}" + IP_subject_alt_name: "{{ (IP_subject_alt_name if algo_provider == 'local' else cloud_instance_ip) | lower }}" - name: Add the server to an inventory group add_host: diff --git a/roles/local/tasks/prompts.yml b/roles/local/tasks/prompts.yml index 1f5edc2..a12b880 100644 --- a/roles/local/tasks/prompts.yml +++ b/roles/local/tasks/prompts.yml @@ -31,7 +31,7 @@ - pause: prompt: | - Enter the public IP address of your server: (IMPORTANT! This IP is used to verify the certificate) + Enter the public IP address or domain name of your server: (IMPORTANT! This is used to verify the certificate) [{{ cloud_instance_ip }}] register: _endpoint when: endpoint is undefined diff --git a/roles/vpn/defaults/main.yml b/roles/vpn/defaults/main.yml index a865dfb..c9b81ce 100644 --- a/roles/vpn/defaults/main.yml +++ b/roles/vpn/defaults/main.yml @@ -35,7 +35,7 @@ algo_local_dns: false ipv6_support: false dns_encryption: true domain: false -subjectAltName_IP: "IP:{{ IP_subject_alt_name }}" +subjectAltName_IP: "{{ 'DNS:' if IP_subject_alt_name|regex_search('[a-z]') else 'IP:' }}{{ IP_subject_alt_name }}" subjectAltName_USER: "{% if '@' in item %}email:{{ item }}{% else %}DNS:{{ item }}{% endif %}" openssl_bin: openssl strongswan_enabled_plugins: