diff --git a/roles/0-init/tasks/hostname.yml b/roles/0-init/tasks/hostname.yml index 603b280e1..00a441bd8 100644 --- a/roles/0-init/tasks/hostname.yml +++ b/roles/0-init/tasks/hostname.yml @@ -24,11 +24,12 @@ mode: 0644 when: is_redhat | bool -- name: Put hostnames "127.0.0.1 localhost.localdomain localhost box {{ iiab_hostname }}" in /etc/hosts +# roles/network/tasks/hosts.yml ALSO does this: +- name: 'Put FQDN & hostnames in /etc/hosts: "127.0.0.1 {{ iiab_hostname }}.{{ iiab_domain }} localhost.localdomain localhost {{ iiab_hostname }} box box.lan"' lineinfile: path: /etc/hosts regexp: '^127\.0\.0\.1' - line: '127.0.0.1 localhost.localdomain localhost box {{ iiab_hostname }}' + line: '127.0.0.1 {{ iiab_hostname }}.{{ iiab_domain }} localhost.localdomain localhost {{ iiab_hostname }} box box.lan' owner: root group: root mode: 0644 diff --git a/roles/network/tasks/hosts.yml b/roles/network/tasks/hosts.yml index 4e0e2d026..e7796b008 100644 --- a/roles/network/tasks/hosts.yml +++ b/roles/network/tasks/hosts.yml @@ -14,11 +14,12 @@ state: present when: iiab_lan_iface != "none" and not installing -- name: Configure FQDN with 127.0.0.1 in /etc/hosts appliance mode (if iiab_lan_iface == "none" and not installing) +# roles/0-init/tasks/hostname.yml ALSO does this: +- name: 'Put FQDN & hostnames in /etc/hosts: "127.0.0.1 {{ iiab_hostname }}.{{ iiab_domain }} localhost.localdomain localhost {{ iiab_hostname }} box box.lan" (if iiab_lan_iface == "none" and not installing, appliance mode?)' lineinfile: path: /etc/hosts regexp: '^127\.0\.0\.1' - line: '127.0.0.1 localhost.localdomain localhost {{ iiab_hostname }}.{{ iiab_domain }} {{ iiab_hostname }} box box.lan' + line: '127.0.0.1 {{ iiab_hostname }}.{{ iiab_domain }} localhost.localdomain localhost {{ iiab_hostname }} box box.lan' owner: root group: root mode: 0644