Skip to content

Instantly share code, notes, and snippets.

@markuman
Created July 10, 2019 07:26
Show Gist options
  • Save markuman/61e15c77fce0058cfeeebdd8a502d7b1 to your computer and use it in GitHub Desktop.
Save markuman/61e15c77fce0058cfeeebdd8a502d7b1 to your computer and use it in GitHub Desktop.
- name: Wait for SSH to come up
wait_for:
host: "{{ instance.instances[0].private_ip_address }}"
port: 22
state: started
- name: Add all instance public IPs to host group # this is only temporary and not permanent
add_host: hostname={{ instance.instances[0].private_ip_address }} groups=tmp
- hosts: tmp
name: init configuration play
user: admin
gather_facts: False
tasks:
- name: set hostname from previous play
set_fact:
hostname: "{{ hostvars['localhost']['this_hostname'] }}"
init: "{{ hostvars['localhost']['init'] }}"
- name: init debian
include_role:
name: debian
tasks_from: init
when: init | bool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment