mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-14 21:42:17 +00:00
Add missing attributes to ipasudorule.
This patch adds the following attributes to ipasudorule:
- order
- sudooption
- runasuser
- runasgroup
It also fixes behavior of sudocmd assigned to the the sudorule, with the
adittion of the attributes:
- allow_sudocmds
- deny_sudocmds
- allow_sudocmdgroups
- deny_sudocmdgroups
README-sudorule and tests have been updated to comply with the changes.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Tests
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
# Ensure sudooption is absent in sudorule
|
||||
- ipasudorule:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: testrule1
|
||||
sudooption: "!root"
|
||||
action: member
|
||||
state: absent
|
||||
13
playbooks/sudorule/ensure-sudorule-has-sudooption.yml
Normal file
13
playbooks/sudorule/ensure-sudorule-has-sudooption.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Tests
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
# Ensure sudooption is present in sudorule
|
||||
- ipasudorule:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: testrule1
|
||||
sudooption: "!root"
|
||||
action: member
|
||||
12
playbooks/sudorule/ensure-sudorule-is-present-with-order.yml
Normal file
12
playbooks/sudorule/ensure-sudorule-is-present-with-order.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Tests
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
# Ensure sudorule is present with the given order.
|
||||
- ipasudorule:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: testrule1
|
||||
order: 2
|
||||
@@ -9,4 +9,6 @@
|
||||
ipaadmin_password: MyPassword123
|
||||
name: testrule1
|
||||
description: A test sudo rule.
|
||||
allow_sudocmd: /bin/ls
|
||||
deny_sudocmd: /bin/vim
|
||||
state: present
|
||||
|
||||
14
playbooks/sudorule/ensure-sudorule-runasuser-is-absent.yml
Normal file
14
playbooks/sudorule/ensure-sudorule-runasuser-is-absent.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Tests
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
# Ensure sudorule is present with the given order.
|
||||
- ipasudorule:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: testrule1
|
||||
runasuser: admin
|
||||
action: member
|
||||
state: absent
|
||||
13
playbooks/sudorule/ensure-sudorule-runasuser-is-present.yml
Normal file
13
playbooks/sudorule/ensure-sudorule-runasuser-is-present.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Tests
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
# Ensure sudorule is present with the given order.
|
||||
- ipasudorule:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: testrule1
|
||||
runasuser: admin
|
||||
action: member
|
||||
@@ -8,8 +8,13 @@
|
||||
- ipasudorule:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: testrule1
|
||||
cmd:
|
||||
allow_sudocmd:
|
||||
- /sbin/ifconfig
|
||||
deny_sudocmd:
|
||||
- /usr/bin/vim
|
||||
allow_sudocmdgroup:
|
||||
- devops
|
||||
deny_sudocmdgroup:
|
||||
- users
|
||||
action: member
|
||||
state: absent
|
||||
|
||||
@@ -8,7 +8,12 @@
|
||||
- ipasudorule:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: testrule1
|
||||
cmd:
|
||||
allow_sudocmd:
|
||||
- /sbin/ifconfig
|
||||
deny_sudocmd:
|
||||
- /usr/bin/vim
|
||||
allow_sudocmdgroup:
|
||||
- devops
|
||||
deny_sudocmdgroup:
|
||||
- users
|
||||
action: member
|
||||
|
||||
Reference in New Issue
Block a user