Skip to content

Instantly share code, notes, and snippets.

@afahounko
Forked from sheldonh/local_wait.yml
Created July 6, 2020 06:53
Show Gist options
  • Select an option

  • Save afahounko/bd40a2a317387beb9712872ce1ba8dd1 to your computer and use it in GitHub Desktop.

Select an option

Save afahounko/bd40a2a317387beb9712872ce1ba8dd1 to your computer and use it in GitHub Desktop.
Wait for SSH to come up in an Ansible playbook
---
- hosts: demo
tags: wait
gather_facts: no
tasks:
- name: Wait for SSH
local_action: wait_for port=22 host={% if ansible_ssh_host is defined %}{{ ansible_ssh_host }}{% else %}{{ inventory_hostname }}{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment