2019-12-11 06:26:29 +00:00
|
|
|
# this (hosts.yml) WAS invoked by roles/network/tasks/main.yml up until 2019-12-10
|
2019-12-11 06:21:03 +00:00
|
|
|
|
2017-05-27 18:09:50 +00:00
|
|
|
#TODO: Use vars instead of hardcoded values
|
2018-10-08 22:49:04 +00:00
|
|
|
- name: Remove FQDN with 172.18.96.1 in /etc/hosts without LAN (if iiab_lan_iface == "none" and not installing)
|
|
|
|
lineinfile:
|
2018-10-03 22:20:00 +00:00
|
|
|
path: /etc/hosts
|
2018-10-08 22:49:04 +00:00
|
|
|
regexp: '^172\.18\.96\.1'
|
|
|
|
state: absent
|
2017-06-09 23:25:56 +00:00
|
|
|
when: iiab_lan_iface == "none" and not installing
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2018-10-08 22:49:04 +00:00
|
|
|
- name: Configure FQDN with 172.18.96.1 in /etc/hosts with LAN (if iiab_lan_iface != "none" and not installing)
|
|
|
|
lineinfile:
|
2018-10-03 22:20:00 +00:00
|
|
|
path: /etc/hosts
|
2018-10-08 22:49:04 +00:00
|
|
|
regexp: '^172\.18\.96\.1'
|
2019-06-20 04:30:55 +00:00
|
|
|
line: '172.18.96.1 {{ iiab_hostname }}.{{ iiab_domain }} {{ iiab_hostname }} box box.lan'
|
2018-10-08 22:49:04 +00:00
|
|
|
state: present
|
2019-07-29 17:06:39 +00:00
|
|
|
when: not (iiab_lan_iface == "none") and not installing
|
2017-05-27 18:09:50 +00:00
|
|
|
|
2019-07-08 19:15:48 +00:00
|
|
|
# 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?)'
|
2018-10-08 22:49:04 +00:00
|
|
|
lineinfile:
|
2018-10-03 22:20:00 +00:00
|
|
|
path: /etc/hosts
|
2018-10-08 22:49:04 +00:00
|
|
|
regexp: '^127\.0\.0\.1'
|
2019-07-08 17:25:56 +00:00
|
|
|
line: '127.0.0.1 {{ iiab_hostname }}.{{ iiab_domain }} localhost.localdomain localhost {{ iiab_hostname }} box box.lan'
|
2018-10-08 22:49:04 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2017-06-09 23:25:56 +00:00
|
|
|
when: iiab_lan_iface == "none" and not installing
|