mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-25 00:44:42 +00:00
Merge pull request #1429 from t-woerner/ansible_test_sanity_fixes
Ansible test sanity fixes
This commit is contained in:
@@ -207,6 +207,10 @@ options:
|
|||||||
required: false
|
required: false
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
|
choices: ["ALL", "BASE", "PKEY_ONLY", "dn", "objectclass", "ipauniqueid",
|
||||||
|
"ipantsecurityidentifier", "name", "description", "gid", "user",
|
||||||
|
"group", "service", "externalmember", "idoverrideuser",
|
||||||
|
"membermanager_user", "membermanager_group"]
|
||||||
action:
|
action:
|
||||||
description: Work on group or member level
|
description: Work on group or member level
|
||||||
type: str
|
type: str
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ options:
|
|||||||
description: Require user verification for passkey authentication
|
description: Require user verification for passkey authentication
|
||||||
required: false
|
required: false
|
||||||
type: bool
|
type: bool
|
||||||
default: true
|
|
||||||
aliases: ["iparequireuserverification"]
|
aliases: ["iparequireuserverification"]
|
||||||
author:
|
author:
|
||||||
- Rafael Guterres Jeffman (@rjeffman)
|
- Rafael Guterres Jeffman (@rjeffman)
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ options:
|
|||||||
suboptions:
|
suboptions:
|
||||||
name:
|
name:
|
||||||
description: The sudorule name
|
description: The sudorule name
|
||||||
type: list
|
type: str
|
||||||
elements: str
|
|
||||||
required: true
|
required: true
|
||||||
aliases: ["cn"]
|
aliases: ["cn"]
|
||||||
description:
|
description:
|
||||||
@@ -462,7 +461,7 @@ def init_ansible_module():
|
|||||||
required=False),
|
required=False),
|
||||||
sudorules=dict(
|
sudorules=dict(
|
||||||
type="list",
|
type="list",
|
||||||
defalut=None,
|
default=None,
|
||||||
options=dict(
|
options=dict(
|
||||||
# name of the sudorule
|
# name of the sudorule
|
||||||
name=dict(type="str", required=True, aliases=["cn"]),
|
name=dict(type="str", required=True, aliases=["cn"]),
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ def main():
|
|||||||
description=dict(required=False, type='str', default=None),
|
description=dict(required=False, type='str', default=None),
|
||||||
random=dict(required=False, type='bool', default=None),
|
random=dict(required=False, type='bool', default=None),
|
||||||
privileged=dict(required=False, type='bool', default=None),
|
privileged=dict(required=False, type='bool', default=None),
|
||||||
password=dict(required=False, type='str',
|
password=dict(required=False, type='str', no_log=True,
|
||||||
aliases=["userpassword"], default=None),
|
aliases=["userpassword"], default=None),
|
||||||
|
|
||||||
# mod
|
# mod
|
||||||
|
|||||||
@@ -613,6 +613,20 @@ options:
|
|||||||
required: false
|
required: false
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
|
choices: ["ALL", "BASE", "PKEY_ONLY", "dn", "objectclass", "ipauniqueid",
|
||||||
|
"ipantsecurityidentifier", "name", "first", "last", "fullname",
|
||||||
|
"displayname", "initials", "homedir", "shell", "email",
|
||||||
|
"principalexpiration", "passwordexpiration", "uid", "gid", "city",
|
||||||
|
"userstate", "postalcode", "phone", "mobile", "pager", "fax",
|
||||||
|
"orgunit", "title", "carlicense", "sshpubkey", "userauthtype",
|
||||||
|
"userclass", "radius", "radiususer", "departmentnumber",
|
||||||
|
"employeenumber", "employeetype", "preferredlanguage", "manager",
|
||||||
|
"principal", "certificate", "certmapdata", "gecos", "password",
|
||||||
|
"street", "idp", "idp_user_id", "smb_logon_script", "smb_profile_path",
|
||||||
|
"smb_home_dir", "smb_home_drive", "krblastpwdchange",
|
||||||
|
"krblastadminunlock", "krbextradata", "krbticketflags",
|
||||||
|
"krbloginfailedcount", "krblastsuccessfulauth", "has_password",
|
||||||
|
"has_keytab", "preserved", "memberof_group", "disabled"]
|
||||||
action:
|
action:
|
||||||
description: Work on user or member level
|
description: Work on user or member level
|
||||||
type: str
|
type: str
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
|
||||||
|
# pylint: disable=invalid-name
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
# pylint: enable=invalid-name
|
||||||
|
|
||||||
__all__ = ["gssapi", "version", "ipadiscovery", "api", "errors", "x509",
|
__all__ = ["gssapi", "version", "ipadiscovery", "api", "errors", "x509",
|
||||||
"constants", "sysrestore", "certmonger", "certstore",
|
"constants", "sysrestore", "certmonger", "certstore",
|
||||||
@@ -49,7 +51,8 @@ __all__ = ["gssapi", "version", "ipadiscovery", "api", "errors", "x509",
|
|||||||
"sssd_enable_ifp", "configure_selinux_for_client",
|
"sssd_enable_ifp", "configure_selinux_for_client",
|
||||||
"getargspec", "paths", "options",
|
"getargspec", "paths", "options",
|
||||||
"IPA_PYTHON_VERSION", "NUM_VERSION", "certdb", "get_ca_cert",
|
"IPA_PYTHON_VERSION", "NUM_VERSION", "certdb", "get_ca_cert",
|
||||||
"ipalib", "logger", "ipautil", "installer"]
|
"ipalib", "logger", "ipautil", "installer",
|
||||||
|
"CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION"]
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -76,6 +79,7 @@ except ImportError:
|
|||||||
return ArgSpec(args, varargs, varkw, defaults)
|
return ArgSpec(args, varargs, varkw, defaults)
|
||||||
|
|
||||||
|
|
||||||
|
ANSIBLE_IPA_CLIENT_MODULE_IMPORT_ERROR = None # pylint: disable=invalid-name
|
||||||
try:
|
try:
|
||||||
from ipapython.version import NUM_VERSION, VERSION
|
from ipapython.version import NUM_VERSION, VERSION
|
||||||
|
|
||||||
@@ -311,13 +315,17 @@ try:
|
|||||||
configure_selinux_for_client = None
|
configure_selinux_for_client = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# pylint: disable=invalid-name
|
||||||
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = False
|
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = False
|
||||||
|
# pylint: enable=invalid-name
|
||||||
from ipaclient.install.client import ClientInstallInterface
|
from ipaclient.install.client import ClientInstallInterface
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if hasattr(ClientInstallInterface, "no_dnssec_validation"):
|
if hasattr(ClientInstallInterface, "no_dnssec_validation"):
|
||||||
|
# pylint: disable=invalid-name
|
||||||
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = True
|
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = True
|
||||||
|
# pylint: enable=invalid-name
|
||||||
|
|
||||||
logger = logging.getLogger("ipa-client-install")
|
logger = logging.getLogger("ipa-client-install")
|
||||||
root_logger = logger
|
root_logger = logger
|
||||||
@@ -327,14 +335,13 @@ try:
|
|||||||
raise RuntimeError("freeipa version '%s' is too old" % VERSION)
|
raise RuntimeError("freeipa version '%s' is too old" % VERSION)
|
||||||
|
|
||||||
except ImportError as _err:
|
except ImportError as _err:
|
||||||
|
# pylint: disable=invalid-name
|
||||||
ANSIBLE_IPA_CLIENT_MODULE_IMPORT_ERROR = str(_err)
|
ANSIBLE_IPA_CLIENT_MODULE_IMPORT_ERROR = str(_err)
|
||||||
|
# pylint: enable=invalid-name
|
||||||
|
|
||||||
for attr in __all__:
|
for attr in __all__:
|
||||||
setattr(sys.modules[__name__], attr, None)
|
setattr(sys.modules[__name__], attr, None)
|
||||||
|
|
||||||
else:
|
|
||||||
ANSIBLE_IPA_CLIENT_MODULE_IMPORT_ERROR = None
|
|
||||||
|
|
||||||
|
|
||||||
def setup_logging():
|
def setup_logging():
|
||||||
standard_logging_setup(
|
standard_logging_setup(
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ def main():
|
|||||||
dns_over_tls=dict(required=False, type='bool',
|
dns_over_tls=dict(required=False, type='bool',
|
||||||
default=False),
|
default=False),
|
||||||
dns_over_tls_cert=dict(required=False, type='str'),
|
dns_over_tls_cert=dict(required=False, type='str'),
|
||||||
dns_over_tls_key=dict(required=False, type='str'),
|
dns_over_tls_key=dict(required=False, type='str', no_log=True),
|
||||||
dns_policy=dict(required=False, type='str',
|
dns_policy=dict(required=False, type='str',
|
||||||
choices=['relaxed', 'enforced'],
|
choices=['relaxed', 'enforced'],
|
||||||
default='relaxed'),
|
default='relaxed'),
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ def main():
|
|||||||
default=[]),
|
default=[]),
|
||||||
dns_over_tls=dict(required=False, type='bool', default=False),
|
dns_over_tls=dict(required=False, type='bool', default=False),
|
||||||
dns_over_tls_cert=dict(required=False, type='str'),
|
dns_over_tls_cert=dict(required=False, type='str'),
|
||||||
dns_over_tls_key=dict(required=False, type='str'),
|
dns_over_tls_key=dict(required=False, type='str', no_log=True),
|
||||||
dns_policy=dict(required=False, type='str',
|
dns_policy=dict(required=False, type='str',
|
||||||
choices=['relaxed', 'enforced'],
|
choices=['relaxed', 'enforced'],
|
||||||
default='relaxed'),
|
default='relaxed'),
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ def main():
|
|||||||
default=[]),
|
default=[]),
|
||||||
dns_over_tls=dict(required=False, type='bool', default=False),
|
dns_over_tls=dict(required=False, type='bool', default=False),
|
||||||
dns_over_tls_cert=dict(required=False, type='str'),
|
dns_over_tls_cert=dict(required=False, type='str'),
|
||||||
dns_over_tls_key=dict(required=False, type='str'),
|
dns_over_tls_key=dict(required=False, type='str', no_log=True),
|
||||||
dns_policy=dict(required=False, type='str',
|
dns_policy=dict(required=False, type='str',
|
||||||
choices=['relaxed', 'enforced'],
|
choices=['relaxed', 'enforced'],
|
||||||
default='relaxed'),
|
default='relaxed'),
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
|
||||||
|
# pylint: disable=invalid-name
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
# pylint: enable=invalid-name
|
||||||
|
|
||||||
__all__ = ["contextlib", "dnsexception", "dnsresolver", "dnsreversename",
|
__all__ = ["contextlib", "dnsexception", "dnsresolver", "dnsreversename",
|
||||||
"parse_version", "IPAChangeConf",
|
"parse_version", "IPAChangeConf",
|
||||||
@@ -49,7 +51,8 @@ __all__ = ["contextlib", "dnsexception", "dnsresolver", "dnsreversename",
|
|||||||
"dnsname", "kernel_keyring", "krbinstance", "getargspec",
|
"dnsname", "kernel_keyring", "krbinstance", "getargspec",
|
||||||
"adtrustinstance", "paths", "api", "dsinstance", "ipaldap", "Env",
|
"adtrustinstance", "paths", "api", "dsinstance", "ipaldap", "Env",
|
||||||
"ipautil", "installutils", "IPA_PYTHON_VERSION", "NUM_VERSION",
|
"ipautil", "installutils", "IPA_PYTHON_VERSION", "NUM_VERSION",
|
||||||
"ReplicaConfig", "create_api", "clean_up_hsm_nicknames"]
|
"ReplicaConfig", "create_api", "clean_up_hsm_nicknames",
|
||||||
|
"CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION"]
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
@@ -77,6 +80,7 @@ except ImportError:
|
|||||||
return ArgSpec(args, varargs, varkw, defaults)
|
return ArgSpec(args, varargs, varkw, defaults)
|
||||||
|
|
||||||
|
|
||||||
|
ANSIBLE_IPA_REPLICA_MODULE_IMPORT_ERROR = None # pylint: disable=invalid-name
|
||||||
try:
|
try:
|
||||||
from contextlib import contextmanager as contextlib_contextmanager
|
from contextlib import contextmanager as contextlib_contextmanager
|
||||||
from ipapython.version import NUM_VERSION, VERSION
|
from ipapython.version import NUM_VERSION, VERSION
|
||||||
@@ -188,26 +192,29 @@ try:
|
|||||||
time_service = "ntpd" # pylint: disable=invalid-name
|
time_service = "ntpd" # pylint: disable=invalid-name
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# pylint: disable=invalid-name
|
||||||
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = False
|
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = False
|
||||||
|
# pylint: enable=invalid-name
|
||||||
from ipaclient.install.client import ClientInstallInterface
|
from ipaclient.install.client import ClientInstallInterface
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if hasattr(ClientInstallInterface, "no_dnssec_validation"):
|
if hasattr(ClientInstallInterface, "no_dnssec_validation"):
|
||||||
|
# pylint: disable=invalid-name
|
||||||
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = True
|
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = True
|
||||||
|
# pylint: enable=invalid-name
|
||||||
else:
|
else:
|
||||||
# IPA version < 4.6
|
# IPA version < 4.6
|
||||||
raise RuntimeError("freeipa version '%s' is too old" % VERSION)
|
raise RuntimeError("freeipa version '%s' is too old" % VERSION)
|
||||||
|
|
||||||
except ImportError as _err:
|
except ImportError as _err:
|
||||||
|
# pylint: disable=invalid-name
|
||||||
ANSIBLE_IPA_REPLICA_MODULE_IMPORT_ERROR = str(_err)
|
ANSIBLE_IPA_REPLICA_MODULE_IMPORT_ERROR = str(_err)
|
||||||
|
# pylint: enable=invalid-name
|
||||||
|
|
||||||
for attr in __all__:
|
for attr in __all__:
|
||||||
setattr(sys.modules[__name__], attr, None)
|
setattr(sys.modules[__name__], attr, None)
|
||||||
|
|
||||||
else:
|
|
||||||
ANSIBLE_IPA_REPLICA_MODULE_IMPORT_ERROR = None
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("ipa-server-install")
|
logger = logging.getLogger("ipa-server-install")
|
||||||
|
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ def main():
|
|||||||
dns_over_tls=dict(required=False, type='bool',
|
dns_over_tls=dict(required=False, type='bool',
|
||||||
default=False),
|
default=False),
|
||||||
dns_over_tls_cert=dict(required=False, type='str'),
|
dns_over_tls_cert=dict(required=False, type='str'),
|
||||||
dns_over_tls_key=dict(required=False, type='str'),
|
dns_over_tls_key=dict(required=False, type='str', no_log=True),
|
||||||
dns_policy=dict(required=False, type='str',
|
dns_policy=dict(required=False, type='str',
|
||||||
choices=['relaxed', 'enforced'],
|
choices=['relaxed', 'enforced'],
|
||||||
default='relaxed'),
|
default='relaxed'),
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ def main():
|
|||||||
default=[]),
|
default=[]),
|
||||||
dns_over_tls=dict(required=False, type='bool', default=False),
|
dns_over_tls=dict(required=False, type='bool', default=False),
|
||||||
dns_over_tls_cert=dict(required=False, type='str'),
|
dns_over_tls_cert=dict(required=False, type='str'),
|
||||||
dns_over_tls_key=dict(required=False, type='str'),
|
dns_over_tls_key=dict(required=False, type='str', no_log=True),
|
||||||
dns_policy=dict(required=False, type='str',
|
dns_policy=dict(required=False, type='str',
|
||||||
choices=['relaxed', 'enforced'],
|
choices=['relaxed', 'enforced'],
|
||||||
default='relaxed'),
|
default='relaxed'),
|
||||||
|
|||||||
@@ -427,7 +427,7 @@ def main():
|
|||||||
default=[]),
|
default=[]),
|
||||||
dns_over_tls=dict(required=False, type='bool', default=False),
|
dns_over_tls=dict(required=False, type='bool', default=False),
|
||||||
dns_over_tls_cert=dict(required=False, type='str'),
|
dns_over_tls_cert=dict(required=False, type='str'),
|
||||||
dns_over_tls_key=dict(required=False, type='str'),
|
dns_over_tls_key=dict(required=False, type='str', no_log=True),
|
||||||
dns_policy=dict(required=False, type='str',
|
dns_policy=dict(required=False, type='str',
|
||||||
choices=['relaxed', 'enforced'],
|
choices=['relaxed', 'enforced'],
|
||||||
default='relaxed'),
|
default='relaxed'),
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ __all__ = ["IPAChangeConf", "certmonger", "sysrestore", "root_logger",
|
|||||||
"check_available_memory", "getargspec", "get_min_idstart",
|
"check_available_memory", "getargspec", "get_min_idstart",
|
||||||
"paths", "api", "ipautil", "adtrust_imported", "NUM_VERSION",
|
"paths", "api", "ipautil", "adtrust_imported", "NUM_VERSION",
|
||||||
"time_service", "kra_imported", "dsinstance", "IPA_PYTHON_VERSION",
|
"time_service", "kra_imported", "dsinstance", "IPA_PYTHON_VERSION",
|
||||||
"NUM_VERSION", "SerialNumber", "realm_to_ldapi_uri"]
|
"NUM_VERSION", "SerialNumber", "realm_to_ldapi_uri",
|
||||||
|
"CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION"]
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
@@ -74,6 +75,7 @@ except ImportError:
|
|||||||
return ArgSpec(args, varargs, varkw, defaults)
|
return ArgSpec(args, varargs, varkw, defaults)
|
||||||
|
|
||||||
|
|
||||||
|
ANSIBLE_IPA_SERVER_MODULE_IMPORT_ERROR = None # pylint: disable=invalid-name
|
||||||
try:
|
try:
|
||||||
from contextlib import contextmanager as contextlib_contextmanager
|
from contextlib import contextmanager as contextlib_contextmanager
|
||||||
from ansible.module_utils import six
|
from ansible.module_utils import six
|
||||||
@@ -217,24 +219,28 @@ try:
|
|||||||
SerialNumber = None
|
SerialNumber = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# pylint: disable=invalid-name
|
||||||
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = False
|
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = False
|
||||||
|
# pylint: enable=invalid-name
|
||||||
from ipaclient.install.client import ClientInstallInterface
|
from ipaclient.install.client import ClientInstallInterface
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if hasattr(ClientInstallInterface, "no_dnssec_validation"):
|
if hasattr(ClientInstallInterface, "no_dnssec_validation"):
|
||||||
|
# pylint: disable=invalid-name
|
||||||
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = True
|
CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION = True
|
||||||
|
# pylint: enable=invalid-name
|
||||||
else:
|
else:
|
||||||
# IPA version < 4.5
|
# IPA version < 4.5
|
||||||
raise RuntimeError("freeipa version '%s' is too old" % VERSION)
|
raise RuntimeError("freeipa version '%s' is too old" % VERSION)
|
||||||
|
|
||||||
except ImportError as _err:
|
except ImportError as _err:
|
||||||
|
# pylint: disable=invalid-name
|
||||||
ANSIBLE_IPA_SERVER_MODULE_IMPORT_ERROR = str(_err)
|
ANSIBLE_IPA_SERVER_MODULE_IMPORT_ERROR = str(_err)
|
||||||
|
# pylint: enable=invalid-name
|
||||||
|
|
||||||
for attr in __all__:
|
for attr in __all__:
|
||||||
setattr(sys.modules[__name__], attr, None)
|
setattr(sys.modules[__name__], attr, None)
|
||||||
else:
|
|
||||||
ANSIBLE_IPA_SERVER_MODULE_IMPORT_ERROR = None
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("ipa-server-install")
|
logger = logging.getLogger("ipa-server-install")
|
||||||
|
|||||||
Reference in New Issue
Block a user