-
Notifications
You must be signed in to change notification settings - Fork 413
/
aws_creds.yml
58 lines (56 loc) · 1.64 KB
/
aws_creds.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
- hosts: tag_AnsibleGroup_bastions
gather_facts: true
become: true
tasks:
- name: Install required packages
yum:
name: "{{item}}"
state: latest
loop:
- python
- python-pip
- python-devel
- gcc
- name: Install tower-cli
pip:
name: ansible-tower-cli
state: latest
- name: List key files
shell: (cd /root/.ssh; find . -maxdepth 1 -type f -iname '*key.pem')| cut -d'/' -f2
register: file_to_copy
- name: Tower Creds key file
tower_credential:
name: Creds for AWS instances
organization: Default
state: present
kind: ssh
tower_host: tower1.{{tower_guid}}.example.opentlc.com
tower_username: admin
tower_password: r3dh4t1!
tower_verify_ssl: no
ssh_key_data: "/root/.ssh/{{ file_to_copy.stdout }}"
username: ec2-user
- name: Update Prod Job template
tower_job_template:
name: "3 tier app on Prod"
machine_credential: "Creds for AWS instances"
tower_host: tower1.{{tower_guid}}.example.opentlc.com
tower_username: admin
tower_password: r3dh4t1!
tower_verify_ssl: no
state: present
job_type: run
playbook: site-3tier-app.yml
project: "Homework Assignment"
- name: Update Prod Smoke Job template
tower_job_template:
name: "Smoke test Prod env"
machine_credential: "Creds for AWS instances"
tower_host: tower1.{{tower_guid}}.example.opentlc.com
tower_username: admin
tower_password: r3dh4t1!
tower_verify_ssl: no
state: present
job_type: run
playbook: site-smoketest-aws.yml
project: "Homework Assignment"