Skip to content
test_users_present_absent.yml 951 B
Newer Older
Thomas Woerner's avatar
Thomas Woerner committed
- 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 }}"
Thomas Woerner's avatar
Thomas Woerner committed
    ipauser:
      ipaadmin_password: SomeADMINpassword
      users: "{{ user_absent_list }}"
Thomas Woerner's avatar
Thomas Woerner committed
      state: absent

Thomas Woerner's avatar
Thomas Woerner committed
    ipauser:
      ipaadmin_password: SomeADMINpassword
Thomas Woerner's avatar
Thomas Woerner committed
    register: result
    failed_when: not result.changed or result.failed

    ipauser:
      ipaadmin_password: SomeADMINpassword
      users: "{{ user_absent_list }}"
      state: absent
Thomas Woerner's avatar
Thomas Woerner committed
    register: result
    failed_when: not result.changed or result.failed