mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
The new generate_test_data.yml is creating the test data with ansible.builtin.shell and is not calling shell scripts any more. The generation in the yml file and also the set_fact calls make sure that the test data is used.
39 lines
951 B
YAML
39 lines
951 B
YAML
---
|
|
- name: Test users present and absent
|
|
hosts: ipaserver
|
|
become: true
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
- name: Include generate_test_data.yml
|
|
ansible.builtin.include_tasks: generate_test_data.yml
|
|
|
|
- name: Size of user_list
|
|
ansible.builtin.debug:
|
|
msg: "{{ user_list | length }}"
|
|
|
|
- name: Size of user_absent_list
|
|
ansible.builtin.debug:
|
|
msg: "{{ user_absent_list | length }}"
|
|
|
|
- name: Cleanup test users
|
|
ipauser:
|
|
ipaadmin_password: SomeADMINpassword
|
|
users: "{{ user_absent_list }}"
|
|
state: absent
|
|
|
|
- name: Users present
|
|
ipauser:
|
|
ipaadmin_password: SomeADMINpassword
|
|
users: "{{ user_list }}"
|
|
register: result
|
|
failed_when: not result.changed or result.failed
|
|
|
|
- name: Users absent
|
|
ipauser:
|
|
ipaadmin_password: SomeADMINpassword
|
|
users: "{{ user_absent_list }}"
|
|
state: absent
|
|
register: result
|
|
failed_when: not result.changed or result.failed
|