--- - hosts: localhost collections: - theforeman.foreman tags: - setup gather_facts: false vars_files: - vars/server.yml tasks: - include_tasks: tasks/location.yml vars: location_state: "present" - include_tasks: tasks/organization.yml vars: organization_state: "present" - hosts: tests collections: - theforeman.foreman tags: - test gather_facts: false vars_files: - vars/server.yml tasks: # create user - include_tasks: tasks/user.yml vars: user_state: present user_password: s3cret expected_change: true # verify idempotence - include_tasks: tasks/user.yml vars: user_state: present expected_change: false # change user - include_tasks: tasks/user.yml vars: user_state: present user_locale: "{{ omit }}" user_mail: "{{ omit }}" user_description: A great manager expected_change: true # try to auth as new user - include_tasks: tasks/user.yml vars: foreman_username: test foreman_password: s3cret user_state: present user_mail: "{{ omit }}" user_auth_source: "{{ omit }}" expected_change: true # change password - include_tasks: tasks/user.yml vars: user_state: present user_password: newp@ass user_mail: "{{ omit }}" expected_change: true # try to auth as new user with new password - include_tasks: tasks/user.yml vars: foreman_username: test foreman_password: newp@ass user_state: present user_mail: test.user@example.com user_auth_source: "{{ omit }}" expected_change: true # remove user - include_tasks: tasks/user.yml vars: user_state: absent expected_change: true # verify idempotence for absence - include_tasks: tasks/user.yml vars: user_state: absent expected_change: false - hosts: localhost collections: - theforeman.foreman tags: - teardown gather_facts: false vars_files: - vars/server.yml tasks: - include_tasks: tasks/location.yml vars: location_state: "absent" - include_tasks: tasks/organization.yml vars: organization_state: "absent" ...