1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/network/tasks/hosts.yml
2018-10-08 19:34:04 -04:00

25 lines
1 KiB
YAML

#TODO: Use vars instead of hardcoded values
- name: Remove FQDN with 172.18.96.1 in /etc/hosts without LAN (if iiab_lan_iface == "none" and not installing)
lineinfile:
path: /etc/hosts
regexp: '^172\.18\.96\.1'
state: absent
when: iiab_lan_iface == "none" and not installing
- name: Configure FQDN with 172.18.96.1 in /etc/hosts with LAN (if iiab_lan_iface != "none" and not installing)
lineinfile:
path: /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 with 127.0.0.1 in /etc/hosts appliance mode (if iiab_lan_iface == "none" and not installing)
lineinfile:
path: /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