mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-27 05:43:05 +00:00
Compare commits
110 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
433d1096f8 | ||
|
|
6a2d007b41 | ||
|
|
b0f58ef3a8 | ||
|
|
3c8d6c7c7a | ||
|
|
3b28050f1e | ||
|
|
2973c80975 | ||
|
|
0f8f55dfd9 | ||
|
|
777f25d91c | ||
|
|
727861cb85 | ||
|
|
e6da214bfb | ||
|
|
68a99ba5f9 | ||
|
|
d936a3794e | ||
|
|
bb0ba1ef2c | ||
|
|
1eb83548fa | ||
|
|
5d7afb5f85 | ||
|
|
f7c45c4f46 | ||
|
|
38a4bf804f | ||
|
|
7077776de3 | ||
|
|
2514158498 | ||
|
|
c6cc4df77b | ||
|
|
b3ee4f9bed | ||
|
|
401d5d5acc | ||
|
|
b971c6c5eb | ||
|
|
de8911af50 | ||
|
|
7e6e6c2dc2 | ||
|
|
668d89cdb2 | ||
|
|
0c1d4efc03 | ||
|
|
eefe91b852 | ||
|
|
bed8bf6661 | ||
|
|
577aeea3f3 | ||
|
|
4775ad9a53 | ||
|
|
81143be96a | ||
|
|
7debaa23ac | ||
|
|
e05dc41e0f | ||
|
|
8bab7d365b | ||
|
|
018337a19b | ||
|
|
bb08884221 | ||
|
|
abef329b8a | ||
|
|
3216f8df37 | ||
|
|
edccf70bf6 | ||
|
|
fd79f95f9b | ||
|
|
e2fcd7767e | ||
|
|
5a14f78d44 | ||
|
|
a3a7ecd817 | ||
|
|
63f016226c | ||
|
|
a58f61792b | ||
|
|
641c550cc3 | ||
|
|
c251632368 | ||
|
|
452d20e28d | ||
|
|
c7699472a6 | ||
|
|
eba457d5ff | ||
|
|
809e423947 | ||
|
|
e5f0ab2fe4 | ||
|
|
f85c60676c | ||
|
|
f9bf0cfec0 | ||
|
|
8f0d983845 | ||
|
|
aed5edae33 | ||
|
|
889b2a5576 | ||
|
|
e9d637c57a | ||
|
|
b3a97eacec | ||
|
|
aa745100e3 | ||
|
|
23faa83a0b | ||
|
|
12729fc2c0 | ||
|
|
31810ad7c0 | ||
|
|
9dcff9a308 | ||
|
|
e500c133c0 | ||
|
|
a5306b2db5 | ||
|
|
8ab3aa06ff | ||
|
|
87ff15a92c | ||
|
|
c8d5cb7ee2 | ||
|
|
2fa4aa60b1 | ||
|
|
4332636fd2 | ||
|
|
266f79b55f | ||
|
|
07b056ad25 | ||
|
|
7db5d59de1 | ||
|
|
e19e16c734 | ||
|
|
0ff119a2a8 | ||
|
|
90f6e14c40 | ||
|
|
e044310dad | ||
|
|
4be7a9fba0 | ||
|
|
98959807d2 | ||
|
|
a16379cfa0 | ||
|
|
672413f4dd | ||
|
|
8af4329fac | ||
|
|
9932b1dc98 | ||
|
|
1c44898e68 | ||
|
|
f44dc55b90 | ||
|
|
65b106449e | ||
|
|
7501c84844 | ||
|
|
d45e6ac399 | ||
|
|
d990832681 | ||
|
|
b998597815 | ||
|
|
d51ee9dc69 | ||
|
|
fdfea1b6fb | ||
|
|
ac92ed1408 | ||
|
|
757b89dfae | ||
|
|
914e4879f8 | ||
|
|
13cff6354b | ||
|
|
4ff5aaa172 | ||
|
|
d82abdbef9 | ||
|
|
5aa80204d5 | ||
|
|
8b8cbdd8c2 | ||
|
|
a06b16f5bc | ||
|
|
dc99b821eb | ||
|
|
796f84357a | ||
|
|
9e6c79abbb | ||
|
|
d3af87c731 | ||
|
|
7011283335 | ||
|
|
0297cbe973 | ||
|
|
1ec0d1e640 |
@@ -10,6 +10,8 @@ exclude_paths:
|
||||
- molecule/
|
||||
- tests/azure/
|
||||
- meta/runtime.yml
|
||||
- requirements-docker.yml
|
||||
- requirements-podman.yml
|
||||
|
||||
kinds:
|
||||
- playbook: '**/tests/**/test_*.yml'
|
||||
|
||||
@@ -65,6 +65,9 @@ Example playbook to read config options:
|
||||
maxusername: 64
|
||||
```
|
||||
|
||||
|
||||
Example playbook to set global configuration options:
|
||||
|
||||
```yaml
|
||||
---
|
||||
- name: Playbook to ensure some config options are set
|
||||
@@ -79,6 +82,40 @@ Example playbook to read config options:
|
||||
```
|
||||
|
||||
|
||||
Example playbook to enable SID and generate users and groups SIDs:
|
||||
|
||||
```yaml
|
||||
---
|
||||
- name: Playbook to ensure SIDs are enabled and users and groups have SIDs
|
||||
hosts: ipaserver
|
||||
become: no
|
||||
gather_facts: no
|
||||
|
||||
tasks:
|
||||
- name: Enable SID and generate users and groups SIDS
|
||||
ipaconfig:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
enable_sid: yes
|
||||
add_sids: yes
|
||||
```
|
||||
|
||||
Example playbook to change IPA domain NetBIOS name:
|
||||
|
||||
```yaml
|
||||
---
|
||||
- name: Playbook to change IPA domain netbios name
|
||||
hosts: ipaserver
|
||||
become: no
|
||||
gather_facts: no
|
||||
|
||||
tasks:
|
||||
- name: Set IPA domain netbios name
|
||||
ipaconfig:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
enable_sid: yes
|
||||
netbios_name: IPADOM
|
||||
```
|
||||
|
||||
Variables
|
||||
=========
|
||||
|
||||
@@ -111,6 +148,9 @@ Variable | Description | Required
|
||||
`user_auth_type` \| `ipauserauthtype` | set default types of supported user authentication (choices: `password`, `radius`, `otp`, `disabled`). Use `""` to clear this variable. | no
|
||||
`domain_resolution_order` \| `ipadomainresolutionorder` | Set list of domains used for short name qualification | no
|
||||
`ca_renewal_master_server` \| `ipacarenewalmasterserver`| Renewal master for IPA certificate authority. | no
|
||||
`enable_sid` | New users and groups automatically get a SID assigned. Requires IPA 4.9.8+. (bool) | no
|
||||
`netbios_name` | NetBIOS name of the IPA domain. Requires IPA 4.9.8+ and 'enable_sid: yes'. | no
|
||||
`add_sids` | Add SIDs for existing users and groups. Requires IPA 4.9.8+ and 'enable_sid: yes'. (bool) | no
|
||||
|
||||
|
||||
Return Values
|
||||
@@ -140,6 +180,8 @@ Variable | Description | Returned When
|
||||
| `user_auth_type` |
|
||||
| `domain_resolution_order` |
|
||||
| `ca_renewal_master_server` |
|
||||
| `enable_sid` |
|
||||
| `netbios_name` |
|
||||
|
||||
All returned fields take the same form as their namesake input parameters
|
||||
|
||||
|
||||
@@ -175,8 +175,8 @@ Variable | Description | Required
|
||||
`rid_base` \| `ipabaserid` | First RID of the corresponding RID range. (int) | no
|
||||
`secondary_rid_base` \| `ipasecondarybaserid` | First RID of the secondary RID range. (int) | no
|
||||
`dom_sid` \| `ipanttrusteddomainsid` | Domain SID of the trusted domain. | no
|
||||
`dom_name` \| `ipanttrusteddomainname` | Name of the trusted domain. | no
|
||||
`idrange_type` \| `iparangetype` | ID range type, one of `ipa-ad-trust`, `ipa-ad-trust-posix`, `ipa-local`. Only valid if idrange does not exist. | no
|
||||
`dom_name` \| `ipanttrusteddomainname` | Name of the trusted domain. Can only be used when `ipaapi_context: server`. | no
|
||||
`auto_private_groups` \| `ipaautoprivategroups` | Auto creation of private groups, one of `true`, `false`, `hybrid`. | no
|
||||
`delete_continue` \| `continue` | Continuous mode: don't stop on errors. Valid only if `state` is `absent`. Default: `no` (bool) | no
|
||||
`state` | The state to ensure. It can be one of `present`, `absent`, default: `present`. | no
|
||||
|
||||
@@ -381,8 +381,8 @@ Variable | Description | Required
|
||||
|
||||
Variable | Description | Required
|
||||
-------- | ----------- | --------
|
||||
`first` \| `givenname` | The first name string. | no
|
||||
`last` \| `sn` | The last name string. | no
|
||||
`first` \| `givenname` | The first name string. Required if user does not exist. | no
|
||||
`last` \| `sn` | The last name string. Required if user does not exist. | no
|
||||
`fullname` \| `cn` | The full name string. | no
|
||||
`displayname` | The display name string. | no
|
||||
`homedir` | The home directory string. | no
|
||||
|
||||
@@ -12,6 +12,7 @@ Features
|
||||
* One-time-password (OTP) support for client installation
|
||||
* Repair mode for clients
|
||||
* Backup and restore, also to and from controller
|
||||
* Smartcard setup for servers and clients
|
||||
* Modules for automembership rule management
|
||||
* Modules for automount key management
|
||||
* Modules for automount location management
|
||||
@@ -425,6 +426,8 @@ Roles
|
||||
* [Replica](roles/ipareplica/README.md)
|
||||
* [Client](roles/ipaclient/README.md)
|
||||
* [Backup](roles/ipabackup/README.md)
|
||||
* [SmartCard server](roles/ipasmartcard_server/README.md)
|
||||
* [SmartCard client](roles/ipasmartcard_client/README.md)
|
||||
|
||||
Modules in plugin/modules
|
||||
=========================
|
||||
|
||||
@@ -1 +1 @@
|
||||
centos-8
|
||||
fedora-latest
|
||||
30
molecule/fedora-rawhide-build/Dockerfile
Normal file
30
molecule/fedora-rawhide-build/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM fedora:rawhide
|
||||
ENV container=docker
|
||||
|
||||
RUN rm -fv /var/cache/dnf/metadata_lock.pid; \
|
||||
dnf makecache; \
|
||||
dnf --assumeyes install \
|
||||
/usr/bin/python3 \
|
||||
/usr/bin/python3-config \
|
||||
/usr/bin/dnf-3 \
|
||||
sudo \
|
||||
bash \
|
||||
systemd \
|
||||
procps-ng \
|
||||
iproute && \
|
||||
dnf clean all; \
|
||||
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
||||
rm -f /lib/systemd/system/multi-user.target.wants/*;\
|
||||
rm -f /etc/systemd/system/*.wants/*;\
|
||||
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
||||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
||||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
||||
rm -f /lib/systemd/system/basic.target.wants/*;\
|
||||
rm -f /lib/systemd/system/anaconda.target.wants/*; \
|
||||
rm -rf /var/cache/dnf/;
|
||||
|
||||
STOPSIGNAL RTMIN+3
|
||||
|
||||
VOLUME ["/sys/fs/cgroup"]
|
||||
|
||||
CMD ["/usr/sbin/init"]
|
||||
@@ -2,9 +2,9 @@
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
- name: centos-8-build
|
||||
image: "centos:centos8"
|
||||
pre_build_image: true
|
||||
- name: fedora-rawhide-build
|
||||
image: "fedora:rawhide"
|
||||
dockerfile: Dockerfile
|
||||
hostname: ipaserver.test.local
|
||||
dns_servers:
|
||||
- 8.8.8.8
|
||||
@@ -2,8 +2,8 @@
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
- name: centos-8
|
||||
image: quay.io/ansible-freeipa/upstream-tests:centos-8
|
||||
- name: fedora-rawhide
|
||||
image: quay.io/ansible-freeipa/upstream-tests:fedora-rawhide
|
||||
pre_build_image: true
|
||||
hostname: ipaserver.test.local
|
||||
dns_servers:
|
||||
12
playbooks/config/change-ipa-domain-netbios-name.yml
Normal file
12
playbooks/config/change-ipa-domain-netbios-name.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Playbook to change IPA domain netbios name
|
||||
hosts: ipaserver
|
||||
become: no
|
||||
gather_facts: no
|
||||
|
||||
tasks:
|
||||
- name: Set IPA domain netbios name
|
||||
ipaconfig:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
enable_sid: yes
|
||||
netbios_name: IPADOM
|
||||
12
playbooks/config/generate-users-groups-sids.yml
Normal file
12
playbooks/config/generate-users-groups-sids.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Playbook to ensure SIDs are enabled and users and groups have SIDs
|
||||
hosts: ipaserver
|
||||
become: no
|
||||
gather_facts: no
|
||||
|
||||
tasks:
|
||||
- name: Enable SID and generate users and groups SIDS
|
||||
ipaconfig:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
enable_sid: yes
|
||||
add_sids: yes
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Playbook to handle global DNS configuration
|
||||
- name: Playbook to handle global IPA configuration
|
||||
hosts: ipaserver
|
||||
become: no
|
||||
gather_facts: no
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Playbook to handle global DNS configuration
|
||||
- name: Playbook to handle global IPA configuration
|
||||
hosts: ipaserver
|
||||
become: no
|
||||
gather_facts: no
|
||||
|
||||
8
playbooks/install-smartcard-clients.yml
Normal file
8
playbooks/install-smartcard-clients.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Playbook to setup smartcard for IPA clients
|
||||
hosts: ipaclients
|
||||
become: true
|
||||
|
||||
roles:
|
||||
- role: ipasmartcard_client
|
||||
state: present
|
||||
8
playbooks/install-smartcard-replicas.yml
Normal file
8
playbooks/install-smartcard-replicas.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Playbook to setup smartcard for IPA replicas
|
||||
hosts: ipareplicas
|
||||
become: true
|
||||
|
||||
roles:
|
||||
- role: ipasmartcard_server
|
||||
state: present
|
||||
8
playbooks/install-smartcard-server.yml
Normal file
8
playbooks/install-smartcard-server.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Playbook to setup smartcard for IPA server
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
|
||||
roles:
|
||||
- role: ipasmartcard_server
|
||||
state: present
|
||||
8
playbooks/install-smartcard-servers.yml
Normal file
8
playbooks/install-smartcard-servers.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Playbook to setup smartcard for IPA server and replicas
|
||||
hosts: ipaserver, ipareplicas
|
||||
become: true
|
||||
|
||||
roles:
|
||||
- role: ipasmartcard_server
|
||||
state: present
|
||||
@@ -28,8 +28,8 @@ __metaclass__ = type
|
||||
__all__ = ["gssapi", "netaddr", "api", "ipalib_errors", "Env",
|
||||
"DEFAULT_CONFIG", "LDAP_GENERALIZED_TIME_FORMAT",
|
||||
"kinit_password", "kinit_keytab", "run", "DN", "VERSION",
|
||||
"paths", "get_credentials_if_valid", "Encoding",
|
||||
"load_pem_x509_certificate", "DNSName"]
|
||||
"paths", "tasks", "get_credentials_if_valid", "Encoding",
|
||||
"load_pem_x509_certificate", "DNSName", "getargspec"]
|
||||
|
||||
import sys
|
||||
|
||||
@@ -48,29 +48,32 @@ else:
|
||||
import gssapi
|
||||
from datetime import datetime
|
||||
from contextlib import contextmanager
|
||||
import inspect
|
||||
|
||||
# Import getargspec from inspect or provide own getargspec for
|
||||
# Python 2 compatibility with Python 3.11+.
|
||||
try:
|
||||
from inspect import getargspec
|
||||
except ImportError:
|
||||
from collections import namedtuple
|
||||
from inspect import getfullargspec
|
||||
|
||||
# The code is copied from Python 3.10 inspect.py
|
||||
# Authors: Ka-Ping Yee <ping@lfw.org>
|
||||
# Yury Selivanov <yselivanov@sprymix.com>
|
||||
ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')
|
||||
|
||||
def getargspec(func):
|
||||
args, varargs, varkw, defaults, kwonlyargs, _kwonlydefaults, \
|
||||
ann = getfullargspec(func)
|
||||
if kwonlyargs or ann:
|
||||
raise ValueError(
|
||||
"Function has keyword-only parameters or annotations"
|
||||
", use inspect.signature() API which can support them")
|
||||
return ArgSpec(args, varargs, varkw, defaults)
|
||||
|
||||
# ansible-freeipa requires locale to be C, IPA requires utf-8.
|
||||
os.environ["LANGUAGE"] = "C"
|
||||
|
||||
try:
|
||||
from packaging import version
|
||||
except ImportError:
|
||||
# If `packaging` not found, split version string for creating version
|
||||
# object. Although it is not PEP 440 compliant, it will work for stable
|
||||
# FreeIPA releases.
|
||||
import re
|
||||
|
||||
class version: # pylint: disable=invalid-name, too-few-public-methods
|
||||
@staticmethod
|
||||
def parse(version_str):
|
||||
"""
|
||||
Split a version string A.B.C, into a tuple.
|
||||
|
||||
This will not work for `rc`, `dev` or similar version string.
|
||||
"""
|
||||
return tuple(re.split("[-_.]", version_str)) # noqa: W605
|
||||
|
||||
from ipalib import api
|
||||
from ipalib import errors as ipalib_errors # noqa
|
||||
from ipalib.config import Env
|
||||
@@ -84,6 +87,7 @@ else:
|
||||
from ipapython.dn import DN
|
||||
from ipapython.version import VERSION
|
||||
from ipaplatform.paths import paths
|
||||
from ipaplatform.tasks import tasks
|
||||
from ipalib.krb_utils import get_credentials_if_valid
|
||||
from ipapython.dnsutil import DNSName
|
||||
from ipapython import kerberos
|
||||
@@ -139,6 +143,13 @@ else:
|
||||
|
||||
return fstore.has_files()
|
||||
|
||||
# Try to import dcerpc
|
||||
try:
|
||||
import ipaserver.dcerpc # pylint: disable=no-member
|
||||
_dcerpc_bindings_installed = True # pylint: disable=invalid-name
|
||||
except ImportError:
|
||||
_dcerpc_bindings_installed = False # pylint: disable=invalid-name
|
||||
|
||||
if six.PY3:
|
||||
unicode = str
|
||||
|
||||
@@ -221,6 +232,8 @@ else:
|
||||
ldap_cache: Control use of LDAP cache layer. (bool)
|
||||
|
||||
"""
|
||||
global _dcerpc_bindings_installed # pylint: disable=C0103,W0603
|
||||
|
||||
env = Env()
|
||||
env._bootstrap()
|
||||
env._finalize_core(**dict(DEFAULT_CONFIG))
|
||||
@@ -252,6 +265,7 @@ else:
|
||||
backend = api.Backend.ldap2
|
||||
else:
|
||||
backend = api.Backend.rpcclient
|
||||
_dcerpc_bindings_installed = False
|
||||
|
||||
if not backend.isconnected():
|
||||
backend.connect(ccache=os.environ.get('KRB5CCNAME', None))
|
||||
@@ -289,8 +303,8 @@ else:
|
||||
operation = oper_map.get(oper)
|
||||
if not operation:
|
||||
raise NotImplementedError("Invalid operator: %s" % oper)
|
||||
return operation(version.parse(VERSION),
|
||||
version.parse(requested_version))
|
||||
return operation(tasks.parse_ipa_version(VERSION),
|
||||
tasks.parse_ipa_version(requested_version))
|
||||
|
||||
def date_format(value):
|
||||
accepted_date_formats = [
|
||||
@@ -701,6 +715,42 @@ else:
|
||||
print(jsonify(kwargs))
|
||||
sys.exit(0)
|
||||
|
||||
def __get_domain_validator():
|
||||
if not _dcerpc_bindings_installed:
|
||||
raise ipalib_errors.NotFound(
|
||||
reason=(
|
||||
'Cannot perform SID validation without Samba 4 support '
|
||||
'installed. Make sure you have installed server-trust-ad '
|
||||
'sub-package of IPA on the server'
|
||||
)
|
||||
)
|
||||
|
||||
# pylint: disable=no-member
|
||||
domain_validator = ipaserver.dcerpc.DomainValidator(api)
|
||||
# pylint: enable=no-member
|
||||
|
||||
if not domain_validator.is_configured():
|
||||
raise ipalib_errors.NotFound(
|
||||
reason=(
|
||||
'Cross-realm trusts are not configured. Make sure you '
|
||||
'have run ipa-adtrust-install on the IPA server first'
|
||||
)
|
||||
)
|
||||
|
||||
return domain_validator
|
||||
|
||||
def get_trusted_domain_sid_from_name(dom_name):
|
||||
"""
|
||||
Given a trust domain name, returns the domain SID.
|
||||
|
||||
Returns unicode string representation for a given trusted domain name
|
||||
or None if SID for the given trusted domain name could not be found.
|
||||
"""
|
||||
domain_validator = __get_domain_validator()
|
||||
sid = domain_validator.get_sid_from_domain_name(dom_name)
|
||||
|
||||
return unicode(sid) if sid is not None else None
|
||||
|
||||
class IPAParamMapping(Mapping):
|
||||
"""
|
||||
Provides IPA API mapping to playbook parameters or computed values.
|
||||
@@ -799,7 +849,10 @@ else:
|
||||
# Check if param_name is actually a param
|
||||
if param_name in self.ansible_module.params:
|
||||
value = self.ansible_module.params_get(param_name)
|
||||
if isinstance(value, bool):
|
||||
if (
|
||||
self.ansible_module.ipa_check_version("<", "4.9.10")
|
||||
and isinstance(value, bool)
|
||||
):
|
||||
value = "TRUE" if value else "FALSE"
|
||||
|
||||
# Since param wasn't a param check if it's a method name
|
||||
@@ -1182,7 +1235,7 @@ else:
|
||||
elif result_handler is not None:
|
||||
if "errors" not in handlers_user_args:
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(result_handler)
|
||||
argspec = getargspec(result_handler)
|
||||
if "errors" in argspec.args:
|
||||
handlers_user_args["errors"] = _errors
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipaautomember
|
||||
short description: Add and delete FreeIPA Auto Membership Rules.
|
||||
short_description: Add and delete FreeIPA Auto Membership Rules.
|
||||
description: Add, modify and delete an IPA Auto Membership Rules.
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -148,6 +148,24 @@ options:
|
||||
required: false
|
||||
type: list
|
||||
aliases: ["ipadomainresolutionorder"]
|
||||
enable_sid:
|
||||
description: >
|
||||
New users and groups automatically get a SID assigned.
|
||||
Requires IPA 4.9.8+.
|
||||
required: false
|
||||
type: bool
|
||||
netbios_name:
|
||||
description: >
|
||||
NetBIOS name of the IPA domain.
|
||||
Requires IPA 4.9.8+ and 'enable_sid: yes'.
|
||||
required: false
|
||||
type: string
|
||||
add_sids:
|
||||
description: >
|
||||
Add SIDs for existing users and groups.
|
||||
Requires IPA 4.9.8+ and 'enable_sid: yes'.
|
||||
required: false
|
||||
type: bool
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
@@ -169,6 +187,24 @@ EXAMPLES = '''
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
defaultshell: /bin/bash
|
||||
maxusername: 64
|
||||
|
||||
- name: Playbook to enable SID and generate users and groups SIDs
|
||||
hosts: ipaserver
|
||||
tasks:
|
||||
- name: Enable SID and generate users and groups SIDS
|
||||
ipaconfig:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
enable_sid: yes
|
||||
add_sids: yes
|
||||
|
||||
- name: Playbook to change IPA domain netbios name
|
||||
hosts: ipaserver
|
||||
tasks:
|
||||
- name: Enable SID and generate users and groups SIDS
|
||||
ipaconfig:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
enable_sid: yes
|
||||
netbios_name: IPADOM
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
@@ -247,6 +283,14 @@ config:
|
||||
domain_resolution_order:
|
||||
description: list of domains used for short name qualification
|
||||
returned: always
|
||||
enable_sid:
|
||||
description: >
|
||||
new users and groups automatically get a SID assigned.
|
||||
Requires IPA 4.9.8+.
|
||||
returned: always
|
||||
netbios_name:
|
||||
description: NetBIOS name of the IPA domain. Requires IPA 4.9.8+.
|
||||
returned: if enable_sid is True
|
||||
'''
|
||||
|
||||
|
||||
@@ -260,6 +304,28 @@ def config_show(module):
|
||||
return _result["result"]
|
||||
|
||||
|
||||
def get_netbios_name(module):
|
||||
try:
|
||||
_result = module.ipa_command_no_name("trustconfig_show", {"all": True})
|
||||
except Exception: # pylint: disable=broad-except
|
||||
return None
|
||||
else:
|
||||
return _result["result"]["ipantflatname"][0]
|
||||
|
||||
|
||||
def is_enable_sid(module):
|
||||
"""When 'enable-sid' is true admin user and admins group have SID set."""
|
||||
_result = module.ipa_command("user_show", "admin", {"all": True})
|
||||
sid = _result["result"].get("ipantsecurityidentifier", [""])
|
||||
if not sid[0].endswith("-500"):
|
||||
return False
|
||||
_result = module.ipa_command("group_show", "admins", {"all": True})
|
||||
sid = _result["result"].get("ipantsecurityidentifier", [""])
|
||||
if not sid[0].endswith("-512"):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def main():
|
||||
ansible_module = IPAAnsibleModule(
|
||||
argument_spec=dict(
|
||||
@@ -313,7 +379,10 @@ def main():
|
||||
aliases=["ipauserauthtype"]),
|
||||
ca_renewal_master_server=dict(type="str", required=False),
|
||||
domain_resolution_order=dict(type="list", required=False,
|
||||
aliases=["ipadomainresolutionorder"])
|
||||
aliases=["ipadomainresolutionorder"]),
|
||||
enable_sid=dict(type="bool", required=False),
|
||||
add_sids=dict(type="bool", required=False),
|
||||
netbios_name=dict(type="str", required=False),
|
||||
),
|
||||
supports_check_mode=True,
|
||||
)
|
||||
@@ -344,7 +413,10 @@ def main():
|
||||
"pac_type": "ipakrbauthzdata",
|
||||
"user_auth_type": "ipauserauthtype",
|
||||
"ca_renewal_master_server": "ca_renewal_master_server",
|
||||
"domain_resolution_order": "ipadomainresolutionorder"
|
||||
"domain_resolution_order": "ipadomainresolutionorder",
|
||||
"enable_sid": "enable_sid",
|
||||
"netbios_name": "netbios_name",
|
||||
"add_sids": "add_sids",
|
||||
}
|
||||
allow_empty_string = ["pac_type", "user_auth_type", "configstring"]
|
||||
reverse_field_map = {v: k for k, v in field_map.items()}
|
||||
@@ -394,11 +466,47 @@ def main():
|
||||
changed = False
|
||||
exit_args = {}
|
||||
|
||||
# Connect to IPA API
|
||||
with ansible_module.ipa_connect():
|
||||
# Connect to IPA API (enable-sid requires context == 'client')
|
||||
with ansible_module.ipa_connect(context="client"):
|
||||
has_enable_sid = ansible_module.ipa_command_param_exists(
|
||||
"config_mod", "enable_sid")
|
||||
|
||||
result = config_show(ansible_module)
|
||||
|
||||
if params:
|
||||
netbios_name = params.get("netbios_name")
|
||||
if netbios_name:
|
||||
netbios_name = netbios_name.upper()
|
||||
add_sids = params.get("add_sids")
|
||||
enable_sid = params.get("enable_sid")
|
||||
required_sid = any([netbios_name, add_sids])
|
||||
if required_sid and not enable_sid:
|
||||
ansible_module.fail_json(
|
||||
"'enable-sid: yes' required for 'netbios_name' "
|
||||
"and 'add-sids'."
|
||||
)
|
||||
if enable_sid:
|
||||
if not has_enable_sid:
|
||||
ansible_module.fail_json(
|
||||
"This version of IPA does not support 'enable-sid'.")
|
||||
if (
|
||||
netbios_name
|
||||
and netbios_name == get_netbios_name(ansible_module)
|
||||
):
|
||||
del params["netbios_name"]
|
||||
netbios_name = None
|
||||
if not add_sids and "add_sids" in params:
|
||||
del params["add_sids"]
|
||||
if (
|
||||
not any([netbios_name, add_sids])
|
||||
and is_enable_sid(ansible_module)
|
||||
):
|
||||
del params["enable_sid"]
|
||||
else:
|
||||
for param in ["enable_sid", "netbios_name", "add_sids"]:
|
||||
if param in params:
|
||||
del params[params]
|
||||
|
||||
params = {
|
||||
k: v for k, v in params.items()
|
||||
if k not in result or result[k] != v
|
||||
@@ -441,7 +549,11 @@ def main():
|
||||
elif (
|
||||
isinstance(value, (tuple, list)) and arg_type == "bool"
|
||||
):
|
||||
exit_args[k] = (value[0] == "TRUE")
|
||||
# FreeIPA 4.9.10+ and 4.10 use proper mapping for
|
||||
# boolean values, so we need to convert it to str
|
||||
# for comparison.
|
||||
# See: https://github.com/freeipa/freeipa/pull/6294
|
||||
exit_args[k] = (str(value[0]).upper() == "TRUE")
|
||||
else:
|
||||
if arg_type not in type_map:
|
||||
raise ValueError(
|
||||
@@ -454,6 +566,10 @@ def main():
|
||||
# Add empty domain_resolution_order if it is not set
|
||||
if "domain_resolution_order" not in exit_args:
|
||||
exit_args["domain_resolution_order"] = []
|
||||
# Set enable_sid
|
||||
if has_enable_sid:
|
||||
exit_args["enable_sid"] = is_enable_sid(ansible_module)
|
||||
exit_args["netbios_name"] = get_netbios_name(ansible_module)
|
||||
|
||||
# Done
|
||||
ansible_module.exit_json(changed=changed, config=exit_args)
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipadelegation
|
||||
short description: Manage FreeIPA delegations
|
||||
short_description: Manage FreeIPA delegations
|
||||
description: Manage FreeIPA delegations and delegation attributes
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -33,7 +33,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipadnsconfig
|
||||
short description: Manage FreeIPA dnsconfig
|
||||
short_description: Manage FreeIPA dnsconfig
|
||||
description: Manage FreeIPA dnsconfig
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
@@ -173,7 +173,10 @@ def gen_args(module, state, action, dnsconfig, forwarders, forward_policy,
|
||||
_args['idnsforwardpolicy'] = forward_policy
|
||||
|
||||
if allow_sync_ptr is not None:
|
||||
_args['idnsallowsyncptr'] = 'TRUE' if allow_sync_ptr else 'FALSE'
|
||||
if module.ipa_check_version("<", "4.9.10"):
|
||||
_args['idnsallowsyncptr'] = "TRUE" if allow_sync_ptr else "FALSE"
|
||||
else:
|
||||
_args['idnsallowsyncptr'] = allow_sync_ptr
|
||||
|
||||
return _args
|
||||
|
||||
@@ -199,7 +202,8 @@ def main():
|
||||
choices=["member", "dnsconfig"]),
|
||||
state=dict(type="str", default="present",
|
||||
choices=["present", "absent"]),
|
||||
)
|
||||
),
|
||||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
ansible_module._ansible_debug = True
|
||||
|
||||
@@ -344,7 +344,13 @@ def main():
|
||||
|
||||
if state in ['enabled', 'disabled']:
|
||||
if existing_resource is not None:
|
||||
is_enabled = existing_resource["idnszoneactive"][0]
|
||||
# FreeIPA 4.9.10+ and 4.10 use proper mapping for
|
||||
# boolean values, so we need to convert it to str
|
||||
# for comparison.
|
||||
# See: https://github.com/freeipa/freeipa/pull/6294
|
||||
is_enabled = (
|
||||
str(existing_resource["idnszoneactive"][0]).upper()
|
||||
)
|
||||
else:
|
||||
ansible_module.fail_json(
|
||||
msg="dnsforwardzone '%s' not found." % (name))
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipadnsrecord
|
||||
short description: Manage FreeIPA DNS records
|
||||
short_description: Manage FreeIPA DNS records
|
||||
description: Manage FreeIPA DNS records
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipadnszone
|
||||
short description: Manage FreeIPA dnszone
|
||||
short_description: Manage FreeIPA dnszone
|
||||
description: Manage FreeIPA dnszone
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
@@ -418,7 +418,11 @@ class DNSZoneModule(IPAAnsibleModule):
|
||||
is_zone_active = False
|
||||
else:
|
||||
zone = response["result"]
|
||||
is_zone_active = "TRUE" in zone.get("idnszoneactive")
|
||||
# FreeIPA 4.9.10+ and 4.10 use proper mapping for boolean vaalues.
|
||||
# See: https://github.com/freeipa/freeipa/pull/6294
|
||||
is_zone_active = (
|
||||
str(zone.get("idnszoneactive")[0]).upper() == "TRUE"
|
||||
)
|
||||
|
||||
return zone, is_zone_active
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipagroup
|
||||
short description: Manage FreeIPA groups
|
||||
short_description: Manage FreeIPA groups
|
||||
description: Manage FreeIPA groups
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipahbacrule
|
||||
short description: Manage FreeIPA HBAC rules
|
||||
short_description: Manage FreeIPA HBAC rules
|
||||
description: Manage FreeIPA HBAC rules
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
@@ -472,18 +472,26 @@ def main():
|
||||
# hbacrule_enable is not failing on an enabled hbacrule
|
||||
# Therefore it is needed to have a look at the ipaenabledflag
|
||||
# in res_find.
|
||||
if "ipaenabledflag" not in res_find or \
|
||||
res_find["ipaenabledflag"][0] != "TRUE":
|
||||
# FreeIPA 4.9.10+ and 4.10 use proper mapping for
|
||||
# boolean values, so we need to convert it to str
|
||||
# for comparison.
|
||||
# See: https://github.com/freeipa/freeipa/pull/6294
|
||||
enabled_flag = str(res_find.get("ipaenabledflag", [False])[0])
|
||||
if enabled_flag.upper() != "TRUE":
|
||||
commands.append([name, "hbacrule_enable", {}])
|
||||
|
||||
elif state == "disabled":
|
||||
if res_find is None:
|
||||
ansible_module.fail_json(msg="No hbacrule '%s'" % name)
|
||||
# hbacrule_disable is not failing on an disabled hbacrule
|
||||
# hbacrule_disable is not failing on an enabled hbacrule
|
||||
# Therefore it is needed to have a look at the ipaenabledflag
|
||||
# in res_find.
|
||||
if "ipaenabledflag" not in res_find or \
|
||||
res_find["ipaenabledflag"][0] != "FALSE":
|
||||
# FreeIPA 4.9.10+ and 4.10 use proper mapping for
|
||||
# boolean values, so we need to convert it to str
|
||||
# for comparison.
|
||||
# See: https://github.com/freeipa/freeipa/pull/6294
|
||||
enabled_flag = str(res_find.get("ipaenabledflag", [False])[0])
|
||||
if enabled_flag.upper() != "FALSE":
|
||||
commands.append([name, "hbacrule_disable", {}])
|
||||
|
||||
else:
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipahbacsvc
|
||||
short description: Manage FreeIPA HBAC Services
|
||||
short_description: Manage FreeIPA HBAC Services
|
||||
description: Manage FreeIPA HBAC Services
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -33,7 +33,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipahbacsvcgroup
|
||||
short description: Manage FreeIPA hbacsvcgroups
|
||||
short_description: Manage FreeIPA hbacsvcgroups
|
||||
description: Manage FreeIPA hbacsvcgroups
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipahost
|
||||
short description: Manage FreeIPA hosts
|
||||
short_description: Manage FreeIPA hosts
|
||||
description: Manage FreeIPA hosts
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -33,7 +33,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipahostgroup
|
||||
short description: Manage FreeIPA hostgroups
|
||||
short_description: Manage FreeIPA hostgroups
|
||||
description: Manage FreeIPA hostgroups
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipaidrange
|
||||
short description: Manage FreeIPA idrange
|
||||
short_description: Manage FreeIPA idrange
|
||||
description: Manage FreeIPA idrange
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
@@ -74,7 +74,9 @@ options:
|
||||
required: false
|
||||
aliases: ["ipanttrusteddomainsid"]
|
||||
dom_name:
|
||||
description: Domain name of the trusted domain.
|
||||
description: |
|
||||
Domain name of the trusted domain. Can only be used when
|
||||
`ipaapi_context: server`.
|
||||
type: string
|
||||
required: false
|
||||
aliases: ["ipanttrusteddomainname"]
|
||||
@@ -134,7 +136,7 @@ RETURN = """
|
||||
|
||||
|
||||
from ansible.module_utils.ansible_freeipa_module import \
|
||||
IPAAnsibleModule, compare_args_ipa
|
||||
IPAAnsibleModule, compare_args_ipa, get_trusted_domain_sid_from_name
|
||||
from ansible.module_utils import six
|
||||
|
||||
if six.PY3:
|
||||
@@ -154,7 +156,7 @@ def find_idrange(module, name):
|
||||
|
||||
def gen_args(
|
||||
base_id, range_size, rid_base, secondary_rid_base, idrange_type, dom_sid,
|
||||
auto_private_groups
|
||||
dom_name, auto_private_groups
|
||||
):
|
||||
_args = {}
|
||||
# Integer parameters are stored as strings.
|
||||
@@ -169,6 +171,8 @@ def gen_args(
|
||||
_args["ipasecondarybaserid"] = secondary_rid_base
|
||||
if idrange_type is not None:
|
||||
_args["iparangetype"] = idrange_type
|
||||
if dom_name is not None:
|
||||
dom_sid = get_trusted_domain_sid_from_name(dom_name)
|
||||
if dom_sid is not None:
|
||||
_args["ipanttrusteddomainsid"] = dom_sid
|
||||
if auto_private_groups is not None:
|
||||
@@ -230,6 +234,7 @@ def main():
|
||||
secondary_rid_base = ansible_module.params_get("secondary_rid_base")
|
||||
idrange_type = ansible_module.params_get("idrange_type")
|
||||
dom_sid = ansible_module.params_get("dom_sid")
|
||||
dom_name = ansible_module.params_get("dom_name")
|
||||
auto_private_groups = \
|
||||
ansible_module.params_get_lowercase("auto_private_groups")
|
||||
|
||||
@@ -248,7 +253,10 @@ def main():
|
||||
if state == "absent":
|
||||
if len(names) < 1:
|
||||
ansible_module.fail_json(msg="No name given.")
|
||||
invalid = ["base_id", "range_size", "idrange_type", "dom_sid"]
|
||||
invalid = [
|
||||
"base_id", "range_size", "idrange_type", "dom_sid", "dom_name",
|
||||
"rid_base", "secondary_rid_base", "auto_private_groups"
|
||||
]
|
||||
|
||||
ansible_module.params_fail_used_invalid(invalid, state)
|
||||
|
||||
@@ -278,7 +286,7 @@ def main():
|
||||
# Generate args
|
||||
args = gen_args(
|
||||
base_id, range_size, rid_base, secondary_rid_base,
|
||||
idrange_type, dom_sid, auto_private_groups
|
||||
idrange_type, dom_sid, dom_name, auto_private_groups
|
||||
)
|
||||
|
||||
# Found the idrange
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipalocation
|
||||
short description: Manage FreeIPA location
|
||||
short_description: Manage FreeIPA location
|
||||
description: Manage FreeIPA location
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipapermission
|
||||
short description: Manage FreeIPA permission
|
||||
short_description: Manage FreeIPA permission
|
||||
description: Manage FreeIPA permission and permission members
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -35,7 +35,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipaprivilege
|
||||
short description: Manage FreeIPA privilege
|
||||
short_description: Manage FreeIPA privilege
|
||||
description: Manage FreeIPA privilege and privilege members
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipapwpolicy
|
||||
short description: Manage FreeIPA pwpolicies
|
||||
short_description: Manage FreeIPA pwpolicies
|
||||
description: Manage FreeIPA pwpolicies
|
||||
options:
|
||||
ipaadmin_principal:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: iparole
|
||||
short description: Manage FreeIPA role
|
||||
short_description: Manage FreeIPA role
|
||||
description: Manage FreeIPA role
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipaselfservice
|
||||
short description: Manage FreeIPA selfservices
|
||||
short_description: Manage FreeIPA selfservices
|
||||
description: Manage FreeIPA selfservices and selfservice attributes
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipaserver
|
||||
short description: Manage FreeIPA server
|
||||
short_description: Manage FreeIPA server
|
||||
description: Manage FreeIPA server
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -33,7 +33,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipaservice
|
||||
short description: Manage FreeIPA service
|
||||
short_description: Manage FreeIPA service
|
||||
description: Manage FreeIPA service
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipaservicedelegationrule
|
||||
short description: Manage FreeIPA servicedelegationrule
|
||||
short_description: Manage FreeIPA servicedelegationrule
|
||||
description: |
|
||||
Manage FreeIPA servicedelegationrule and servicedelegationrule members
|
||||
extends_documentation_fragment:
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipaservicedelegationtarget
|
||||
short description: Manage FreeIPA servicedelegationtarget
|
||||
short_description: Manage FreeIPA servicedelegationtarget
|
||||
description: |
|
||||
Manage FreeIPA servicedelegationtarget and servicedelegationtarget members
|
||||
extends_documentation_fragment:
|
||||
|
||||
@@ -33,7 +33,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipasudocmd
|
||||
short description: Manage FreeIPA sudo command
|
||||
short_description: Manage FreeIPA sudo command
|
||||
description: Manage FreeIPA sudo command
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -33,7 +33,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipasudocmdgroup
|
||||
short description: Manage FreeIPA sudocmd groups
|
||||
short_description: Manage FreeIPA sudocmd groups
|
||||
description: Manage FreeIPA sudocmd groups
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipasudorule
|
||||
short description: Manage FreeIPA sudo rules
|
||||
short_description: Manage FreeIPA sudo rules
|
||||
description: Manage FreeIPA sudo rules
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
@@ -162,19 +162,19 @@ EXAMPLES = """
|
||||
hostgroup: cluster
|
||||
action: member
|
||||
|
||||
# Ensure sudo rule for usercategory "all"
|
||||
# Ensure sudo rule for usercategory "all" is enabled
|
||||
- ipasudorule:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
name: allusers
|
||||
usercategory: all
|
||||
action: enabled
|
||||
state: enabled
|
||||
|
||||
# Ensure sudo rule for hostcategory "all"
|
||||
# Ensure sudo rule for hostcategory "all" is enabled
|
||||
- ipasudorule:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
name: allhosts
|
||||
hostcategory: all
|
||||
action: enabled
|
||||
state: enabled
|
||||
|
||||
# Ensure Sudo Rule tesrule1 is absent
|
||||
- ipasudorule:
|
||||
@@ -656,8 +656,12 @@ def main():
|
||||
# sudorule_enable is not failing on an enabled sudorule
|
||||
# Therefore it is needed to have a look at the ipaenabledflag
|
||||
# in res_find.
|
||||
if "ipaenabledflag" not in res_find or \
|
||||
res_find["ipaenabledflag"][0] != "TRUE":
|
||||
# FreeIPA 4.9.10+ and 4.10 use proper mapping for
|
||||
# boolean values, so we need to convert it to str
|
||||
# for comparison.
|
||||
# See: https://github.com/freeipa/freeipa/pull/6294
|
||||
enabled_flag = str(res_find.get("ipaenabledflag", [False])[0])
|
||||
if enabled_flag.upper() != "TRUE":
|
||||
commands.append([name, "sudorule_enable", {}])
|
||||
|
||||
elif state == "disabled":
|
||||
@@ -666,8 +670,12 @@ def main():
|
||||
# sudorule_disable is not failing on an disabled sudorule
|
||||
# Therefore it is needed to have a look at the ipaenabledflag
|
||||
# in res_find.
|
||||
if "ipaenabledflag" not in res_find or \
|
||||
res_find["ipaenabledflag"][0] != "FALSE":
|
||||
# FreeIPA 4.9.10+ and 4.10 use proper mapping for
|
||||
# boolean values, so we need to convert it to str
|
||||
# for comparison.
|
||||
# See: https://github.com/freeipa/freeipa/pull/6294
|
||||
enabled_flag = str(res_find.get("ipaenabledflag", [False])[0])
|
||||
if enabled_flag.upper() != "FALSE":
|
||||
commands.append([name, "sudorule_disable", {}])
|
||||
|
||||
else:
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipatopologysegment
|
||||
short description: Manage FreeIPA topology segments
|
||||
short_description: Manage FreeIPA topology segments
|
||||
description: Manage FreeIPA topology segments
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipatopologysuffix
|
||||
short description: Verify FreeIPA topology suffix
|
||||
short_description: Verify FreeIPA topology suffix
|
||||
description: Verify FreeIPA topology suffix
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipauser
|
||||
short description: Manage FreeIPA users
|
||||
short_description: Manage FreeIPA users
|
||||
description: Manage FreeIPA users
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
@@ -47,11 +47,11 @@ options:
|
||||
description: The user (internally uid).
|
||||
required: true
|
||||
first:
|
||||
description: The first name
|
||||
description: The first name. Required if user does not exist.
|
||||
required: false
|
||||
aliases: ["givenname"]
|
||||
last:
|
||||
description: The last name
|
||||
description: The last name. Required if user doesnot exst.
|
||||
required: false
|
||||
aliases: ["sn"]
|
||||
fullname:
|
||||
@@ -212,11 +212,11 @@ options:
|
||||
type: bool
|
||||
required: false
|
||||
first:
|
||||
description: The first name
|
||||
description: The first name. Required if user does not exist.
|
||||
required: false
|
||||
aliases: ["givenname"]
|
||||
last:
|
||||
description: The last name
|
||||
description: The last name. Required if user does not exist.
|
||||
required: false
|
||||
aliases: ["sn"]
|
||||
fullname:
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipavault
|
||||
short description: Manage vaults and secret vaults.
|
||||
short_description: Manage vaults and secret vaults.
|
||||
description: Manage vaults and secret vaults. KRA service must be enabled.
|
||||
extends_documentation_fragment:
|
||||
- ipamodule_base_docs
|
||||
@@ -525,7 +525,7 @@ def check_encryption_params( # pylint: disable=unused-argument
|
||||
|
||||
if (
|
||||
salt is not None
|
||||
and not(
|
||||
and not (
|
||||
any([password, password_file])
|
||||
and any([new_password, new_password_file])
|
||||
)
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
-r requirements-tests.txt
|
||||
ipdb
|
||||
ipdb==0.13.4
|
||||
pre-commit
|
||||
flake8==4.0.1
|
||||
flake8-bugbear
|
||||
pylint==2.12.2
|
||||
pylint==2.13.7
|
||||
pydocstyle==6.0.0
|
||||
yamllint==1.26.3
|
||||
ansible-lint==5.3.2
|
||||
dnspython==2.2.0
|
||||
netaddr==0.8.0
|
||||
gssapi==1.7.2
|
||||
|
||||
3
requirements-docker.yml
Normal file
3
requirements-docker.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
collections:
|
||||
- name: community.docker
|
||||
3
requirements-podman.yml
Normal file
3
requirements-podman.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
collections:
|
||||
- name: containers.podman
|
||||
@@ -1,6 +1,7 @@
|
||||
-r requirements.txt
|
||||
pytest>=2.7
|
||||
pytest-sourceorder>=0.5
|
||||
pytest-split-tests>=1.0.3
|
||||
pytest-split>=0.8.0
|
||||
pytest-custom_exit_code>=0.3.0
|
||||
pytest-testinfra>=5.0
|
||||
pyyaml>=3
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipabackup_get_backup_dir
|
||||
short description:
|
||||
short_description:
|
||||
Get IPA_BACKUP_DIR from ipaplatform
|
||||
description:
|
||||
Get IPA_BACKUP_DIR from ipaplatform
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
fail: msg="ipabackup_from_controller and ipabackup_to_controller are set"
|
||||
when: ipabackup_from_controller | bool and ipabackup_to_controller | bool
|
||||
|
||||
- name: Fail for given ipabackup_name if state is not copied, restored or absent
|
||||
fail: msg="ipabackup_name is given and state is not copied, restored or absent"
|
||||
when: state is not defined or
|
||||
(state != "copied" and state != "restored" and state != "absent") and
|
||||
ipabackup_name is defined
|
||||
|
||||
- name: Get ipabackup_dir from IPA installation
|
||||
include_tasks: "{{ role_path }}/tasks/get_ipabackup_dir.yml"
|
||||
|
||||
@@ -33,12 +39,6 @@
|
||||
include_tasks: "{{ role_path }}/tasks/backup.yml"
|
||||
when: state|default("present") == "present"
|
||||
|
||||
- name: Fail for given ipabackup_name if state is not copied, restored or absent
|
||||
fail: msg="ipabackup_name is given and state is not copied, restored or absent"
|
||||
when: state is not defined or
|
||||
(state != "copied" and state != "restored" and state != "absent") and
|
||||
ipabackup_name is defined
|
||||
|
||||
- name: Fail on missing ipabackup_name
|
||||
fail: msg="ipabackup_name is not set"
|
||||
when: (ipabackup_name is not defined or not ipabackup_name) and
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.0',
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_api
|
||||
short description:
|
||||
short_description:
|
||||
Create temporary NSS database, call IPA API for remaining enrollment parts
|
||||
description:
|
||||
Create temporary NSS database, call IPA API for remaining enrollment parts
|
||||
@@ -75,7 +75,6 @@ subject_base:
|
||||
'''
|
||||
|
||||
import os
|
||||
import inspect
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_client import (
|
||||
@@ -83,7 +82,7 @@ from ansible.module_utils.ansible_ipa_client import (
|
||||
paths, x509, NUM_VERSION, serialization, certdb, api,
|
||||
delete_persistent_client_session_data, write_tmp_file,
|
||||
ipa_generate_password, CalledProcessError, errors, disable_ra, DN,
|
||||
CLIENT_INSTALL_ERROR, logger
|
||||
CLIENT_INSTALL_ERROR, logger, getargspec
|
||||
)
|
||||
|
||||
|
||||
@@ -134,7 +133,7 @@ def main():
|
||||
# Add CA certs to a temporary NSS database
|
||||
try:
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(tmp_db.create_db)
|
||||
argspec = getargspec(tmp_db.create_db)
|
||||
# pylint: enable=deprecated-method
|
||||
if "password_filename" not in argspec.args:
|
||||
tmp_db.create_db()
|
||||
|
||||
@@ -32,7 +32,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.0',
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_fix_ca
|
||||
short description: Fix IPA ca certificate
|
||||
short_description: Fix IPA ca certificate
|
||||
description: Repair Fix IPA ca certificate
|
||||
options:
|
||||
servers:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_fstore
|
||||
short description: Backup files using IPA client sysrestore
|
||||
short_description: Backup files using IPA client sysrestore
|
||||
description: Backup files using IPA client sysrestore
|
||||
options:
|
||||
backup:
|
||||
|
||||
@@ -7,7 +7,7 @@ __metaclass__ = type
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
module: ipaclient_get_facts
|
||||
short description: Get facts about IPA client and server configuration.
|
||||
short_description: Get facts about IPA client and server configuration.
|
||||
description: Get facts about IPA client and server configuration.
|
||||
author:
|
||||
- Thomas Woerner
|
||||
|
||||
@@ -30,7 +30,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.0',
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_get_otp
|
||||
short description: Manage IPA hosts
|
||||
short_description: Manage IPA hosts
|
||||
description:
|
||||
Manage hosts in a IPA domain.
|
||||
The operation needs to be authenticated with Kerberos either by providing
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_ipa_conf
|
||||
short description: Configure ipa.conf
|
||||
short_description: Configure ipa.conf
|
||||
description:
|
||||
Configure ipa.conf
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_join
|
||||
short description:
|
||||
short_description:
|
||||
Join a machine to an IPA realm and get a keytab for the host service
|
||||
principal
|
||||
description:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_set_hostname
|
||||
short description: Backup and set hostname
|
||||
short_description: Backup and set hostname
|
||||
description:
|
||||
Backup and set hostname
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_setup_automount
|
||||
short description: Setup automount for IPA client
|
||||
short_description: Setup automount for IPA client
|
||||
description:
|
||||
Setup automount for IPA client
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_setup_firefox
|
||||
short description: Setup firefox for IPA client
|
||||
short_description: Setup firefox for IPA client
|
||||
description:
|
||||
Setup firefox for IPA client
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_setup_krb5
|
||||
short description: Setup krb5 for IPA client
|
||||
short_description: Setup krb5 for IPA client
|
||||
description:
|
||||
Setup krb5 for IPA client
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_setup_nis
|
||||
short description: Setup NIS for IPA client
|
||||
short_description: Setup NIS for IPA client
|
||||
description:
|
||||
Setup NIS for IPA client
|
||||
options:
|
||||
@@ -57,11 +57,10 @@ EXAMPLES = '''
|
||||
RETURN = '''
|
||||
'''
|
||||
|
||||
import inspect
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_client import (
|
||||
setup_logging, options, sysrestore, paths, configure_nisdomain
|
||||
setup_logging, options, sysrestore, paths, configure_nisdomain,
|
||||
getargspec
|
||||
)
|
||||
|
||||
|
||||
@@ -83,7 +82,7 @@ def main():
|
||||
statestore = sysrestore.StateFile(paths.IPA_CLIENT_SYSRESTORE)
|
||||
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(configure_nisdomain)
|
||||
argspec = getargspec(configure_nisdomain)
|
||||
# pylint: enable=deprecated-method
|
||||
if "statestore" not in argspec.args:
|
||||
# NUM_VERSION < 40500:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_setup_nss
|
||||
short description: Create IPA client NSS database
|
||||
short_description: Create IPA client NSS database
|
||||
description: Create IPA NSS database
|
||||
options:
|
||||
servers:
|
||||
@@ -141,7 +141,6 @@ RETURN = '''
|
||||
|
||||
import os
|
||||
import time
|
||||
import inspect
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_client import (
|
||||
@@ -151,7 +150,7 @@ from ansible.module_utils.ansible_ipa_client import (
|
||||
get_certs_from_ldap, DN, certstore, x509, logger, certdb,
|
||||
CalledProcessError, tasks, client_dns, configure_certmonger, services,
|
||||
update_ssh_keys, save_state, configure_ldap_conf, configure_nslcd_conf,
|
||||
configure_openldap_conf, hardcode_ldap_server
|
||||
configure_openldap_conf, hardcode_ldap_server, getargspec
|
||||
)
|
||||
|
||||
|
||||
@@ -323,7 +322,7 @@ def main():
|
||||
pass
|
||||
|
||||
# pylint: disable=deprecated-method
|
||||
argspec_save_state = inspect.getargspec(save_state)
|
||||
argspec_save_state = getargspec(save_state)
|
||||
|
||||
# Name Server Caching Daemon. Disable for SSSD, use otherwise
|
||||
# (if installed)
|
||||
@@ -387,7 +386,7 @@ def main():
|
||||
if not options.no_ac:
|
||||
# Modify nsswitch/pam stack
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(tasks.modify_nsswitch_pam_stack)
|
||||
argspec = getargspec(tasks.modify_nsswitch_pam_stack)
|
||||
if "sudo" in argspec.args:
|
||||
tasks.modify_nsswitch_pam_stack(
|
||||
sssd=options.sssd,
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_setup_ntp
|
||||
short description: Setup NTP for IPA client
|
||||
short_description: Setup NTP for IPA client
|
||||
description:
|
||||
Setup NTP for IPA client
|
||||
options:
|
||||
@@ -66,13 +66,11 @@ EXAMPLES = '''
|
||||
RETURN = '''
|
||||
'''
|
||||
|
||||
import inspect
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_client import (
|
||||
setup_logging,
|
||||
options, sysrestore, paths, sync_time, logger, ipadiscovery,
|
||||
timeconf
|
||||
timeconf, getargspec
|
||||
)
|
||||
|
||||
|
||||
@@ -114,7 +112,7 @@ def main():
|
||||
if options.conf_ntp:
|
||||
# Attempt to configure and sync time with NTP server (chrony).
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(sync_time)
|
||||
argspec = getargspec(sync_time)
|
||||
# pylint: enable=deprecated-method
|
||||
if "options" not in argspec.args:
|
||||
synced_ntp = sync_time(options.ntp_servers, options.ntp_pool,
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_setup_ssh
|
||||
short description: Configure ssh and sshd for IPA client
|
||||
short_description: Configure ssh and sshd for IPA client
|
||||
description:
|
||||
Configure ssh and sshd for IPA client
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_setup_ssd
|
||||
short description: Setup sssd for IPA client
|
||||
short_description: Setup sssd for IPA client
|
||||
description:
|
||||
Setup sssd for IPA client
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_test
|
||||
short description: Tries to discover IPA server
|
||||
short_description: Tries to discover IPA server
|
||||
description:
|
||||
Tries to discover IPA server using DNS or host name
|
||||
options:
|
||||
@@ -197,7 +197,6 @@ nosssd_files:
|
||||
|
||||
import os
|
||||
import socket
|
||||
import inspect
|
||||
|
||||
try:
|
||||
from ansible.module_utils.six.moves.configparser import RawConfigParser
|
||||
@@ -212,7 +211,7 @@ from ansible.module_utils.ansible_ipa_client import (
|
||||
CLIENT_INSTALL_ERROR, tasks, check_ldap_conf, timeconf, constants,
|
||||
validate_hostname, nssldap_exists, gssapi, remove_file,
|
||||
check_ip_addresses, ipadiscovery, print_port_conf_info,
|
||||
IPA_PYTHON_VERSION
|
||||
IPA_PYTHON_VERSION, getargspec
|
||||
)
|
||||
|
||||
|
||||
@@ -344,7 +343,7 @@ def main():
|
||||
|
||||
if options.realm_name:
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(validate_domain_name)
|
||||
argspec = getargspec(validate_domain_name)
|
||||
if "entity" in argspec.args:
|
||||
# NUM_VERSION >= 40690:
|
||||
validate_domain_name(options.realm_name, entity="realm")
|
||||
@@ -881,7 +880,6 @@ def main():
|
||||
is_ipaddr = False
|
||||
|
||||
if is_ipaddr:
|
||||
logger.info()
|
||||
logger.warning(
|
||||
"It seems that you are using an IP address "
|
||||
"instead of FQDN as an argument to --server. The "
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipaclient_test_keytab
|
||||
short description:
|
||||
short_description:
|
||||
Test if the krb5.keytab on the machine is valid and can be used.
|
||||
description:
|
||||
Test if the krb5.keytab on the machine is valid and can be used.
|
||||
|
||||
@@ -46,7 +46,7 @@ __all__ = ["gssapi", "version", "ipadiscovery", "api", "errors", "x509",
|
||||
"configure_nslcd_conf", "configure_ssh_config",
|
||||
"configure_sshd_config", "configure_automount",
|
||||
"configure_firefox", "sync_time", "check_ldap_conf",
|
||||
"sssd_enable_ifp"]
|
||||
"sssd_enable_ifp", "getargspec"]
|
||||
|
||||
import sys
|
||||
|
||||
@@ -110,10 +110,31 @@ else:
|
||||
# IPA version >= 4.4
|
||||
|
||||
# import sys
|
||||
import inspect
|
||||
import gssapi
|
||||
import logging
|
||||
|
||||
# Import getargspec from inspect or provide own getargspec for
|
||||
# Python 2 compatibility with Python 3.11+.
|
||||
try:
|
||||
from inspect import getargspec
|
||||
except ImportError:
|
||||
from collections import namedtuple
|
||||
from inspect import getfullargspec
|
||||
|
||||
# The code is copied from Python 3.10 inspect.py
|
||||
# Authors: Ka-Ping Yee <ping@lfw.org>
|
||||
# Yury Selivanov <yselivanov@sprymix.com>
|
||||
ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')
|
||||
|
||||
def getargspec(func):
|
||||
args, varargs, varkw, defaults, kwonlyargs, _kwonlydefaults, \
|
||||
ann = getfullargspec(func)
|
||||
if kwonlyargs or ann:
|
||||
raise ValueError(
|
||||
"Function has keyword-only parameters or annotations"
|
||||
", use inspect.signature() API which can support them")
|
||||
return ArgSpec(args, varargs, varkw, defaults)
|
||||
|
||||
from ipapython import version
|
||||
try:
|
||||
from ipaclient.install import ipadiscovery
|
||||
@@ -200,7 +221,7 @@ else:
|
||||
sys.path.remove(temp_dir)
|
||||
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(
|
||||
argspec = getargspec(
|
||||
ipa_client_install.configure_krb5_conf)
|
||||
if argspec.keywords is None:
|
||||
def configure_krb5_conf(
|
||||
@@ -240,7 +261,7 @@ else:
|
||||
create_ipa_nssdb = certdb.create_ipa_nssdb
|
||||
|
||||
argspec = \
|
||||
inspect.getargspec(ipa_client_install.configure_nisdomain)
|
||||
getargspec(ipa_client_install.configure_nisdomain)
|
||||
if len(argspec.args) == 3:
|
||||
configure_nisdomain = ipa_client_install.configure_nisdomain
|
||||
else:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_add_to_ipaservers
|
||||
short description: Add to ipaservers
|
||||
short_description: Add to ipaservers
|
||||
description:
|
||||
Add to ipaservers
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_create_ipa_conf
|
||||
short description: Create ipa.conf
|
||||
short_description: Create ipa.conf
|
||||
description:
|
||||
Create ipa.conf
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_custodia_import_dm_password
|
||||
short description: Import dm password into custodia
|
||||
short_description: Import dm password into custodia
|
||||
description:
|
||||
Import dm password into custodia
|
||||
options:
|
||||
@@ -96,13 +96,13 @@ RETURN = '''
|
||||
'''
|
||||
|
||||
import os
|
||||
import inspect
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_replica import (
|
||||
AnsibleModuleLog, setup_logging, installer, DN, paths,
|
||||
gen_env_boostrap_finalize_core, constants, api_bootstrap_finalize,
|
||||
gen_ReplicaConfig, gen_remote_api, redirect_stdout, custodiainstance
|
||||
gen_ReplicaConfig, gen_remote_api, redirect_stdout, custodiainstance,
|
||||
getargspec
|
||||
)
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ def main():
|
||||
ansible_log.debug("-- CUSTODIA IMPORT DM PASSWORD --")
|
||||
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(custodia.import_dm_password)
|
||||
argspec = getargspec(custodia.import_dm_password)
|
||||
# pylint: enable=deprecated-method
|
||||
if "master_host_name" in argspec.args:
|
||||
custodia.import_dm_password(config.master_host_name)
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_ds_apply_updates
|
||||
short description: DS apply updates
|
||||
short_description: DS apply updates
|
||||
description:
|
||||
DS apply updates
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_ds_enable_ssl
|
||||
short description: DS enable SSL
|
||||
short_description: DS enable SSL
|
||||
description:
|
||||
DS enable SSL
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_enable_ipa
|
||||
short description: Enable IPA
|
||||
short_description: Enable IPA
|
||||
description: Enable IPA
|
||||
Enable IPA
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_install_ca_cert
|
||||
short description: Install CA certs
|
||||
short_description: Install CA certs
|
||||
description:
|
||||
Install CA certs
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_krb_enable_ssl
|
||||
short description: KRB enable SSL
|
||||
short_description: KRB enable SSL
|
||||
description:
|
||||
KRB enable SSL
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_master_password
|
||||
short description: Generate kerberos master password if not given
|
||||
short_description: Generate kerberos master password if not given
|
||||
description:
|
||||
Generate kerberos master password if not given
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_prepare
|
||||
short description: Prepare ipa replica installation
|
||||
short_description: Prepare ipa replica installation
|
||||
description: |
|
||||
Prepare ipa replica installation: Create IPA configuration file, run install
|
||||
checks again and also update the host name and the hosts file if needed.
|
||||
@@ -182,6 +182,9 @@ options:
|
||||
skip_conncheck:
|
||||
description: Skip connection check to remote master
|
||||
required: yes
|
||||
sid_generation_always:
|
||||
description: Enable SID generation always
|
||||
required: yes
|
||||
author:
|
||||
- Thomas Woerner
|
||||
'''
|
||||
@@ -275,6 +278,8 @@ def main():
|
||||
# additional
|
||||
server=dict(required=True),
|
||||
skip_conncheck=dict(required=False, type='bool'),
|
||||
sid_generation_always=dict(required=False, type='bool',
|
||||
default=False),
|
||||
),
|
||||
supports_check_mode=True,
|
||||
)
|
||||
@@ -350,6 +355,13 @@ def main():
|
||||
# '_hostname_overridden')
|
||||
options.server = ansible_module.params.get('server')
|
||||
options.skip_conncheck = ansible_module.params.get('skip_conncheck')
|
||||
sid_generation_always = ansible_module.params.get('sid_generation_always')
|
||||
|
||||
# random serial numbers are master_only, therefore setting to False
|
||||
options.random_serial_numbers = False
|
||||
# options._random_serial_numbers is generated by ca.install_check and
|
||||
# later used by ca.install in the _setup_ca module.
|
||||
options._random_serial_numbers = False
|
||||
|
||||
# init #
|
||||
|
||||
@@ -755,7 +767,7 @@ def main():
|
||||
|
||||
ansible_log.debug("-- CHECK ADTRUST --")
|
||||
|
||||
if options.setup_adtrust:
|
||||
if options.setup_adtrust or sid_generation_always:
|
||||
adtrust.install_check(False, options, remote_api)
|
||||
|
||||
except errors.ACIError:
|
||||
@@ -838,6 +850,7 @@ def main():
|
||||
_http_ca_cert=http_ca_cert,
|
||||
_pkinit_pkcs12_info=pkinit_pkcs12_info,
|
||||
_pkinit_ca_cert=pkinit_ca_cert,
|
||||
_random_serial_numbers=options._random_serial_numbers,
|
||||
no_dnssec_validation=options.no_dnssec_validation,
|
||||
config_setup_ca=config.setup_ca,
|
||||
config_master_host_name=config.master_host_name,
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_promote_openldap_conf
|
||||
short description: Promote openldap.conf
|
||||
short_description: Promote openldap.conf
|
||||
description:
|
||||
Promote openldap.conf
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_promote_sssd
|
||||
short description: Promote sssd
|
||||
short_description: Promote sssd
|
||||
description:
|
||||
Promote sssd
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_restart_kdc
|
||||
short description: Restart KDC
|
||||
short_description: Restart KDC
|
||||
description:
|
||||
Restart KDC
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_setup_adtrust
|
||||
short description: Setup adtrust
|
||||
short_description: Setup adtrust
|
||||
description:
|
||||
Setup adtrust
|
||||
options:
|
||||
@@ -71,6 +71,9 @@ options:
|
||||
setup_ca:
|
||||
description: Configure a dogtag CA
|
||||
required: no
|
||||
setup_adtrust:
|
||||
description: Configure AD trust capability
|
||||
required: yes
|
||||
config_master_host_name:
|
||||
description: The config master_host_name setting
|
||||
required: no
|
||||
@@ -112,6 +115,7 @@ def main():
|
||||
ccache=dict(required=True),
|
||||
_top_dir=dict(required=True),
|
||||
setup_ca=dict(required=True, type='bool'),
|
||||
setup_adtrust=dict(required=True, type='bool'),
|
||||
config_master_host_name=dict(required=True),
|
||||
),
|
||||
supports_check_mode=True,
|
||||
@@ -140,6 +144,7 @@ def main():
|
||||
os.environ['KRB5CCNAME'] = ccache
|
||||
options._top_dir = ansible_module.params.get('_top_dir')
|
||||
options.setup_ca = ansible_module.params.get('setup_ca')
|
||||
options.setup_adtrust = ansible_module.params.get('setup_adtrust')
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
'config_master_host_name')
|
||||
adtrust.netbios_name = ansible_module.params.get('adtrust_netbios_name')
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_setup_ca
|
||||
short description: Setup CA
|
||||
short_description: Setup CA
|
||||
description:
|
||||
Setup CA
|
||||
options:
|
||||
@@ -85,6 +85,9 @@ options:
|
||||
_subject_base:
|
||||
description: The installer _subject_base setting
|
||||
required: no
|
||||
_random_serial_numbers:
|
||||
description: The installer _random_serial_numbers setting
|
||||
required: yes
|
||||
dirman_password:
|
||||
description: Directory Manager (master) password
|
||||
required: no
|
||||
@@ -144,6 +147,7 @@ def main():
|
||||
_top_dir=dict(required=True),
|
||||
_ca_subject=dict(required=True),
|
||||
_subject_base=dict(required=True),
|
||||
_random_serial_numbers=dict(required=True, type='bool'),
|
||||
dirman_password=dict(required=True, no_log=True),
|
||||
config_setup_ca=dict(required=True, type='bool'),
|
||||
config_master_host_name=dict(required=True),
|
||||
@@ -190,6 +194,8 @@ def main():
|
||||
options._subject_base = ansible_module.params.get('_subject_base')
|
||||
if options._subject_base is not None:
|
||||
options._subject_base = DN(options._subject_base)
|
||||
options._random_serial_numbers = ansible_module.params.get(
|
||||
'_random_serial_numbers')
|
||||
dirman_password = ansible_module.params.get('dirman_password')
|
||||
config_setup_ca = ansible_module.params.get('config_setup_ca')
|
||||
config_master_host_name = ansible_module.params.get(
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_setup_certmonger
|
||||
short description: Setup certmonger
|
||||
short_description: Setup certmonger
|
||||
description:
|
||||
Setup certmonger
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_setup_custodia
|
||||
short description: Setup custodia
|
||||
short_description: Setup custodia
|
||||
description:
|
||||
Setup custodia
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_setup_dns
|
||||
short description: Setup DNS
|
||||
short_description: Setup DNS
|
||||
description:
|
||||
Setup DNS
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_setup_ds
|
||||
short description: Setup DS
|
||||
short_description: Setup DS
|
||||
description:
|
||||
Setup DS
|
||||
options:
|
||||
@@ -149,7 +149,6 @@ RETURN = '''
|
||||
'''
|
||||
|
||||
import os
|
||||
import inspect
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_replica import (
|
||||
@@ -157,7 +156,8 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
ansible_module_get_parsed_ip_addresses,
|
||||
gen_env_boostrap_finalize_core, constants, api_bootstrap_finalize,
|
||||
gen_ReplicaConfig, gen_remote_api, redirect_stdout, ipaldap,
|
||||
install_replica_ds, install_dns_records, ntpinstance, ScriptError
|
||||
install_replica_ds, install_dns_records, ntpinstance, ScriptError,
|
||||
getargspec
|
||||
)
|
||||
|
||||
|
||||
@@ -317,7 +317,7 @@ def main():
|
||||
# Configure dirsrv
|
||||
with redirect_stdout(ansible_log):
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(install_replica_ds)
|
||||
argspec = getargspec(install_replica_ds)
|
||||
# pylint: enable=deprecated-method
|
||||
if "promote" in argspec.args:
|
||||
ds = install_replica_ds(config, options, ca_enabled,
|
||||
@@ -343,7 +343,7 @@ def main():
|
||||
# pylint: enable=deprecated-method
|
||||
# Always try to install DNS records
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(install_dns_records)
|
||||
argspec = getargspec(install_dns_records)
|
||||
# pylint: enable=deprecated-method
|
||||
if "fstore" not in argspec.args:
|
||||
install_dns_records(config, options, remote_api)
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_setup_http
|
||||
short description: Setup HTTP
|
||||
short_description: Setup HTTP
|
||||
description:
|
||||
Setup HTTP
|
||||
options:
|
||||
@@ -90,14 +90,13 @@ RETURN = '''
|
||||
'''
|
||||
|
||||
import os
|
||||
import inspect
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_replica import (
|
||||
AnsibleModuleLog, setup_logging, installer, DN, paths, sysrestore,
|
||||
gen_env_boostrap_finalize_core, constants, api_bootstrap_finalize,
|
||||
gen_ReplicaConfig, gen_remote_api, api, redirect_stdout, create_ipa_conf,
|
||||
install_http
|
||||
install_http, getargspec
|
||||
)
|
||||
|
||||
|
||||
@@ -203,7 +202,7 @@ def main():
|
||||
master=config.master_host_name)
|
||||
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(install_http)
|
||||
argspec = getargspec(install_http)
|
||||
# pylint: enable=deprecated-method
|
||||
if "promote" in argspec.args:
|
||||
install_http(
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_setup_kra
|
||||
short description: Setup KRA
|
||||
short_description: Setup KRA
|
||||
description:
|
||||
Setup KRA
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_setup_krb
|
||||
short description: Setup KRB
|
||||
short_description: Setup KRB
|
||||
description:
|
||||
Setup KRB
|
||||
options:
|
||||
@@ -78,13 +78,12 @@ RETURN = '''
|
||||
'''
|
||||
|
||||
import os
|
||||
import inspect
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_replica import (
|
||||
AnsibleModuleLog, setup_logging, installer, DN, paths, sysrestore,
|
||||
gen_env_boostrap_finalize_core, constants, api_bootstrap_finalize,
|
||||
gen_ReplicaConfig, api, redirect_stdout, install_krb
|
||||
gen_ReplicaConfig, api, redirect_stdout, install_krb, getargspec
|
||||
)
|
||||
|
||||
|
||||
@@ -162,7 +161,7 @@ def main():
|
||||
|
||||
with redirect_stdout(ansible_log):
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(install_krb)
|
||||
argspec = getargspec(install_krb)
|
||||
# pylint: enable=deprecated-method
|
||||
if "promote" in argspec.args:
|
||||
install_krb(
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_setup_otpd
|
||||
short description: Setup OTPD
|
||||
short_description: Setup OTPD
|
||||
description:
|
||||
Setup OTPD
|
||||
options:
|
||||
|
||||
@@ -34,7 +34,7 @@ ANSIBLE_METADATA = {
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: ipareplica_test
|
||||
short description: IPA replica deployment tests
|
||||
short_description: IPA replica deployment tests
|
||||
description: IPA replica deployment tests
|
||||
options:
|
||||
ip_addresses:
|
||||
@@ -136,7 +136,6 @@ RETURN = '''
|
||||
'''
|
||||
|
||||
import os
|
||||
import inspect
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ansible_ipa_replica import (
|
||||
@@ -144,7 +143,7 @@ from ansible.module_utils.ansible_ipa_replica import (
|
||||
ansible_module_get_parsed_ip_addresses, service,
|
||||
redirect_stdout, create_ipa_conf, ipautil,
|
||||
x509, validate_domain_name, common_check,
|
||||
IPA_PYTHON_VERSION
|
||||
IPA_PYTHON_VERSION, getargspec, adtrustinstance
|
||||
)
|
||||
|
||||
|
||||
@@ -271,6 +270,14 @@ def main():
|
||||
# # options.setup_adtrust = False
|
||||
# # ansible_module.warn(msg="adtrust is not supported, disabling")
|
||||
|
||||
sid_generation_always = False
|
||||
if not options.setup_adtrust:
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = getargspec(adtrustinstance.ADTRUSTInstance.__init__)
|
||||
# pylint: enable=deprecated-method
|
||||
if "fulltrust" in argspec.args:
|
||||
sid_generation_always = True
|
||||
|
||||
# if options.setup_kra and not kra_imported:
|
||||
# # if "kra" not in options._allow_missing:
|
||||
# ansible_module.fail_json(msg="kra can not be imported")
|
||||
@@ -287,7 +294,7 @@ def main():
|
||||
# create_ipa_conf has the additional master argument.
|
||||
change_master_for_certmonger = False
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(create_ipa_conf)
|
||||
argspec = getargspec(create_ipa_conf)
|
||||
# pylint: enable=deprecated-method
|
||||
if "master" in argspec.args:
|
||||
change_master_for_certmonger = True
|
||||
@@ -421,7 +428,7 @@ def main():
|
||||
try:
|
||||
with redirect_stdout(ansible_log):
|
||||
# pylint: disable=deprecated-method
|
||||
argspec = inspect.getargspec(common_check)
|
||||
argspec = getargspec(common_check)
|
||||
# pylint: enable=deprecated-method
|
||||
if "skip_mem_check" in argspec.args:
|
||||
common_check(options.no_ntp, options.skip_mem_check,
|
||||
@@ -472,6 +479,7 @@ def main():
|
||||
# additional
|
||||
client_enrolled=client_enrolled,
|
||||
change_master_for_certmonger=change_master_for_certmonger,
|
||||
sid_generation_always=sid_generation_always
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@ __all__ = ["contextlib", "dnsexception", "dnsresolver", "dnsreversename",
|
||||
"common_check", "current_domain_level",
|
||||
"check_domain_level_is_supported", "promotion_check_ipa_domain",
|
||||
"SSSDConfig", "CalledProcessError", "timeconf", "ntpinstance",
|
||||
"dnsname", "kernel_keyring", "krbinstance"]
|
||||
"dnsname", "kernel_keyring", "krbinstance", "getargspec",
|
||||
"adtrustinstance"]
|
||||
|
||||
import sys
|
||||
|
||||
@@ -59,6 +60,28 @@ else:
|
||||
import logging
|
||||
from contextlib import contextmanager as contextlib_contextmanager
|
||||
|
||||
# Import getargspec from inspect or provide own getargspec for
|
||||
# Python 2 compatibility with Python 3.11+.
|
||||
try:
|
||||
from inspect import getargspec
|
||||
except ImportError:
|
||||
from collections import namedtuple
|
||||
from inspect import getfullargspec
|
||||
|
||||
# The code is copied from Python 3.10 inspect.py
|
||||
# Authors: Ka-Ping Yee <ping@lfw.org>
|
||||
# Yury Selivanov <yselivanov@sprymix.com>
|
||||
ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')
|
||||
|
||||
def getargspec(func):
|
||||
args, varargs, varkw, defaults, kwonlyargs, _kwonlydefaults, \
|
||||
ann = getfullargspec(func)
|
||||
if kwonlyargs or ann:
|
||||
raise ValueError(
|
||||
"Function has keyword-only parameters or annotations"
|
||||
", use inspect.signature() API which can support them")
|
||||
return ArgSpec(args, varargs, varkw, defaults)
|
||||
|
||||
from ipapython.version import NUM_VERSION, VERSION
|
||||
|
||||
if NUM_VERSION < 30201:
|
||||
@@ -105,6 +128,7 @@ else:
|
||||
adtrust, bindinstance, ca, certs, dns, dsinstance, httpinstance,
|
||||
installutils, kra, krbinstance,
|
||||
otpdinstance, custodiainstance, service, upgradeinstance)
|
||||
from ipaserver.install import adtrustinstance
|
||||
try:
|
||||
from ipaserver.masters import (
|
||||
find_providing_servers, find_providing_server)
|
||||
@@ -198,6 +222,10 @@ else:
|
||||
def info(self, msg):
|
||||
self.module.debug(msg)
|
||||
|
||||
@staticmethod
|
||||
def isatty():
|
||||
return False
|
||||
|
||||
def write(self, msg):
|
||||
self.module.debug(msg)
|
||||
# self.module.warn(msg)
|
||||
|
||||
@@ -116,8 +116,6 @@
|
||||
ipaclient_realm: "{{ result_ipareplica_test.realm | default(omit) }}"
|
||||
ipaclient_servers: "{{ ipareplica_servers | default(omit) }}"
|
||||
ipaclient_hostname: "{{ result_ipareplica_test.hostname }}"
|
||||
ipaclient_no_ntp: "{{ result_ipareplica_test.ipa_python_version
|
||||
< 40690 }}"
|
||||
ipaclient_install_packages: "{{ ipareplica_install_packages }}"
|
||||
when: not result_ipareplica_test.client_enrolled
|
||||
|
||||
@@ -201,6 +199,7 @@
|
||||
### additional ###
|
||||
server: "{{ result_ipareplica_test.server }}"
|
||||
skip_conncheck: "{{ ipareplica_skip_conncheck }}"
|
||||
sid_generation_always: "{{ result_ipareplica_test.sid_generation_always }}"
|
||||
register: result_ipareplica_prepare
|
||||
|
||||
- name: Install - Add to ipaservers
|
||||
@@ -557,6 +556,7 @@
|
||||
_subject_base: "{{ result_ipareplica_prepare._subject_base }}"
|
||||
_pkinit_pkcs12_info: "{{ result_ipareplica_prepare._pkinit_pkcs12_info if result_ipareplica_prepare._pkinit_pkcs12_info != None else omit }}"
|
||||
_top_dir: "{{ result_ipareplica_prepare._top_dir }}"
|
||||
_random_serial_numbers: "{{ result_ipareplica_prepare._random_serial_numbers }}"
|
||||
dirman_password: "{{ ipareplica_dirman_password }}"
|
||||
config_setup_ca: "{{ result_ipareplica_prepare.config_setup_ca }}"
|
||||
config_master_host_name:
|
||||
@@ -748,13 +748,15 @@
|
||||
ccache: "{{ result_ipareplica_prepare.ccache }}"
|
||||
_top_dir: "{{ result_ipareplica_prepare._top_dir }}"
|
||||
setup_ca: "{{ result_ipareplica_prepare.config_setup_ca }}"
|
||||
setup_adtrust: "{{ result_ipareplica_test.setup_adtrust }}"
|
||||
config_master_host_name:
|
||||
"{{ result_ipareplica_prepare.config_master_host_name }}"
|
||||
adtrust_netbios_name:
|
||||
"{{ result_ipareplica_prepare.adtrust_netbios_name }}"
|
||||
adtrust_reset_netbios_name:
|
||||
"{{ result_ipareplica_prepare.adtrust_reset_netbios_name }}"
|
||||
when: result_ipareplica_test.setup_adtrust
|
||||
when: result_ipareplica_test.setup_adtrust or
|
||||
result_ipareplica_test.sid_generation_always
|
||||
|
||||
- name: Install - Enable IPA
|
||||
ipareplica_enable_ipa:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user