-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathtower_unconfig.yml
46 lines (42 loc) · 1.46 KB
/
tower_unconfig.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
---
- name: Unconfigure Tower
hosts: tower_instances
gather_facts: no
vars:
ansible_ssh_user: ec2-user
ansible_python_interpreter: "python"
vars_files:
- aws_vars.yml
- tower_vars.yml
- name: Set Tower CLI Host
command: tower-cli config host "{{ hostvars[inventory_hostname].public_ip }}"
- name: Set Tower CLI Username
command: tower-cli config username "{{ tower_username }}"
- name: Set Tower CLI Password
command: tower-cli config password "{{ tower_password }}"
- name: Remove Demo Job Template
tower_job_template:
name: "Demo Job Template"
state: absent
project: "Demo Project"
playbook: ""
job_type: run
tower_host: "{{ hostvars[inventory_hostname].public_ip }}"
tower_username: "{{ tower_username }}"
tower_password: "{{ tower_password }}"
- name: Remove Demo Project
tower_project:
name: "Demo Project"
organization: "{{ tower_org }}"
state: absent
tower_host: "{{ hostvars[inventory_hostname].public_ip }}"
tower_username: "{{ tower_username }}"
tower_password: "{{ tower_password }}"
- name: Remove Demo Inventory
tower_inventory:
tower_host: "{{ hostvars[inventory_hostname].public_ip }}"
tower_username: "{{ tower_username }}"
tower_password: "{{ tower_password }}"
name: "Demo Inventory"
organization: "{{ tower_org }}"
state: absent