2024-10-20 12:12:46 +00:00
|
|
|
- name: Check if witness file exists
|
2024-10-16 15:53:15 +00:00
|
|
|
stat:
|
|
|
|
path: /etc/vn.witness
|
2024-10-20 12:12:46 +00:00
|
|
|
register: witness_file
|
|
|
|
- name: Set the witness variable
|
2024-10-16 15:53:15 +00:00
|
|
|
set_fact:
|
2024-10-20 12:12:46 +00:00
|
|
|
vn_first_time: "{{ not witness_file.stat.exists }}"
|
|
|
|
- name: Create the witness file if it does not exist
|
2024-10-16 15:53:15 +00:00
|
|
|
file:
|
|
|
|
path: /etc/vn.witness
|
|
|
|
state: touch
|
2024-10-17 14:38:52 +00:00
|
|
|
when: vn_first_time
|