From 74e8a4bb3dcca9b21c7bba5d4e0a4f293feb3d38 Mon Sep 17 00:00:00 2001 From: Chris Hines <chris.hines@monash.edu> Date: Wed, 12 Aug 2015 06:35:28 +0000 Subject: [PATCH] make etcHosts install from a stactic file rather than generating form ansible facts --- roles/etcHosts/tasks/main.yml | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/roles/etcHosts/tasks/main.yml b/roles/etcHosts/tasks/main.yml index cb16e4d9..74c899c3 100644 --- a/roles/etcHosts/tasks/main.yml +++ b/roles/etcHosts/tasks/main.yml @@ -1,28 +1,6 @@ -- name: get_groups_json - template: dest=/tmp/groups src=groups.j2 - 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 +- name: install hosts file + copy: src=files/etcHosts dest=/etc/hosts owner=root mode=644 sudo: true - with_items: hosts_data.stdout_lines - name: set hostname by sysctl shell: sysctl kernel.hostname="{{ ansible_hostname }}" -- GitLab