Skip to content

Commit

Permalink
Removed hardcoded entries in /etc/hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
dn0 committed Jan 13, 2017
1 parent 1a10512 commit 54415d0
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ansible/build-esdc-mon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
- zabbix-agent
- cloud-init
- rc-scripts
- esdc-mon
- iptables
- mdata-client
- qemu-guest-agent
- ludolph
- esdc-mon
- passwords
- vm-image

Expand Down
3 changes: 0 additions & 3 deletions ansible/roles/esdc-mgmt/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@

- name: Revert hostname back to localhost.localdomain
hostname: name=localhost.localdomain

- name: Delete hostname from /etc/hosts
lineinfile: dest=/etc/hosts line="127.0.0.1 {{ hostname | regex_replace('^(.*)\.(.*)$', '\\1') }}" state=absent
3 changes: 0 additions & 3 deletions ansible/roles/esdc-mgmt/tasks/os.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
- name: Set hostname to {{ hostname }}
hostname: name={{ hostname }}

- name: Add hostname to /etc/hosts
lineinfile: dest=/etc/hosts insertafter="EOF" line="127.0.0.1 {{ hostname | regex_replace('^(.*)\.(.*)$', '\\1') }}" state=present

- name: Install Remi RPM repository
yum: name="http://rpms.famillecollet.com/enterprise/remi-release-7.rpm" state=present

Expand Down
2 changes: 0 additions & 2 deletions ansible/roles/esdc-mon/tasks/01-os.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
---
- name: Add hostname to /etc/hosts
lineinfile: dest=/etc/hosts insertafter="EOF" line="127.0.0.1 {{ hostname | regex_replace('^(.*)\.(.*)$', '\\1') }}" state=present
3 changes: 3 additions & 0 deletions ansible/roles/esdc-mon/tasks/09-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: Revert hostname back to localhost.localdomain
hostname: name=localhost.localdomain
1 change: 1 addition & 0 deletions ansible/roles/esdc-mon/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
- include: 03-httpd.yml
- include: 04-zabbix.yml
- include: 05-monitoring.yml
- include: 09-cleanup.yml

0 comments on commit 54415d0

Please sign in to comment.