From 8ba0149d5eb990901f929437a5ee3b8ca8089bff Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Mon, 18 May 2015 15:05:04 -0400 Subject: Updating ansible config through a separate config.yml --- roles/ansible/tasks/config.yml | 8 ++++++++ roles/ansible/tasks/main.yaml | 7 ------- roles/ansible/tasks/main.yml | 11 +++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 roles/ansible/tasks/config.yml delete mode 100644 roles/ansible/tasks/main.yaml create mode 100644 roles/ansible/tasks/main.yml (limited to 'roles/ansible/tasks') diff --git a/roles/ansible/tasks/config.yml b/roles/ansible/tasks/config.yml new file mode 100644 index 000000000..5e361429b --- /dev/null +++ b/roles/ansible/tasks/config.yml @@ -0,0 +1,8 @@ +--- +- name: modify ansible.cfg + lineinfile: + dest: /etc/ansible/ansible.cfg + backrefs: yes + regexp: "^#?({{ item.option }})( *)=" + line: '\1\2= {{ item.value }}' + with_items: cfg_options diff --git a/roles/ansible/tasks/main.yaml b/roles/ansible/tasks/main.yaml deleted file mode 100644 index 67a04b919..000000000 --- a/roles/ansible/tasks/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# Install ansible client - -- name: Install Ansible - yum: - pkg: ansible - state: installed diff --git a/roles/ansible/tasks/main.yml b/roles/ansible/tasks/main.yml new file mode 100644 index 000000000..5d20a3b35 --- /dev/null +++ b/roles/ansible/tasks/main.yml @@ -0,0 +1,11 @@ +--- +# Install ansible client + +- name: Install Ansible + yum: + pkg: ansible + state: installed + +- include: config.yml + vars: + cfg_options: "{{ ans_config }}" -- cgit v1.2.3