Skip to content
Snippets Groups Projects
Commit 74e8a4bb authored by Chris Hines's avatar Chris Hines
Browse files

make etcHosts install from a stactic file rather than generating form ansible facts

parent 27a9b4f3
No related branches found
No related tags found
No related merge requests found
- name: get_groups_json - name: install hosts file
template: dest=/tmp/groups src=groups.j2 copy: src=files/etcHosts dest=/etc/hosts owner=root mode=644
run_once: True
delegate_to: 127.0.0.1
- name: copy script
copy: src=makehosts.py dest=/tmp/makehosts.py mode=755
delegate_to: 127.0.0.1
run_once: True
- name: make hosts data
command: /tmp/makehosts.py /tmp/groups {{ domain }}
delegate_to: 127.0.0.1
run_once: True
sudo: true
register: hosts_data
- name: write hosts file
lineinfile:
args:
dest: /etc/hosts
line: "{{ item }}"
state: present
sudo: true sudo: true
with_items: hosts_data.stdout_lines
- name: set hostname by sysctl - name: set hostname by sysctl
shell: sysctl kernel.hostname="{{ ansible_hostname }}" shell: sysctl kernel.hostname="{{ ansible_hostname }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment