ansible.posix/tests/integration/targets/authorized_key/tasks/check_path.yml
Александр Бакановский 76e3baa72d
Update integration tests
2024-09-17 17:26:35 +03:00

31 lines
742 B
YAML

---
- name: Create key file for test
ansible.builtin.copy:
dest: "{{ key_path }}"
content: "{{ rsa_key_basic }}"
- name: Add key using path
ansible.posix.authorized_key:
user: root
key: "{{ key_path }}"
state: present
path: "{{ output_dir | expanduser }}/authorized_keys"
register: result
- name: Assert that the key was added
ansible.builtin.assert:
that:
- result.changed == true
- name: Add key using path again
ansible.posix.authorized_key:
user: root
key: "{{ key_path }}"
state: present
path: "{{ output_dir | expanduser }}/authorized_keys"
register: result
- name: Assert that no changes were applied
ansible.builtin.assert:
that:
- result.changed == false