Azure. Add to the inventory #30

pull/262/head
Jack Ivanov 7 years ago
parent 8280201dc1
commit c52024d4cc

@ -77,3 +77,17 @@
- set_fact:
cloud_instance_ip: "{{ ip_address }}"
- name: Ensure the group azure exists in the dynamic inventory file
lineinfile:
state: present
dest: configs/inventory.dynamic
line: '[azure]'
- name: Populate the dynamic inventory
lineinfile:
state: present
dest: configs/inventory.dynamic
insertafter: '\[azure\]'
regexp: "^{{ cloud_instance_ip }}.*"
line: "{{ cloud_instance_ip }}"

Loading…
Cancel
Save