aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/file_wait/tasks/check.yml
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-14 12:02:16 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-14 12:08:04 +0200
commit84066b29e322591ade980cb72e55c88b98d144c4 (patch)
treebb3c7e482f46156385c967c39d495f6a3867ef54 /roles/file_wait/tasks/check.yml
parentletsencrypt: fix manual token prompts (diff)
downloadinfra-ansible-84066b29e322591ade980cb72e55c88b98d144c4.tar.gz
infra-ansible-84066b29e322591ade980cb72e55c88b98d144c4.zip
update task names & add more logging
Diffstat (limited to '')
-rw-r--r--roles/file_wait/tasks/check.yml12
1 files changed, 8 insertions, 4 deletions
diff --git a/roles/file_wait/tasks/check.yml b/roles/file_wait/tasks/check.yml
index aba500b..aa55830 100644
--- a/roles/file_wait/tasks/check.yml
+++ b/roles/file_wait/tasks/check.yml
@@ -2,7 +2,7 @@
ansible.builtin.wait_for_connection:
timeout: '{{ file_wait_seconds }}'
-- name: Check if the file exists
+- name: Check if file exists
ansible.builtin.file:
path: '{{ file_wait_path }}'
state: file
@@ -16,10 +16,14 @@
- name: If the host restarted, try again
when: file_wait_check is unreachable
block:
- - name: Note a reboot happened
+ - name: Log the number of tolerable reboots
+ ansible.builtin.debug:
+ msg: 'Number of tolerable reboots: {{ file_wait_reboots }}'
+
+ - name: Decrement the number of tolerable reboots
ansible.builtin.set_fact:
file_wait_reboots: '{{ (file_wait_reboots | int) - 1 }}'
- - name: Retry if there're more attempts
+ - name: Retry if there're more tolerable reboots
ansible.builtin.include_tasks: check.yml
- when: (file_wait_reboots | int > 0)
+ when: (file_wait_reboots | int >= 0)