Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. - name: Wait for SSH to come up
  2. wait_for:
  3. host: "{{ instance.instances[0].private_ip_address }}"
  4. port: 22
  5. state: started
  6.  
  7. - name: Add all instance public IPs to host group # this is only temporary and not permanent
  8. add_host: hostname={{ instance.instances[0].private_ip_address }} groups=tmp
  9.  
  10. - hosts: tmp
  11. name: init configuration play
  12. user: admin
  13. gather_facts: False
  14.  
  15. tasks:
  16. - name: set hostname from previous play
  17. set_fact:
  18. hostname: "{{ hostvars['localhost']['this_hostname'] }}"
  19. init: "{{ hostvars['localhost']['init'] }}"
  20.  
  21. - name: init debian
  22. include_role:
  23. name: debian
  24. tasks_from: init
  25. when: init | bool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement