From 0364e2cc29ce4f83a770d5bf33f74388c71185b1 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Mon, 4 May 2015 12:50:41 -0400 Subject: Adding towercli config to /etc/tower --- roles/ansible_tower/tasks/main.yaml | 10 ++++++++++ roles/ansible_tower_cli/tasks/main.yml | 8 ++++++++ roles/ansible_tower_cli/templates/tower_cli.cfg.j2 | 5 +++++ 3 files changed, 23 insertions(+) create mode 100644 roles/ansible_tower_cli/templates/tower_cli.cfg.j2 diff --git a/roles/ansible_tower/tasks/main.yaml b/roles/ansible_tower/tasks/main.yaml index a85ce7dcc..d27c48e6a 100644 --- a/roles/ansible_tower/tasks/main.yaml +++ b/roles/ansible_tower/tasks/main.yaml @@ -30,3 +30,13 @@ - name: Set (httpd_can_network_connect_db) flag on and keep it persistent across reboots seboolean: name=httpd_can_network_connect_db state=yes persistent=yes + +- name: Setup proot to allow access to /etc/tower/ + lineinfile: + dest: /etc/tower/settings.py + backrefs: yes + regexp: "^({{ item.option }})( *)=" + line: '\1\2 = {{ item.value }}' + with_items: config_changes | default([]) + + diff --git a/roles/ansible_tower_cli/tasks/main.yml b/roles/ansible_tower_cli/tasks/main.yml index adf02ddc6..65aa6bdf4 100644 --- a/roles/ansible_tower_cli/tasks/main.yml +++ b/roles/ansible_tower_cli/tasks/main.yml @@ -1,3 +1,11 @@ --- - name: Install python-ansible-tower-cli yum: name=python-ansible-tower-cli + +- template: + src: tower_cli.cfg.j2 + dest: /etc/tower/tower_cli.cfg + owner: awx + group: awx + mode: 0640 + diff --git a/roles/ansible_tower_cli/templates/tower_cli.cfg.j2 b/roles/ansible_tower_cli/templates/tower_cli.cfg.j2 new file mode 100644 index 000000000..5a0a275b0 --- /dev/null +++ b/roles/ansible_tower_cli/templates/tower_cli.cfg.j2 @@ -0,0 +1,5 @@ +[general] +host = {{ oo_towercli_host }} +username = {{ oo_towercli_username }} +password = {{ oo_towercli_password }} +verify_ssl = true -- cgit v1.2.3