- name: Install required packages
|
yum:
|
name: "{{item}}"
|
state: latest
|
with_items:
|
- python
|
- python-pip
|
- python-devel
|
- gcc
|
- name: Install tower-cli
|
pip:
|
name: ansible-tower-cli
|
state: latest
|
|
- name: Configure the tower cli file
|
template:
|
src: tower_cli.j2
|
dest: "~/.tower_cli.cfg"
|
mode: 0600
|
|
- name: Append file
|
lineinfile:
|
path: /root/license.txt
|
insertbefore: '"company_name.*"'
|
line: '"eula_accepted" : "true",'
|
|
- name: Add the tower license
|
command: |
|
tower-cli setting modify LICENSE @/root/license.txt
|
|
- name: Copy read only credentials
|
template:
|
src: read_only.json
|
dest: /tmp/read_only.json
|
- name: Remove License file
|
file:
|
path: /root/license.txt
|
state: absent
|
- name: inject aws read-only credentials into tower
|
shell: tower-cli credential create --credential-type 'Amazon Web Services' --name "AWS Access Key" --organization Default --inputs @/tmp/read_only.json
|
|
|
- name: Remove access key file
|
file:
|
path: /tmp/read_only.json
|
state: absent
|