2017-07-19 09:00:27 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Query Azure VMs IPs
|
|
|
|
command: az vm list-ip-addresses -o json --resource-group {{ azure_resource_group }}
|
|
|
|
register: vm_ip_list_cmd
|
|
|
|
|
|
|
|
- name: Query Azure VMs Roles
|
|
|
|
command: az vm list -o json --resource-group {{ azure_resource_group }}
|
|
|
|
register: vm_list_cmd
|
|
|
|
|
2019-05-16 07:27:43 +00:00
|
|
|
- name: Set VM IP and roles lists
|
|
|
|
set_fact:
|
2017-07-19 09:00:27 +00:00
|
|
|
vm_ip_list: "{{ vm_ip_list_cmd.stdout }}"
|
|
|
|
vm_roles_list: "{{ vm_list_cmd.stdout }}"
|
|
|
|
|
|
|
|
- name: Generate inventory
|
2019-05-02 21:24:21 +00:00
|
|
|
template:
|
|
|
|
src: inventory.j2
|
|
|
|
dest: "{{ playbook_dir }}/inventory"
|