Files
home-cluster/bootstrap/tasks/validation/age.yaml
T

22 lines
738 B
YAML

---
- name: Query age key file
ansible.builtin.stat:
path: "{{ repository_path }}/age.key"
register: result
- name: Check if age key file exists
ansible.builtin.assert:
that: result.stat.exists
success_msg: Age file {{ repository_path }}/age.key exists
fail_msg: Age file {{ repository_path }}/age.key does not exist
- name: Query age key file contents
ansible.builtin.set_fact:
age_contents: "{{ lookup('file', repository_path + '/age.key') }}"
- name: Check if age public keys match
ansible.builtin.assert:
that: bootstrap_age_public_key in age_contents
success_msg: Age public key {{ bootstrap_age_public_key }} exists
fail_msg: Age public key {{ bootstrap_age_public_key }} does not exist