diff --git a/tasks/setupacdc.yml b/tasks/setupacdc.yml index c423979..40c73dd 100644 --- a/tasks/setupacdc.yml +++ b/tasks/setupacdc.yml @@ -70,6 +70,20 @@ register: start_result changed_when: "'started' in start_result.stdout or start_result.rc == 0" + - name: Wait until container has an IP address + ansible.builtin.shell: "pct exec {{ container_id }} -- hostname -I | awk '{print $1}'" + register: lxc_ip + until: lxc_ip.stdout != "" + retries: 10 + delay: 5 + changed_when: false + + - name: Wait for SSH to become available + ansible.builtin.wait_for: + host: "{{ lxc_ip.stdout }}" + port: 22 + delay: 5 + timeout: 60 - name: Provision dc1 LXC hosts: dc1