diff --git a/roles/2-common/tasks/hostname.yml b/roles/2-common/tasks/hostname.yml index a3ae16870..a4e400924 100644 --- a/roles/2-common/tasks/hostname.yml +++ b/roles/2-common/tasks/hostname.yml @@ -9,3 +9,11 @@ group=root mode=0644 when: is_redhat + +- name: Configure short hostname in /etc/hosts + lineinfile: dest=/etc/hosts + regexp='^127\.0\.0\.1' + line='127.0.0.1 localhost.localdomain localhost box {{ iiab_hostname }}' + owner=root + group=root + mode=0644 diff --git a/roles/network/tasks/hosts.yml b/roles/network/tasks/hosts.yml index 693400c54..cf4b38278 100644 --- a/roles/network/tasks/hosts.yml +++ b/roles/network/tasks/hosts.yml @@ -1,12 +1,4 @@ #TODO: Use vars instead of hardcoded values -- name: Configure short hostname in /etc/hosts - lineinfile: dest=/etc/hosts - regexp='^127\.0\.0\.1' - line='127.0.0.1 localhost.localdomain localhost box {{ iiab_hostname }}' - owner=root - group=root - mode=0644 - - name: Remove fqdn in /etc/hosts without LAN lineinfile: dest=/etc/hosts regexp='^172\.18\.96\.1'