-
Notifications
You must be signed in to change notification settings - Fork 8
/
add_to_Tower_inventory.yaml
27 lines (25 loc) · 1.06 KB
/
add_to_Tower_inventory.yaml
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
---
- name: Create Linux VM in inventory
hosts: localhost
connection: local
gather_facts: no
vars:
tower_user:
tower_password:
vm_name: rhel7-0088
tower_inventory: 'Linux Inventory'
tasks:
- name: Create host in inventory to pass to next playbook using tower-cli host create -n
shell: |
tower-cli config host localhost
tower-cli config verify_ssl false
tower-cli login {{ tower_user }} --password {{ tower_password }}
tower-cli host create -n {{ vm_name }} -i {{ tower_inventory }} --variables='{"ansible_user":"root", "ansible_host":"100.9.133.13"}'
no_log: false
#- name: Create host in inventory to pass to next playbook using tower-cli host create -n
# command: "{{ item }}"
# no_log: true
# with_items:
# - tower-cli config host localhost
# - tower-cli login {{ tower_user }} --password {{ tower_password }}
# - tower-cli host create -n {{ vm_name }} -i 'Linux Inventory' --variables='{"ansible_user":"root", "ansible_host":"100.9.133.13"}'