Newer
Older
- name: Include create_users_json.yml
ansible.builtin.import_playbook: create_users_json.yml
hosts: ipaserver
become: true
gather_facts: false
tasks:
- name: Include users.json
file: users.json # noqa missing-import
- name: Create dict with user names
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 }}"
register: result
failed_when: not result.changed or result.failed