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

Merge pull request #6 from flo-renaud/fixipahost_44

ipahost module: fix the module for IPA 4.4 server
parents 5aa9f0ec 5b57c8b7
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,9 @@ options: ...@@ -53,7 +53,9 @@ options:
required: true required: true
random: random:
description: generate a random password to be used in bulk enrollment description: generate a random password to be used in bulk enrollment
required: false
type: bool type: bool
default: no
state: state:
description: the host state description: the host state
required: false required: false
...@@ -70,6 +72,8 @@ options: ...@@ -70,6 +72,8 @@ options:
description: the IP address for the host description: the IP address for the host
required: false required: false
requirements:
- gssapi on the Ansible controller
author: author:
- "Florence Blanc-Renaud" - "Florence Blanc-Renaud"
''' '''
...@@ -107,16 +111,54 @@ EXAMPLES = ''' ...@@ -107,16 +111,54 @@ EXAMPLES = '''
''' '''
RETURN = ''' RETURN = '''
tbd host:
description: the host structure as returned from IPA API
returned: always
type: complex
contains:
dn:
description: the DN of the host entry
type: string
returned: always
fqdn:
description: the fully qualified host name
type: string
returned: always
has_keytab:
description: whether the host entry contains a keytab
type: bool
returned: always
has_password:
description: whether the host entry contains a password
type: bool
returned: always
managedby_host:
description: the list of hosts managing the host
type: list
returned: always
randompassword:
description: the OneTimePassword generated for this host
type: string
returned: changed
certificates:
description: the list of host certificates
type: list
returned: when present
sshpubkey:
description: the SSH public key for the host
type: string
returned: when present
ipaddress:
description: the IP address for the host
type: string
returned: when present
''' '''
import os import os
import tempfile
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from ipalib import api, errors, x509 from ipalib import api, errors
from ipalib.install.kinit import kinit_keytab, kinit_password
from ipaplatform.paths import paths from ipaplatform.paths import paths
from ipapython.ipautil import run from ipapython.ipautil import run
...@@ -261,9 +303,7 @@ def main(): ...@@ -261,9 +303,7 @@ def main():
""" """
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
#keytab = dict(required=False, type='path'),
principal = dict(default='admin'), principal = dict(default='admin'),
#password = dict(required=False, no_log=True),
ccache = dict(required=False, type='path'), ccache = dict(required=False, type='path'),
fqdn = dict(required=True), fqdn = dict(required=True),
certificates = dict(required=False, type='list'), certificates = dict(required=False, type='list'),
...@@ -272,14 +312,10 @@ def main(): ...@@ -272,14 +312,10 @@ def main():
random = dict(default=False, type='bool'), random = dict(default=False, type='bool'),
state = dict(default='present', choices=[ 'present', 'absent' ]), state = dict(default='present', choices=[ 'present', 'absent' ]),
), ),
#mutually_exclusive=[['password','keytab']],
#required_one_of=[['[password','keytab']],
supports_check_mode=True, supports_check_mode=True,
) )
principal = module.params.get('principal', 'admin') principal = module.params.get('principal', 'admin')
password = module.params.get('password')
keytab = module.params.get('keytab')
ccache = module.params.get('ccache') ccache = module.params.get('ccache')
fqdn = unicode(module.params.get('fqdn')) fqdn = unicode(module.params.get('fqdn'))
state = module.params.get('state') state = module.params.get('state')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment