Files
ansible-freeipa/tests/user/test_users_present_absent.yml
Thomas Woerner a95c222ed6 Fix multi user tests
The tests test_users_present.yml and test_users_absent.yml has been
merged into test_users_present_absent.yml to fix the independent test
order execution.

The test test_users_present_slice.yml has been renamed to
test_users_present_absent_slice.yml.

Both tests are cleaning up possible exiting entries before running the tests
and are verifying the present and absent task result.
2024-07-22 16:29:19 +02:00

40 lines
1.1 KiB
YAML

---
- name: Include create_users_json.yml
ansible.builtin.import_playbook: create_users_json.yml
- name: Test users present and absent
hosts: ipaserver
become: true
gather_facts: false
tasks:
- name: Include users.json
ansible.builtin.include_vars:
file: users.json # noqa missing-import
- name: Create dict with user names
ansible.builtin.set_fact:
user_names: "{{ user_names | default([]) + [{'name': item.name}] }}"
loop: "{{ users }}"
- name: Cleanup test users len:{{ users | length }}
ipauser:
ipaadmin_password: SomeADMINpassword
users: "{{ user_names }}"
state: absent
- name: Users present len:{{ users | length }}
ipauser:
ipaadmin_password: SomeADMINpassword
users: "{{ users }}"
register: result
failed_when: not result.changed or result.failed
- name: Users absent len:{{ users | length }}
ipauser:
ipaadmin_password: SomeADMINpassword
users: "{{ user_names }}"
state: absent
register: result
failed_when: not result.changed or result.failed