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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Ansible FreeIPA
Commits
efbc50b2
Unverified
Commit
efbc50b2
authored
Apr 30, 2020
by
Sergio Oliveira
Committed by
GitHub
Apr 30, 2020
Browse files
Options
Downloads
Plain Diff
Merge pull request #250 from t-woerner/issue_249_no_root
ansible_freeipa_module: Set KRB5CCNAME for api_connect (non root)
parents
cf1fe726
871cce52
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/module_utils/ansible_freeipa_module.py
+3
-1
3 additions, 1 deletion
plugins/module_utils/ansible_freeipa_module.py
with
3 additions
and
1 deletion
plugins/module_utils/ansible_freeipa_module.py
+
3
−
1
View file @
efbc50b2
...
@@ -115,6 +115,7 @@ def temp_kinit(principal, password):
...
@@ -115,6 +115,7 @@ def temp_kinit(principal, password):
except
RuntimeError
as
e
:
except
RuntimeError
as
e
:
raise
RuntimeError
(
"
Kerberos authentication failed: {}
"
.
format
(
e
))
raise
RuntimeError
(
"
Kerberos authentication failed: {}
"
.
format
(
e
))
os
.
environ
[
"
KRB5CCNAME
"
]
=
ccache_name
return
ccache_dir
,
ccache_name
return
ccache_dir
,
ccache_name
...
@@ -122,6 +123,7 @@ def temp_kdestroy(ccache_dir, ccache_name):
...
@@ -122,6 +123,7 @@ def temp_kdestroy(ccache_dir, ccache_name):
"""
Destroy temporary ticket and remove temporary ccache.
"""
"""
Destroy temporary ticket and remove temporary ccache.
"""
if
ccache_name
is
not
None
:
if
ccache_name
is
not
None
:
run
([
paths
.
KDESTROY
,
'
-c
'
,
ccache_name
],
raiseonerr
=
False
)
run
([
paths
.
KDESTROY
,
'
-c
'
,
ccache_name
],
raiseonerr
=
False
)
del
os
.
environ
[
'
KRB5CCNAME
'
]
if
ccache_dir
is
not
None
:
if
ccache_dir
is
not
None
:
shutil
.
rmtree
(
ccache_dir
,
ignore_errors
=
True
)
shutil
.
rmtree
(
ccache_dir
,
ignore_errors
=
True
)
...
@@ -152,7 +154,7 @@ def api_connect(context=None):
...
@@ -152,7 +154,7 @@ def api_connect(context=None):
backend
=
api
.
Backend
.
rpcclient
backend
=
api
.
Backend
.
rpcclient
if
not
backend
.
isconnected
():
if
not
backend
.
isconnected
():
backend
.
connect
()
backend
.
connect
(
ccache
=
os
.
environ
.
get
(
'
KRB5CCNAME
'
,
None
)
)
def
api_command
(
module
,
command
,
name
,
args
):
def
api_command
(
module
,
command
,
name
,
args
):
...
...
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