Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ansible FreeIPA
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Ansible FreeIPA
Commits
7982fad3
Unverified
Commit
7982fad3
authored
1 year ago
by
Rafael Guterres Jeffman
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1155 from t-woerner/hbacrule_with_svcgroup_Sudo
hbacrule: Fix use of builtin sudo hbacsvcgroup
parents
ba7bf0f6
48f2ef88
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/modules/ipahbacrule.py
+11
-1
11 additions, 1 deletion
plugins/modules/ipahbacrule.py
tests/hbacrule/test_hbacrule_member_case_insensitive.yml
+14
-0
14 additions, 0 deletions
tests/hbacrule/test_hbacrule_member_case_insensitive.yml
with
25 additions
and
1 deletion
plugins/modules/ipahbacrule.py
+
11
−
1
View file @
7982fad3
...
...
@@ -186,7 +186,17 @@ def find_hbacrule(module, name):
module
.
fail_json
(
msg
=
"
There is more than one hbacrule
'
%s
'"
%
(
name
))
elif
len
(
_result
[
"
result
"
])
==
1
:
return
_result
[
"
result
"
][
0
]
res
=
_result
[
"
result
"
][
0
]
# hbacsvcgroup names are converted to lower case while creation with
# hbacsvcgroup_add.
# The hbacsvcgroup for sudo is builtin with the name "Sudo" though.
# This breaks the lower case comparison. Therefore all
# memberservice_hbacsvcgroup items are converted to lower case if
# "Sudo" is in the list.
_member
=
"
memberservice_hbacsvcgroup
"
if
_member
in
res
and
"
Sudo
"
in
res
[
_member
]:
res
[
_member
]
=
[
item
.
lower
()
for
item
in
res
[
_member
]]
return
res
return
None
...
...
This diff is collapsed.
Click to expand it.
tests/hbacrule/test_hbacrule_member_case_insensitive.yml
+
14
−
0
View file @
7982fad3
...
...
@@ -100,6 +100,7 @@
-
"
{{
hbacsvc_list[1]
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
}}"
-
Sudo
check_mode
:
yes
register
:
result
failed_when
:
not result.changed or result.failed
...
...
@@ -124,6 +125,7 @@
-
"
{{
hbacsvc_list[1]
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
}}"
-
Sudo
register
:
result
failed_when
:
not result.changed or result.failed
...
...
@@ -147,6 +149,7 @@
-
"
{{
hbacsvc_list[1]
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
}}"
-
Sudo
check_mode
:
yes
register
:
result
failed_when
:
result.changed or result.failed
...
...
@@ -171,6 +174,7 @@
-
"
{{
hbacsvc_list[1]
|
lower
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
|
lower
}}"
-
sudo
register
:
result
failed_when
:
result.changed or result.failed
...
...
@@ -194,6 +198,7 @@
-
"
{{
hbacsvc_list[1]
|
upper
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
|
upper
}}"
-
SUDO
register
:
result
failed_when
:
result.changed or result.failed
...
...
@@ -230,6 +235,7 @@
-
"
{{
hbacsvc_list[1]
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
}}"
-
Sudo
check_mode
:
yes
register
:
result
failed_when
:
not result.changed or result.failed
...
...
@@ -254,6 +260,7 @@
-
"
{{
hbacsvc_list[1]
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
}}"
-
Sudo
action
:
member
register
:
result
failed_when
:
not result.changed or result.failed
...
...
@@ -278,6 +285,7 @@
-
"
{{
hbacsvc_list[1]
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
}}"
-
Sudo
check_mode
:
yes
register
:
result
failed_when
:
result.changed or result.failed
...
...
@@ -302,6 +310,7 @@
-
"
{{
hbacsvc_list[1]
|
lower
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
|
lower
}}"
-
sudo
action
:
member
register
:
result
failed_when
:
result.changed or result.failed
...
...
@@ -326,6 +335,7 @@
-
"
{{
hbacsvc_list[1]
|
upper
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
|
upper
}}"
-
SUDO
action
:
member
register
:
result
failed_when
:
result.changed or result.failed
...
...
@@ -352,6 +362,7 @@
-
"
{{
hbacsvc_list[1]
|
upper
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
|
upper
}}"
-
SUDO
action
:
member
state
:
absent
check_mode
:
yes
...
...
@@ -378,6 +389,7 @@
-
"
{{
hbacsvc_list[1]
|
upper
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
|
upper
}}"
-
SUDO
action
:
member
state
:
absent
register
:
result
...
...
@@ -403,6 +415,7 @@
-
"
{{
hbacsvc_list[1]
|
upper
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
|
upper
}}"
-
SUDO
action
:
member
state
:
absent
check_mode
:
yes
...
...
@@ -449,6 +462,7 @@
-
"
{{
hbacsvc_list[1]
|
lower
}}"
hbacsvcgroup
:
-
"
{{
hbacsvcgroup_list[0]
|
lower
}}"
-
sudo
action
:
member
state
:
absent
register
:
result
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment