From d41abbbbc3390ad852ca7fda432072f94a299d84 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Oct 2018 14:52:04 -0400 Subject: [PATCH] Update hosts.yml --- roles/network/tasks/hosts.yml | 36 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/roles/network/tasks/hosts.yml b/roles/network/tasks/hosts.yml index 8c3a12a01..730b2762a 100644 --- a/roles/network/tasks/hosts.yml +++ b/roles/network/tasks/hosts.yml @@ -1,23 +1,25 @@ #TODO: Use vars instead of hardcoded values -- name: Remove fqdn in /etc/hosts without LAN - lineinfile: dest=/etc/hosts - regexp='^172\.18\.96\.1' - state=absent +- name: Remove FQDN in /etc/hosts without LAN + lineinfile: + dest: /etc/hosts + regexp: '^172\.18\.96\.1' + state: absent when: iiab_lan_iface == "none" and not installing -- name: Configure fqdn in /etc/hosts with LAN - lineinfile: dest=/etc/hosts - regexp='^172\.18\.96\.1' - line='172.18.96.1 {{ iiab_hostname }}.{{ iiab_domain }} {{ iiab_hostname }} box iiab-server.lan' - state=present +- name: Configure FQDN in /etc/hosts with LAN + lineinfile: + dest: /etc/hosts + regexp: '^172\.18\.96\.1' + line: '172.18.96.1 {{ iiab_hostname }}.{{ iiab_domain }} {{ iiab_hostname }} box iiab-server.lan' + state: present when: iiab_lan_iface != "none" and not installing -- name: Configure fqdn in /etc/hosts appliance mode - lineinfile: dest=/etc/hosts - regexp='^127\.0\.0\.1' - line='127.0.0.1 localhost.localdomain localhost {{ iiab_hostname }}.{{ iiab_domain }} {{ iiab_hostname }} box iiab-server.lan' - owner=root - group=root - mode=0644 +- name: Configure FQDN in /etc/hosts appliance mode + lineinfile: + dest: /etc/hosts + regexp: '^127\.0\.0\.1' + line: '127.0.0.1 localhost.localdomain localhost {{ iiab_hostname }}.{{ iiab_domain }} {{ iiab_hostname }} box iiab-server.lan' + owner: root + group: root + mode: 0644 when: iiab_lan_iface == "none" and not installing -