|
|
@@ -8,18 +8,23 @@
|
|
|
region_id=nyc1
|
|
|
image_id=debian-8-x64
|
|
|
ssh_key_ids={{ desktap.ssh_key.id }}
|
|
|
+ private_networking=yes
|
|
|
with_items: "{{ droplets }}"
|
|
|
register: droplet_details
|
|
|
|
|
|
#- debug: msg="IP is {{ item['droplet']['ip_address'] }}, ID is {{ item['droplet']['id']}}."
|
|
|
# with_items: "{{ droplet_details.results }}"
|
|
|
|
|
|
+- name: Save IP/ID/Group to file
|
|
|
+ local_action: copy content="{{ item['droplet']['ip_address'] }}" dest="/tmp/outfile{{item['droplet']['name']}}"
|
|
|
+ with_items: "{{ droplet_details.results }}"
|
|
|
+
|
|
|
- name: Add new droplet to host group
|
|
|
local_action: add_host hostname={{ item['droplet']['ip_address'] }} groupname={{ dogroupname }}
|
|
|
with_items: "{{ droplet_details.results }}"
|
|
|
|
|
|
- name: Wait for SSH to come up
|
|
|
- local_action: wait_for host={{ item['droplet']['ip_address'] }} port=22 delay=10 timeout=320 state=started
|
|
|
+ local_action: wait_for host={{ item['droplet']['ip_address'] }} port=22 delay=5 timeout=320 state=started
|
|
|
with_items: "{{ droplet_details.results }}"
|
|
|
|
|
|
- name: Keyscan droplets
|