Skip to content
Snippets Groups Projects
Commit a631a52b authored by Jupiter Hu's avatar Jupiter Hu
Browse files

Furter to fix group generation and to edit hosts

parent e323f309
No related branches found
No related tags found
No related merge requests found
--- ---
domain: testdomain.massive.org.au domain: testdomain.massive.org.au
create_facts: true get_groups: true
edit_hosts: true
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
template: dest=/tmp/groups src=groups.j2 template: dest=/tmp/groups src=groups.j2
run_once: True run_once: True
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
when: create_facts when: get_groups
- name: make hosts data - name: make hosts data
command: ./scripts/makehosts.py /tmp/groups {{ domain }} command: ./scripts/makehosts.py /tmp/groups {{ domain }}
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
run_once: True run_once: True
register: hosts_data register: hosts_data
when: edit_hosts
- name: write hosts file - name: write hosts file
lineinfile: lineinfile:
...@@ -18,3 +19,5 @@ ...@@ -18,3 +19,5 @@
state: present state: present
sudo: true sudo: true
with_items: hosts_data.stdout_lines with_items: hosts_data.stdout_lines
when: edit_hosts
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