Update integration tests

This commit is contained in:
Александр Бакановский
2024-09-17 17:26:35 +03:00
parent 1ec0718e7b
commit 76e3baa72d
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
---
- 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