Fix private_ip checking

role_netmaker_server
Ruakij 2 years ago
parent d2d8ebd8cc
commit 315f5a1805

@ -7,4 +7,3 @@
- name: Check if default-ipv4-address is private - name: Check if default-ipv4-address is private
set_fact: set_fact:
private_ipv4_address: "{{ ansible_facts.default_ipv4.address | regex_search('^((10)|(192\\.168)|(172\\.((1[6-9])|(2[0-9])|(3[0-1])))|(100))\\.') }}" private_ipv4_address: "{{ ansible_facts.default_ipv4.address | regex_search('^((10)|(192\\.168)|(172\\.((1[6-9])|(2[0-9])|(3[0-1])))|(100))\\.') }}"
when: "netmaker.dynamicIp"

@ -63,7 +63,7 @@ services:
NODE_ID: "{{ ansible_facts.nodename }}" NODE_ID: "{{ ansible_facts.nodename }}"
MASTER_KEY: "{{ netmaker.master_key }}" # The admin master key for accessing the API. Change this in any production installation. MASTER_KEY: "{{ netmaker.master_key }}" # The admin master key for accessing the API. Change this in any production installation.
{% if not private_ipv4_address %} {% if not private_ipv4_address and not netmaker.dynamicIp %}
SERVER_HOST: "{{ ansible_facts.default_ipv4.address }}" # Set to public IP of machine. SERVER_HOST: "{{ ansible_facts.default_ipv4.address }}" # Set to public IP of machine.
{% endif %} {% endif %}
SERVER_NAME: "netmaker-broker.{{ netmaker.base_domain }}" # The domain/host IP indicating the mq broker address SERVER_NAME: "netmaker-broker.{{ netmaker.base_domain }}" # The domain/host IP indicating the mq broker address

Loading…
Cancel
Save