Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - block
- - name: wait for new host to respond to ssh
- wait_for:
- port: 22
- host: "{{ item.openstack.public_v4 }}"
- search_regex: OpenSSH
- - name: scan the ssh key of the new host
- command: "{{ 'ssh-keyscan -t rsa ' + item.openstack.public_v4 }}"
- register: keyscan
- - name: ensure new servers are in known_hosts
- known_hosts:
- path: /home/cideploy/.ssh/known_hosts
- name: item.openstack.public_v4
- key: "{{ keyscan.stdout }}"
- with_items: "{{ openstack_instances.results }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement