Merge "Use wait_for_connection instead of wait_for to check container"
This commit is contained in:
commit
7fbdab8393
@ -124,16 +124,12 @@
|
||||
tags:
|
||||
- common-lxc
|
||||
|
||||
- name: Wait for container ssh
|
||||
wait_for:
|
||||
port: "22"
|
||||
delay: "{{ ssh_delay }}"
|
||||
search_regex: "OpenSSH"
|
||||
host: "{{ ansible_host }}"
|
||||
delegate_to: "{{ physical_host }}"
|
||||
register: ssh_wait_check
|
||||
until: ssh_wait_check | success
|
||||
retries: 3
|
||||
- name: Wait for container connectivity
|
||||
wait_for_connection:
|
||||
connect_timeout: "{{ lxc_container_wait_params.connect_timeout | default(omit) }}"
|
||||
delay: "{{ lxc_container_wait_params.delay | default(omit) }}"
|
||||
sleep: "{{ lxc_container_wait_params.sleep | default(omit) }}"
|
||||
timeout: "{{ lxc_container_wait_params.timeout | default(omit) }}"
|
||||
when:
|
||||
- (_mc is defined and _mc | changed) or (_ec is defined and _ec | changed)
|
||||
- not is_metal | bool
|
||||
|
@ -21,3 +21,11 @@ lxc_container_config_list:
|
||||
# Needed by playbooks/common-tasks/os-lxc-container-setup.yml
|
||||
lxc_container_log_path: "/var/log/lxc"
|
||||
|
||||
## Parameters provided to the wait_for_connection module after a container
|
||||
## reboot is triggered by the playbook
|
||||
lxc_container_wait_params:
|
||||
# Wait 3 seconds before attempting the first connection
|
||||
delay: 3
|
||||
# Wait 60 seconds for the container to respond
|
||||
timeout: 60
|
||||
|
||||
|
@ -25,13 +25,12 @@
|
||||
roles:
|
||||
- role: "lxc_container_create"
|
||||
post_tasks:
|
||||
- name: Wait for ssh to be available
|
||||
wait_for:
|
||||
port: "22"
|
||||
host: "{{ ansible_host | default(inventory_hostname) }}"
|
||||
search_regex: OpenSSH
|
||||
delay: 1
|
||||
delegate_to: "{{ physical_host }}"
|
||||
- name: Wait for container connectivity
|
||||
wait_for_connection:
|
||||
connect_timeout: "{{ lxc_container_wait_params.connect_timeout | default(omit) }}"
|
||||
delay: "{{ lxc_container_wait_params.delay | default(omit) }}"
|
||||
sleep: "{{ lxc_container_wait_params.sleep | default(omit) }}"
|
||||
timeout: "{{ lxc_container_wait_params.timeout | default(omit) }}"
|
||||
vars:
|
||||
is_metal: "{{ properties.is_metal|default(false) }}"
|
||||
tags:
|
||||
|
Loading…
x
Reference in New Issue
Block a user