Skip to content

Commit 4922546

Browse files
author
G. Roggemans
authored
Merge pull request #4 from groggemans/add_params
Added more parameters
2 parents d63d5d6 + ec049cf commit 4922546

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,18 @@ A role for rebooting hosts.
1414

1515
## Role Variables
1616

17-
| Variable | Description | Default value |
18-
|---------------------------|---------------------------------------------------------|--------------------------------------------|
19-
| `reboot_message` | Reboot message for the logs | 'Reboot by Ansible' |
20-
| `reboot_wait` | Wait for hosts to come back online? | 'yes' |
21-
| `reboot_wait_host` | Host to check | `ansible_ssh_host` or `inventory_hostname` |
22-
| `reboot_wait_port` | Port to check | `ansible_ssh_port` or 22 |
23-
| `reboot_wait_delay` | Time to wait before polling the host (seconds) | 10 |
24-
| `reboot_wait_timeout` | Timeout for host to come back up successfully (seconds) | 300 |
25-
| `reboot_interval` | Interval between reboot and next task? | 'no' |
26-
| `reboot_interval_seconds` | Seconds to pause after reboot | 0 |
17+
| Variable | Description | Default value |
18+
|---------------------------|-----------------------------------------------------------|--------------------------------------------|
19+
| `reboot_message` | Reboot message for the logs | 'Reboot by Ansible' |
20+
| `reboot_wait` | Wait for hosts to come back online? | 'yes' |
21+
| `reboot_wait_host` | Host to check | `ansible_ssh_host` or `inventory_hostname` |
22+
| `reboot_wait_port` | Port to check | `ansible_ssh_port` or 22 |
23+
| `reboot_wait_regex` | String to match in the socket connection. (ex. `OpenSSH`) | / |
24+
| `reboot_wait_delay` | Time to wait before polling the host (seconds) | 10 |
25+
| `reboot_wait_timeout` | Timeout for host to come back up successfully (seconds) | 300 |
26+
| `reboot_wait_ctimeout` | Timeout for each connection attempt (seconds) | 5 |
27+
| `reboot_interval` | Interval between reboot and next task? | 'no' |
28+
| `reboot_interval_seconds` | Seconds to pause after reboot | 0 |
2729

2830
#### Attention:
2931
All boolean values can be used with either `'yes'`/`'no'` or `true`/`false`.

defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ reboot_wait_delay: 10
1313
# Timeout for host to come back up successfully
1414
reboot_wait_timeout: 300
1515

16+
# Timeout for each connection attempt
17+
reboot_wait_ctimeout: 5
18+
1619
# Interval after reboot?
1720
reboot_interval: 'no'
1821

tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
state=started
3131
delay="{{ reboot_wait_delay }}"
3232
timeout="{{ reboot_wait_timeout }}"
33+
search_regex="{{ reboot_wait_regex | default(omit) }}"
34+
connect_timeout="{{ reboot_wait_ctimeout }}"
3335
when: reboot_wait|string in 'True.true.Yes.yes'
3436
# Checked as string to make sure it can be specified from the command line.
3537

0 commit comments

Comments
 (0)