Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. - block
  2. - name: wait for new host to respond to ssh
  3. wait_for:
  4. port: 22
  5. host: "{{ item.openstack.public_v4 }}"
  6. search_regex: OpenSSH
  7.  
  8. - name: scan the ssh key of the new host
  9. command: "{{ 'ssh-keyscan -t rsa ' + item.openstack.public_v4 }}"
  10. register: keyscan
  11.  
  12. - name: ensure new servers are in known_hosts
  13. known_hosts:
  14. path: /home/cideploy/.ssh/known_hosts
  15. name: item.openstack.public_v4
  16. key: "{{ keyscan.stdout }}"
  17. with_items: "{{ openstack_instances.results }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement