Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test cases for remove operation #14

Merged
merged 12 commits into from
Jul 13, 2018
Prev Previous commit
Next Next commit
Use set_fact task instead of play vars
  • Loading branch information
Rickkwa committed Jul 13, 2018
commit 17c296ef33ae7b968bf2bff695bca26c4895134f
56 changes: 31 additions & 25 deletions tests/test-dry-run.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
---

- hosts: containers
vars:
um_uid_base: 10000
um_gid_base: 10000
um_group_inventory:
- name: customgroup
rel_gid: 1
present: ['all']
absent:
- "{{ 'all' if operation == 'remove' else '' }}"
sudoer: |
%customgroup ALL=(ALL) ALL
um_user_inventory:
- name: foo
rel_uid: 1
present: ['all']
absent:
- "{{ 'all' if operation == 'remove' else '' }}"
groups:
- customgroup
- name: bar
rel_uid: 2
present:
- all
roles:
- user_management
tasks:
- name: Set user/group inventory
set_fact:
um_uid_base: 10000
um_gid_base: 10000
um_group_inventory:
- name: customgroup
rel_gid: 1
present: ['all']
absent:
- "{{ 'all' if operation == 'remove' else '' }}"
sudoer: |
%customgroup ALL=(ALL) ALL
um_user_inventory:
- name: foo
rel_uid: 1
present: ['all']
absent:
- "{{ 'all' if operation == 'remove' else '' }}"
groups:
- customgroup
- name: bar
rel_uid: 2
present:
- all
absent:
- "{{ 'all' if operation == 'remove' else '' }}"

- name: Run role
import_role:
name: user_management
56 changes: 31 additions & 25 deletions tests/test-idempotency.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
---

- hosts: containers
vars:
um_uid_base: 10000
um_gid_base: 10000
um_group_inventory:
- name: customgroup
rel_gid: 1
present: ['all']
absent:
- "{{ 'all' if operation == 'remove' else '' }}"
sudoer: |
%customgroup ALL=(ALL) ALL
um_user_inventory:
- name: foo
rel_uid: 1
present: ['all']
absent:
- "{{ 'all' if operation == 'remove' else '' }}"
groups:
- customgroup
- name: bar
rel_uid: 2
present:
- all
roles:
- user_management
tasks:
- name: Set user/group inventory
set_fact:
um_uid_base: 10000
um_gid_base: 10000
um_group_inventory:
- name: customgroup
rel_gid: 1
present: ['all']
absent:
- "{{ 'all' if operation == 'remove' else '' }}"
sudoer: |
%customgroup ALL=(ALL) ALL
um_user_inventory:
- name: foo
rel_uid: 1
present: ['all']
absent:
- "{{ 'all' if operation == 'remove' else '' }}"
groups:
- customgroup
- name: bar
rel_uid: 2
present:
- all
absent:
- "{{ 'all' if operation == 'remove' else '' }}"

- name: Run role
import_role:
name: user_management