Skip to content
Snippets Groups Projects
Unverified Commit fbe28804 authored by Thomas Woerner's avatar Thomas Woerner Committed by GitHub
Browse files

Merge pull request #156 from t-woerner/env_krb5ccname

ansible_freeipa_module: Better support for KRB5CCNAME environment variable
parents 8da4b73b e77f4daa
Branches
Tags
No related merge requests found
...@@ -50,10 +50,12 @@ def valid_creds(module, principal): ...@@ -50,10 +50,12 @@ def valid_creds(module, principal):
Get valid credintials matching the princial, try GSSAPI first Get valid credintials matching the princial, try GSSAPI first
""" """
if "KRB5CCNAME" in os.environ: if "KRB5CCNAME" in os.environ:
module.debug('KRB5CCNAME set to %s' % ccache = os.environ["KRB5CCNAME"]
os.environ.get('KRB5CCNAME', None)) module.debug('KRB5CCNAME set to %s' % ccache)
try: try:
cred = gssapi.creds.Credentials() cred = gssapi.Credentials(usage='initiate',
store={'ccache': ccache})
except gssapi.raw.misc.GSSError as e: except gssapi.raw.misc.GSSError as e:
module.fail_json(msg='Failed to find default ccache: %s' % e) module.fail_json(msg='Failed to find default ccache: %s' % e)
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment