Add variable for container restart timeout

Sometimes containers faill to start in time, this change allows us to
control the container start timeout with a single variable.

Related: #427
This commit is contained in:
Hugh Saunders 2014-10-28 16:46:27 +00:00
parent b2d4c0a923
commit 2901062733
5 changed files with 7 additions and 4 deletions

View File

@ -189,3 +189,6 @@ logstash_port: 5544
# Directory where serverspec is installed to on utility container
serverspec_install_dir: /opt/serverspec
# How long to wait for a container after a (re)start
container_start_timeout: 180

View File

@ -34,7 +34,7 @@
- name: Wait for container networking
wait_for: >
port=22
timeout=60
timeout={{ container_start_timeout }}
search_regex=OpenSSH
host={{ container_address }}
when: restarted_container|changed and is_metal != true

View File

@ -44,7 +44,7 @@
wait_for:
port: "22"
search_regex: "OpenSSH"
timeout: "60"
timeout: "{{ container_start_timeout }}"
host: "{{ container_address }}"
delegate_to: localhost
when: inner_extra_changed|changed or local_extra_changed|changed or config_extra_changed|changed

View File

@ -34,7 +34,7 @@
- name: Check Networking After Restart
wait_for: >
port=22
timeout=60
timeout={{ container_start_timeout }}
search_regex=OpenSSH
host={{ hostvars[item]['container_address'] }}
with_items: container_groups

View File

@ -34,7 +34,7 @@
- name: Wait for container networking
wait_for: >
port=22
timeout=60
timeout={{ container_start_timeout }}
search_regex=OpenSSH
host={{ container_address }}
when: restarted_container|changed and is_metal != true