-
Notifications
You must be signed in to change notification settings - Fork 0
/
awx_startup.yml
56 lines (46 loc) · 1.37 KB
/
awx_startup.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
---
# This playbook brings up the AWX Host VM along with the test Linux and Windows VMs
# running on KVM on the localhost. It then prints the AWX URL with the AWX Host IP.
# Run with --ask-become-pass
# Usage:
# ansible-playbook -i inventory/hosts awx_startup.yml --ask-become-pass
- name: To bring up KVM VMs on localhost supporting AWX playground
hosts: localhost
become: yes
vars:
awx_host_vm: ubuntu18.04_Ansible_AWX
linux_host_vms:
- ""
windows_host_vms:
- "win2k16"
tasks:
- name: Install Python3-pip if needed
yum:
name:
- "python3-pip"
state: latest
- name: Install Python modules required by virt-net module
pip:
name:
- "libvirt-python"
- "lxml"
executable: "/usr/bin/pip3"
state: present
- name: Bring up Guest VMs for ansible AWX Testing
virt:
name: "{{ item }}"
state: running
with_items:
- "{{ awx_host_vm }}"
- "{{ linux_host_vms }}"
- "{{ windows_host_vms }}"
when: item is defined and item != ''
- name: Check AWX Host VM Details
virt_net:
#name: "{{ awx_host_vm }}"
command: info
register: awx_host_vm_details
- name: "Print IP Addresses"
debug:
msg: "Host Name: {{ item.hostname }}, IP Addess: {{ item.ipaddr }}"
loop: "{{ awx_host_vm_details.networks.default.dhcp_leases }}"