mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-13 12:15:53 +00:00
ipaclient_setup_nss: Fix documentation sections and agument spec
ansible-test with ansible-2.14 is adding a lot of new tests to ensure that the documentation section and the agument spec is complete. Needed changes: DOCUMENTATION section - `type: str` needs to be set for string parameters - `type: list` needs to be set for list parameters - `elements: str` needs to be given for list of string parameters - `required` tags need to be fixed according to the `argument_spec` - `default` tag needs to match `argument_spec` - `author` needs to be given with the github user also: `Name (@user)` argument_spec - `type='str'` needs to be set for string parameters - `elements='str'` needs to be added to all list of string parameters supports_check_mode is turned off as it is not supported. A call to ansible_ipa_client.check_imports has been added to check for import errors. The `copyright` date is extended with `-2022`.
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
# Based on ipa-client-install code
|
# Based on ipa-client-install code
|
||||||
#
|
#
|
||||||
# Copyright (C) 2017 Red Hat
|
# Copyright (C) 2017-2022 Red Hat
|
||||||
# see file 'COPYING' for use and warranty information
|
# see file 'COPYING' for use and warranty information
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
@@ -39,88 +39,117 @@ description: Create IPA NSS database
|
|||||||
options:
|
options:
|
||||||
servers:
|
servers:
|
||||||
description: Fully qualified name of IPA servers to enroll to
|
description: Fully qualified name of IPA servers to enroll to
|
||||||
required: no
|
type: list
|
||||||
|
elements: str
|
||||||
|
required: yes
|
||||||
domain:
|
domain:
|
||||||
description: Primary DNS domain of the IPA deployment
|
description: Primary DNS domain of the IPA deployment
|
||||||
required: no
|
type: str
|
||||||
|
required: yes
|
||||||
realm:
|
realm:
|
||||||
description: Kerberos realm name of the IPA deployment
|
description: Kerberos realm name of the IPA deployment
|
||||||
required: no
|
type: str
|
||||||
|
required: yes
|
||||||
hostname:
|
hostname:
|
||||||
description: Fully qualified name of this host
|
description: Fully qualified name of this host
|
||||||
required: no
|
type: str
|
||||||
|
required: yes
|
||||||
basedn:
|
basedn:
|
||||||
description: The basedn of the IPA server (of the form dc=example,dc=com)
|
description: The basedn of the IPA server (of the form dc=example,dc=com)
|
||||||
required: no
|
type: str
|
||||||
|
required: yes
|
||||||
principal:
|
principal:
|
||||||
description:
|
description:
|
||||||
User Principal allowed to promote replicas and join IPA realm
|
User Principal allowed to promote replicas and join IPA realm
|
||||||
required: yes
|
type: str
|
||||||
|
required: no
|
||||||
subject_base:
|
subject_base:
|
||||||
description: |
|
description: |
|
||||||
The certificate subject base (default O=<realm-name>).
|
The certificate subject base (default O=<realm-name>).
|
||||||
RDNs are in LDAP order (most specific RDN first).
|
RDNs are in LDAP order (most specific RDN first).
|
||||||
required: no
|
type: str
|
||||||
|
required: yes
|
||||||
ca_enabled:
|
ca_enabled:
|
||||||
description: Whether the Certificate Authority is enabled or not
|
description: Whether the Certificate Authority is enabled or not
|
||||||
required: no
|
type: bool
|
||||||
|
required: yes
|
||||||
mkhomedir:
|
mkhomedir:
|
||||||
description: Create home directories for users on their first login
|
description: Create home directories for users on their first login
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
on_master:
|
on_master:
|
||||||
description: Whether the configuration is done on the master or not
|
description: Whether the configuration is done on the master or not
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
dnsok:
|
dnsok:
|
||||||
description: The installer dnsok setting
|
description: The installer dnsok setting
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
|
default: no
|
||||||
enable_dns_updates:
|
enable_dns_updates:
|
||||||
description: |
|
description: |
|
||||||
Configures the machine to attempt dns updates when the ip address
|
Configures the machine to attempt dns updates when the ip address
|
||||||
changes
|
changes
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
all_ip_addresses:
|
all_ip_addresses:
|
||||||
description: |
|
description: |
|
||||||
All routable IP addresses configured on any interface will be added
|
All routable IP addresses configured on any interface will be added
|
||||||
to DNS
|
to DNS
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
|
default: no
|
||||||
ip_addresses:
|
ip_addresses:
|
||||||
description: List of Master Server IP Addresses
|
description: List of Master Server IP Addresses
|
||||||
required: yes
|
type: list
|
||||||
|
elements: str
|
||||||
|
required: no
|
||||||
request_cert:
|
request_cert:
|
||||||
description: Request certificate for the machine
|
description: Request certificate for the machine
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
|
default: no
|
||||||
preserve_sssd:
|
preserve_sssd:
|
||||||
description: Preserve old SSSD configuration if possible
|
description: Preserve old SSSD configuration if possible
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
no_ssh:
|
no_ssh:
|
||||||
description: Do not configure OpenSSH client
|
description: Do not configure OpenSSH client
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
no_sshd:
|
no_sshd:
|
||||||
description: Do not configure OpenSSH server
|
description: Do not configure OpenSSH server
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
no_sudo:
|
no_sudo:
|
||||||
description: Do not configure SSSD as data source for sudo
|
description: Do not configure SSSD as data source for sudo
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
fixed_primary:
|
fixed_primary:
|
||||||
description: Configure sssd to use fixed server as primary IPA server
|
description: Configure sssd to use fixed server as primary IPA server
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
permit:
|
permit:
|
||||||
description: Disable access rules by default, permit all access
|
description: Disable access rules by default, permit all access
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
no_krb5_offline_passwords:
|
no_krb5_offline_passwords:
|
||||||
description:
|
description:
|
||||||
Configure SSSD not to store user password when the server is offline
|
Configure SSSD not to store user password when the server is offline
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
no_dns_sshfp:
|
no_dns_sshfp:
|
||||||
description: Do not automatically create DNS SSHFP records
|
description: Do not automatically create DNS SSHFP records
|
||||||
required: yes
|
type: bool
|
||||||
|
required: no
|
||||||
|
default: no
|
||||||
nosssd_files:
|
nosssd_files:
|
||||||
description: >
|
description: >
|
||||||
The dist of nss_ldap or nss-pam-ldapd files if sssd is disabled
|
The dist of nss_ldap or nss-pam-ldapd files if sssd is disabled
|
||||||
required: yes
|
required: yes
|
||||||
type: dict
|
type: dict
|
||||||
author:
|
author:
|
||||||
- Thomas Woerner
|
- Thomas Woerner (@t-woerner)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
@@ -144,7 +173,7 @@ import time
|
|||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.ansible_ipa_client import (
|
from ansible.module_utils.ansible_ipa_client import (
|
||||||
setup_logging,
|
setup_logging, check_imports,
|
||||||
options, sysrestore, paths, ansible_module_get_parsed_ip_addresses,
|
options, sysrestore, paths, ansible_module_get_parsed_ip_addresses,
|
||||||
api, errors, create_ipa_nssdb, ipautil, ScriptError, CLIENT_INSTALL_ERROR,
|
api, errors, create_ipa_nssdb, ipautil, ScriptError, CLIENT_INSTALL_ERROR,
|
||||||
get_certs_from_ldap, DN, certstore, x509, logger, certdb,
|
get_certs_from_ldap, DN, certstore, x509, logger, certdb,
|
||||||
@@ -158,13 +187,13 @@ from ansible.module_utils.ansible_ipa_client import (
|
|||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
servers=dict(required=True, type='list'),
|
servers=dict(required=True, type='list', elements='str'),
|
||||||
domain=dict(required=True),
|
domain=dict(required=True, type='str'),
|
||||||
realm=dict(required=True),
|
realm=dict(required=True, type='str'),
|
||||||
hostname=dict(required=True),
|
hostname=dict(required=True, type='str'),
|
||||||
basedn=dict(required=True),
|
basedn=dict(required=True, type='str'),
|
||||||
principal=dict(required=False),
|
principal=dict(required=False, type='str'),
|
||||||
subject_base=dict(required=True),
|
subject_base=dict(required=True, type='str'),
|
||||||
ca_enabled=dict(required=True, type='bool'),
|
ca_enabled=dict(required=True, type='bool'),
|
||||||
mkhomedir=dict(required=False, type='bool'),
|
mkhomedir=dict(required=False, type='bool'),
|
||||||
on_master=dict(required=False, type='bool'),
|
on_master=dict(required=False, type='bool'),
|
||||||
@@ -172,7 +201,8 @@ def main():
|
|||||||
|
|
||||||
enable_dns_updates=dict(required=False, type='bool'),
|
enable_dns_updates=dict(required=False, type='bool'),
|
||||||
all_ip_addresses=dict(required=False, type='bool', default=False),
|
all_ip_addresses=dict(required=False, type='bool', default=False),
|
||||||
ip_addresses=dict(required=False, type='list', default=None),
|
ip_addresses=dict(required=False, type='list', elements='str',
|
||||||
|
default=None),
|
||||||
request_cert=dict(required=False, type='bool', default=False),
|
request_cert=dict(required=False, type='bool', default=False),
|
||||||
preserve_sssd=dict(required=False, type='bool'),
|
preserve_sssd=dict(required=False, type='bool'),
|
||||||
no_ssh=dict(required=False, type='bool'),
|
no_ssh=dict(required=False, type='bool'),
|
||||||
@@ -184,10 +214,11 @@ def main():
|
|||||||
no_dns_sshfp=dict(required=False, type='bool', default=False),
|
no_dns_sshfp=dict(required=False, type='bool', default=False),
|
||||||
nosssd_files=dict(required=True, type='dict'),
|
nosssd_files=dict(required=True, type='dict'),
|
||||||
),
|
),
|
||||||
supports_check_mode=True,
|
supports_check_mode=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
module._ansible_debug = True
|
module._ansible_debug = True
|
||||||
|
check_imports(module)
|
||||||
setup_logging()
|
setup_logging()
|
||||||
|
|
||||||
cli_server = module.params.get('servers')
|
cli_server = module.params.get('servers')
|
||||||
|
|||||||
Reference in New Issue
Block a user