Skip to content

Commit

Permalink
Update /etc/hosts (#136)
Browse files Browse the repository at this point in the history
* Update /etc/hosts

full details in: #131 (comment)

* localhost.localdomain added as per SXA
  • Loading branch information
bblondin authored Jan 19, 2018
1 parent 8acc958 commit 45e2508
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,27 @@
command: chage -M -1 root
tags: root_account

#####################
# Update /etc/hosts #
#####################
- name: Update /etc/hosts file - IP FQDN hostname
lineinfile:
dest: /etc/hosts
regexp: "^(.*){{ ansible_hostname }}(.*)$"
line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}"
state: present
backup: yes
tags: hosts_file

- name: Update /etc/hosts file - 127.0.0.1
lineinfile:
dest: /etc/hosts
regexp: "^(.*)127.0.0.1(.*)$"
line: "127.0.0.1 localhost localhost.localdomain"
state: present
backup: yes
tags: hosts_file

########################
# Include OS variables #
########################
Expand Down

0 comments on commit 45e2508

Please sign in to comment.