|
|
7d56d3 |
From 3865ce657e3ea1b621aa054c792201aedfde2d11 Mon Sep 17 00:00:00 2001
|
|
|
7d56d3 |
From: Thomas Woerner <twoerner@redhat.com>
|
|
|
7d56d3 |
Date: Fri, 7 Feb 2020 10:11:38 +0100
|
|
|
7d56d3 |
Subject: [PATCH] ipahbacrule: Fix handing of members with action hbacrule
|
|
|
7d56d3 |
|
|
|
7d56d3 |
Changing members (host, hostgroup, hbacsvc, hbacsvcgroup, user, group) with
|
|
|
7d56d3 |
action hbacrule was not working due to the use of the wrong parameter
|
|
|
7d56d3 |
prefix. This has been fixed and the old members are removed correctly now.
|
|
|
7d56d3 |
|
|
|
7d56d3 |
The test script has been reworked completely to verify the fix.
|
|
|
7d56d3 |
|
|
|
7d56d3 |
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1787996
|
|
|
7d56d3 |
---
|
|
|
7d56d3 |
plugins/modules/ipahbacrule.py | 24 +-
|
|
|
7d56d3 |
tests/hbacrule/test_hbacrule.yml | 549 +++++++++++++++++++++++--------
|
|
|
7d56d3 |
2 files changed, 432 insertions(+), 141 deletions(-)
|
|
|
7d56d3 |
|
|
|
7d56d3 |
diff --git a/plugins/modules/ipahbacrule.py b/plugins/modules/ipahbacrule.py
|
|
|
7d56d3 |
index 385876b..82340c2 100644
|
|
|
7d56d3 |
--- a/plugins/modules/ipahbacrule.py
|
|
|
7d56d3 |
+++ b/plugins/modules/ipahbacrule.py
|
|
|
7d56d3 |
@@ -344,41 +344,41 @@ def main():
|
|
|
7d56d3 |
# Generate addition and removal lists
|
|
|
7d56d3 |
host_add = list(
|
|
|
7d56d3 |
set(host or []) -
|
|
|
7d56d3 |
- set(res_find.get("member_host", [])))
|
|
|
7d56d3 |
+ set(res_find.get("memberhost_host", [])))
|
|
|
7d56d3 |
host_del = list(
|
|
|
7d56d3 |
- set(res_find.get("member_host", [])) -
|
|
|
7d56d3 |
+ set(res_find.get("memberhost_host", [])) -
|
|
|
7d56d3 |
set(host or []))
|
|
|
7d56d3 |
hostgroup_add = list(
|
|
|
7d56d3 |
set(hostgroup or []) -
|
|
|
7d56d3 |
- set(res_find.get("member_hostgroup", [])))
|
|
|
7d56d3 |
+ set(res_find.get("memberhost_hostgroup", [])))
|
|
|
7d56d3 |
hostgroup_del = list(
|
|
|
7d56d3 |
- set(res_find.get("member_hostgroup", [])) -
|
|
|
7d56d3 |
+ set(res_find.get("memberhost_hostgroup", [])) -
|
|
|
7d56d3 |
set(hostgroup or []))
|
|
|
7d56d3 |
|
|
|
7d56d3 |
hbacsvc_add = list(
|
|
|
7d56d3 |
set(hbacsvc or []) -
|
|
|
7d56d3 |
- set(res_find.get("member_hbacsvc", [])))
|
|
|
7d56d3 |
+ set(res_find.get("memberservice_hbacsvc", [])))
|
|
|
7d56d3 |
hbacsvc_del = list(
|
|
|
7d56d3 |
- set(res_find.get("member_hbacsvc", [])) -
|
|
|
7d56d3 |
+ set(res_find.get("memberservice_hbacsvc", [])) -
|
|
|
7d56d3 |
set(hbacsvc or []))
|
|
|
7d56d3 |
hbacsvcgroup_add = list(
|
|
|
7d56d3 |
set(hbacsvcgroup or []) -
|
|
|
7d56d3 |
- set(res_find.get("member_hbacsvcgroup", [])))
|
|
|
7d56d3 |
+ set(res_find.get("memberservice_hbacsvcgroup", [])))
|
|
|
7d56d3 |
hbacsvcgroup_del = list(
|
|
|
7d56d3 |
- set(res_find.get("member_hbacsvcgroup", [])) -
|
|
|
7d56d3 |
+ set(res_find.get("memberservice_hbacsvcgroup", [])) -
|
|
|
7d56d3 |
set(hbacsvcgroup or []))
|
|
|
7d56d3 |
|
|
|
7d56d3 |
user_add = list(
|
|
|
7d56d3 |
set(user or []) -
|
|
|
7d56d3 |
- set(res_find.get("member_user", [])))
|
|
|
7d56d3 |
+ set(res_find.get("memberuser_user", [])))
|
|
|
7d56d3 |
user_del = list(
|
|
|
7d56d3 |
- set(res_find.get("member_user", [])) -
|
|
|
7d56d3 |
+ set(res_find.get("memberuser_user", [])) -
|
|
|
7d56d3 |
set(user or []))
|
|
|
7d56d3 |
group_add = list(
|
|
|
7d56d3 |
set(group or []) -
|
|
|
7d56d3 |
- set(res_find.get("member_group", [])))
|
|
|
7d56d3 |
+ set(res_find.get("memberuser_group", [])))
|
|
|
7d56d3 |
group_del = list(
|
|
|
7d56d3 |
- set(res_find.get("member_group", [])) -
|
|
|
7d56d3 |
+ set(res_find.get("memberuser_group", [])) -
|
|
|
7d56d3 |
set(group or []))
|
|
|
7d56d3 |
|
|
|
7d56d3 |
# Add hosts and hostgroups
|
|
|
7d56d3 |
diff --git a/tests/hbacrule/test_hbacrule.yml b/tests/hbacrule/test_hbacrule.yml
|
|
|
7d56d3 |
index a5615cc..38858d3 100644
|
|
|
7d56d3 |
--- a/tests/hbacrule/test_hbacrule.yml
|
|
|
7d56d3 |
+++ b/tests/hbacrule/test_hbacrule.yml
|
|
|
7d56d3 |
@@ -1,338 +1,629 @@
|
|
|
7d56d3 |
---
|
|
|
7d56d3 |
-- name: Tests
|
|
|
7d56d3 |
+- name: Playbook to handle hbacrules
|
|
|
7d56d3 |
hosts: ipaserver
|
|
|
7d56d3 |
become: true
|
|
|
7d56d3 |
- gather_facts: false
|
|
|
7d56d3 |
|
|
|
7d56d3 |
tasks:
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule allhosts is absent
|
|
|
7d56d3 |
- ipahbacrule:
|
|
|
7d56d3 |
+ - name: Get Domain from server name
|
|
|
7d56d3 |
+ set_fact:
|
|
|
7d56d3 |
+ ipaserver_domain: "{{ groups.ipaserver[0].split('.')[1:] | join ('.') }}"
|
|
|
7d56d3 |
+ when: ipaserver_domain is not defined
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ # CLEANUP TEST ITEMS
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test hosts are absent
|
|
|
7d56d3 |
+ ipahost:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name:
|
|
|
7d56d3 |
+ - "{{ 'testhost01.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost02.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost03.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost04.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test hostgroups are absent
|
|
|
7d56d3 |
+ ipahostgroup:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: allhosts,sshd-pinky,loginRule
|
|
|
7d56d3 |
+ name: testhostgroup01,testhostgroup02,testhostgroup03,testhostgroup04
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: User pinky absent
|
|
|
7d56d3 |
+ - name: Ensure test users are absent
|
|
|
7d56d3 |
ipauser:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: pinky
|
|
|
7d56d3 |
+ name: testuser01,testuser02,testuser03,testuser04
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: User group login absent
|
|
|
7d56d3 |
+ - name: Ensure test user groups are absent
|
|
|
7d56d3 |
ipagroup:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: login
|
|
|
7d56d3 |
+ name: testgroup01,testgroup02,testgroup03,testgroup04
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test HBAC Services are absent
|
|
|
7d56d3 |
+ ipahbacsvc:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvc01,testhbacsvc02,testhbacsvc03,testhbacsvc04
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test HBAC Service Groups are absent
|
|
|
7d56d3 |
+ ipahbacsvcgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvcgroup01,testhbacsvcgroup02,testhbacsvcgroup03,testhbacsvcgroup04
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: User pinky present
|
|
|
7d56d3 |
+ # CREATE TEST ITEMS
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure hosts "{{ 'host[1..4].' + ipaserver_domain }}" are present
|
|
|
7d56d3 |
+ ipahost:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ hosts:
|
|
|
7d56d3 |
+ - name: "{{ 'testhost01.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ force: yes
|
|
|
7d56d3 |
+ - name: "{{ 'testhost02.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ force: yes
|
|
|
7d56d3 |
+ - name: "{{ 'testhost03.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ force: yes
|
|
|
7d56d3 |
+ - name: "{{ 'testhost04.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ force: yes
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure host-group testhostgroup01 is present
|
|
|
7d56d3 |
+ ipahostgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhostgroup01
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure host-group testhostgroup02 is present
|
|
|
7d56d3 |
+ ipahostgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhostgroup02
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure host-group testhostgroup03 is present
|
|
|
7d56d3 |
+ ipahostgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhostgroup03
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure host-group testhostgroup04 is present
|
|
|
7d56d3 |
+ ipahostgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhostgroup04
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure testusers are present
|
|
|
7d56d3 |
ipauser:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: pinky
|
|
|
7d56d3 |
- uid: 10001
|
|
|
7d56d3 |
- gid: 100
|
|
|
7d56d3 |
- phone: "+555123457"
|
|
|
7d56d3 |
- email: pinky@acme.com
|
|
|
7d56d3 |
- principalexpiration: "20220119235959"
|
|
|
7d56d3 |
- #passwordexpiration: "2022-01-19 23:59:59"
|
|
|
7d56d3 |
- first: pinky
|
|
|
7d56d3 |
- last: Acme
|
|
|
7d56d3 |
+ users:
|
|
|
7d56d3 |
+ - name: testuser01
|
|
|
7d56d3 |
+ first: test
|
|
|
7d56d3 |
+ last: user01
|
|
|
7d56d3 |
+ - name: testuser02
|
|
|
7d56d3 |
+ first: test
|
|
|
7d56d3 |
+ last: user02
|
|
|
7d56d3 |
+ - name: testuser03
|
|
|
7d56d3 |
+ first: test
|
|
|
7d56d3 |
+ last: user03
|
|
|
7d56d3 |
+ - name: testuser04
|
|
|
7d56d3 |
+ first: test
|
|
|
7d56d3 |
+ last: user04
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: User group login present
|
|
|
7d56d3 |
+ - name: Ensure user group testgroup01 is present
|
|
|
7d56d3 |
ipagroup:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: login
|
|
|
7d56d3 |
+ name: testgroup01
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule allhosts is present
|
|
|
7d56d3 |
- ipahbacrule:
|
|
|
7d56d3 |
+ - name: Ensure user group testgroup02 is present
|
|
|
7d56d3 |
+ ipagroup:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: allhosts
|
|
|
7d56d3 |
- usercategory: all
|
|
|
7d56d3 |
+ name: testgroup02
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule allhosts is present again
|
|
|
7d56d3 |
- ipahbacrule:
|
|
|
7d56d3 |
+ - name: Ensure user group testgroup03 is present
|
|
|
7d56d3 |
+ ipagroup:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: allhosts
|
|
|
7d56d3 |
- usercategory: all
|
|
|
7d56d3 |
+ name: testgroup03
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
- failed_when: result.changed
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure host "{{ groups.ipaserver[0] }}" is present in HBAC Rule allhosts
|
|
|
7d56d3 |
+ - name: Ensure user group testgroup04 is present
|
|
|
7d56d3 |
+ ipagroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testgroup04
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC Service testhbacsvc01 is present
|
|
|
7d56d3 |
+ ipahbacsvc:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvc01
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC Service testhbacsvc02 is present
|
|
|
7d56d3 |
+ ipahbacsvc:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvc02
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC Service testhbacsvc03 is present
|
|
|
7d56d3 |
+ ipahbacsvc:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvc03
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC Service testhbacsvc04 is present
|
|
|
7d56d3 |
+ ipahbacsvc:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvc04
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC Service Group testhbacsvcgroup01 is present
|
|
|
7d56d3 |
+ ipahbacsvcgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvcgroup01
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC Service Group testhbacsvcgroup02 is present
|
|
|
7d56d3 |
+ ipahbacsvcgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvcgroup02
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC Service Group testhbacsvcgroup03 is present
|
|
|
7d56d3 |
+ ipahbacsvcgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvcgroup03
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC Service Group testhbacsvcgroup04 is present
|
|
|
7d56d3 |
+ ipahbacsvcgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvcgroup04
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 is absent
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: allhosts
|
|
|
7d56d3 |
- host: "{{ groups.ipaserver[0] }}"
|
|
|
7d56d3 |
- action: member
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ # ENSURE HBACRULE
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC rule hbacrule01 is present
|
|
|
7d56d3 |
+ ipahbacrule:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure host "{{ groups.ipaserver[0] }}" is present in HBAC Rule allhosts again
|
|
|
7d56d3 |
+ - name: Ensure HBAC rule hbacrule01 is present again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: allhosts
|
|
|
7d56d3 |
- host: "{{ groups.ipaserver[0] }}"
|
|
|
7d56d3 |
- action: member
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule sshd-pinky is present
|
|
|
7d56d3 |
+ # CHANGE HBACRULE WITH ALL MEMBERS
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC rule hbacrule01 is present with hosts, hostgroups, users, groups, hbassvcs and hbacsvcgroups
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- hostcategory: all
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost01.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost02.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ hostgroup: testhostgroup01,testhostgroup02
|
|
|
7d56d3 |
+ user: testuser01,testuser02
|
|
|
7d56d3 |
+ group: testgroup01,testgroup02
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc01,testhbacsvc02
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup01,testhbacsvcgroup02
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule sshd-pinky is present again
|
|
|
7d56d3 |
+ - name: Ensure HBAC rule hbacrule01 is present with hosts, hostgroups, users, groups, hbassvcs and hbacsvcgroups again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- hostcategory: all
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost01.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost02.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ hostgroup: testhostgroup01,testhostgroup02
|
|
|
7d56d3 |
+ user: testuser01,testuser02
|
|
|
7d56d3 |
+ group: testgroup01,testgroup02
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc01,testhbacsvc02
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup01,testhbacsvcgroup02
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure user pinky is present in HBAC Rule sshd-pinky
|
|
|
7d56d3 |
+ # REMOVE MEMBERS ONE BY ONE
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 host members are absent
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- user: pinky
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost01.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost02.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure user pinky is present in HBAC Rule sshd-pinky again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 host members are absent again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- user: pinky
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost01.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost02.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC service sshd is present in HBAC Rule sshd-pinky
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hostgroup members are absent
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- hbacsvc: sshd
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hostgroup: testhostgroup01,testhostgroup02
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC service sshd is present in HBAC Rule sshd-pinky again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hostgroup members are absent again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- hbacsvc: sshd
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hostgroup: testhostgroup01,testhostgroup02
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule loginRule is present with HBAC service sshd
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 user members are absent
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: loginRule
|
|
|
7d56d3 |
- group: login
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ user: testuser01,testuser02
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule loginRule is present with HBAC service sshd again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 user members are absent again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: loginRule
|
|
|
7d56d3 |
- group: login
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ user: testuser01,testuser02
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure user pinky is present in HBAC Rule loginRule
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 user group members are absent
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: loginRule
|
|
|
7d56d3 |
- user: pinky
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ group: testgroup01,testgroup02
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure user pinky is present in HBAC Rule loginRule again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 user group members are absent again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: loginRule
|
|
|
7d56d3 |
- user: pinky
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ group: testgroup01,testgroup02
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure user pinky is absent in HBAC Rule loginRule
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hbacsvc members are absent
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: loginRule
|
|
|
7d56d3 |
- user: pinky
|
|
|
7d56d3 |
- action: member
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc01,testhbacsvc02
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure user pinky is absent in HBAC Rule loginRule again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hbacsvc members are absent again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: loginRule
|
|
|
7d56d3 |
- user: pinky
|
|
|
7d56d3 |
- action: member
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc01,testhbacsvc02
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule loginRule is absent
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hbacsvcgroup members are absent
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: loginRule
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup01,testhbacsvcgroup02
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule loginRule is absent again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hbacsvcgroup members are absent again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: loginRule
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup01,testhbacsvcgroup02
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC service sshd is absent in HBAC Rule sshd-pinky
|
|
|
7d56d3 |
+ # ADD MEMBERS BACK
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 host members are present
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- hbacsvc: sshd
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost01.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost02.' + ipaserver_domain }}"
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
- state: absent
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC service sshd is absent in HBAC Rule sshd-pinky again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 host members are present again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- hbacsvc: sshd
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost01.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost02.' + ipaserver_domain }}"
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
- state: absent
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure user pinky is absent in HBAC Rule sshd-pinky
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hostgroup members are present
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- user: pinky
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hostgroup: testhostgroup01,testhostgroup02
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
- state: absent
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure user pinky is absent in HBAC Rule sshd-pinky again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hostgroup members are present again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- user: pinky
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hostgroup: testhostgroup01,testhostgroup02
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
- state: absent
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule sshd-pinky is disabled
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 user members are present
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- state: disabled
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ user: testuser01,testuser02
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule sshd-pinky is disabled again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 user members are present again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- state: disabled
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ user: testuser01,testuser02
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule sshd-pinky is enabled
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 user group members are present
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- state: enabled
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ group: testgroup01,testgroup02
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule sshd-pinky is enabled again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 user group members are present again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- state: enabled
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ group: testgroup01,testgroup02
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule sshd-pinky is absent
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hbacsvc members are present
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- state: absent
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc01,testhbacsvc02
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule sshd-pinky is absent again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hbacsvc members are present again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: sshd-pinky
|
|
|
7d56d3 |
- state: absent
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc01,testhbacsvc02
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure host "{{ groups.ipaserver[0] }}" is absent in HBAC Rule allhosts
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hbacsvcgroup members are present
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: allhosts
|
|
|
7d56d3 |
- host: "{{ groups.ipaserver[0] }}"
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup01,testhbacsvcgroup02
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
- state: absent
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure host "{{ groups.ipaserver[0] }}" is absent in HBAC Rule allhosts again
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 hbacsvcgroup members are present again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: allhosts
|
|
|
7d56d3 |
- host: "{{ groups.ipaserver[0] }}"
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup01,testhbacsvcgroup02
|
|
|
7d56d3 |
action: member
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ # CHANGE TO DIFFERENT MEMBERS
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC rule hbacrule01 is present with different hosts, hostgroups, users, groups, hbassvcs and hbacsvcgroups
|
|
|
7d56d3 |
+ ipahbacrule:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost03.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost04.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ hostgroup: testhostgroup03,testhostgroup04
|
|
|
7d56d3 |
+ user: testuser03,testuser04
|
|
|
7d56d3 |
+ group: testgroup03,testgroup04
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc03,testhbacsvc04
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup03,testhbacsvcgroup04
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: not result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC rule hbacrule01 is present with different hosts, hostgroups, users, groups, hbassvcs and hbacsvcgroups again
|
|
|
7d56d3 |
+ ipahbacrule:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost03.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost04.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ hostgroup: testhostgroup03,testhostgroup04
|
|
|
7d56d3 |
+ user: testuser03,testuser04
|
|
|
7d56d3 |
+ group: testgroup03,testgroup04
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc03,testhbacsvc04
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup03,testhbacsvcgroup04
|
|
|
7d56d3 |
+ register: result
|
|
|
7d56d3 |
+ failed_when: result.changed
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ # ENSURE OLD TEST MEMBERS ARE ABSENT
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC rule hbacrule01 members (same) are present
|
|
|
7d56d3 |
+ ipahbacrule:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost01.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost02.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ hostgroup: testhostgroup01,testhostgroup02
|
|
|
7d56d3 |
+ user: testuser01,testuser02
|
|
|
7d56d3 |
+ group: testgroup01,testgroup02
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc01,testhbacsvc02
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup01,testhbacsvcgroup02
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule allhosts is absent
|
|
|
7d56d3 |
+ # ENSURE NEW TEST MEMBERS ARE ABSENT
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure HBAC rule hbacrule01 members are absent
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: allhosts
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost03.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost04.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ hostgroup: testhostgroup03,testhostgroup04
|
|
|
7d56d3 |
+ user: testuser03,testuser04
|
|
|
7d56d3 |
+ group: testgroup03,testgroup04
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc03,testhbacsvc04
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup03,testhbacsvcgroup04
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: not result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: Ensure HBAC Rule allhosts is absent again
|
|
|
7d56d3 |
+ - name: Ensure HBAC rule hbacrule01 members are absent again
|
|
|
7d56d3 |
ipahbacrule:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: allhosts
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ host:
|
|
|
7d56d3 |
+ - "{{ 'testhost03.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost04.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ hostgroup: testhostgroup03,testhostgroup04
|
|
|
7d56d3 |
+ user: testuser03,testuser04
|
|
|
7d56d3 |
+ group: testgroup03,testgroup04
|
|
|
7d56d3 |
+ hbacsvc: testhbacsvc03,testhbacsvc04
|
|
|
7d56d3 |
+ hbacsvcgroup: testhbacsvcgroup03,testhbacsvcgroup04
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
+ action: member
|
|
|
7d56d3 |
register: result
|
|
|
7d56d3 |
failed_when: result.changed
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: User pinky absent
|
|
|
7d56d3 |
+ # CLEANUP TEST ITEMS
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test HBAC rule hbacrule01 is absent
|
|
|
7d56d3 |
+ ipahbacrule:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: hbacrule01
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test hosts are absent
|
|
|
7d56d3 |
+ ipahostgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name:
|
|
|
7d56d3 |
+ - "{{ 'testhost01.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost02.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost03.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ - "{{ 'testhost04.' + ipaserver_domain }}"
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test hostgroups are absent
|
|
|
7d56d3 |
+ ipahostgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhostgroup01,testhostgroup02,testhostgroup03,testhostgroup04
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test users are absent
|
|
|
7d56d3 |
ipauser:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: pinky
|
|
|
7d56d3 |
+ name: testuser01,testuser02,testuser03,testuser04
|
|
|
7d56d3 |
state: absent
|
|
|
7d56d3 |
|
|
|
7d56d3 |
- - name: User group login absent
|
|
|
7d56d3 |
+ - name: Ensure test user groups are absent
|
|
|
7d56d3 |
ipagroup:
|
|
|
7d56d3 |
ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
- name: login
|
|
|
7d56d3 |
+ name: testgroup01,testgroup02,testgroup03,testgroup04
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test HBAC Services are absent
|
|
|
7d56d3 |
+ ipahbacsvc:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvc01,testhbacsvc02,testhbacsvc03,testhbacsvc04
|
|
|
7d56d3 |
+ state: absent
|
|
|
7d56d3 |
+
|
|
|
7d56d3 |
+ - name: Ensure test HBAC Service Groups are absent
|
|
|
7d56d3 |
+ ipahbacsvcgroup:
|
|
|
7d56d3 |
+ ipaadmin_password: MyPassword123
|
|
|
7d56d3 |
+ name: testhbacsvcgroup01,testhbacsvcgroup02,testhbacsvcgroup03,testhbacsvcgroup04
|
|
|
7d56d3 |
state: absent
|