vn-ansible/roles/debian-base/tasks/witness.yml

18 lines
506 B
YAML
Raw Normal View History

- name: Check if witness INI file exists
2024-10-16 15:53:15 +00:00
stat:
path: /etc/vn.ini
register: witness_file
- name: Set witness related variables
2024-10-16 15:53:15 +00:00
set_fact:
vn_first_time: "{{ not witness_file.stat.exists }}"
vn_witness_checked: true
- when: not vn_first_time
block:
- name: Slurp witness INI file
slurp:
src: /etc/vn.ini
register: vn_ini_file
- name: Put witness as dictionary into variable
set_fact:
vn_ini: "{{ vn_ini_file.content | b64decode | community.general.from_ini }}"