Commit Graph

2654 Commits

Author SHA1 Message Date
Thomas Woerner
4e16126b29 iparole: Add sysaccount member support
sysaccounts can now be used as a member for roles.

Example:

  - name: Ensure role my-app role has sysaccount member my-app
    iparole:
      name: my-app role
      sysaccount: my-app
      action: member

New tests for the module:

    tests/role/test_role_sysaccount_member.yml
2026-01-05 18:22:37 +01:00
Thomas Woerner
dc9b0ce4e8 New sysaccount management module
There is a new sysaccount management module placed in the plugins folder:

    plugins/modules/ipasysaccount.py

The sysaccount module allows to ensure presence or absence of system
accounts.

Here is the documentation for the module:

    README-sysaccount.md

New sysaccount example playbooks:

    playbooks/sysaccount/sysaccount-absent.yml
    playbooks/sysaccount/sysaccount-disabled.yml
    playbooks/sysaccount/sysaccount-enabled.yml
    playbooks/sysaccount/sysaccount-present.yml
    playbooks/sysaccount/sysaccount-privileged.yml
    playbooks/sysaccount/sysaccount-unprivileged.yml

New tests for the module:

    tests/sysaccount/test_sysaccount.yml
    tests/sysaccount/test_sysaccount_client_context.yml
2026-01-05 16:36:26 +01:00
Thomas Woerner
aa3bf1f015 Merge pull request #1406 from rjeffman/fix_checkpr_version_name
upstream ci: Use version_name for CheckPR labels
2026-01-05 16:35:23 +01:00
Rafael Guterres Jeffman
f0aa531b28 upstream ci: Use version_name for CheckPR labels
As the ansible_version variable may contain a version specification, we
need a version_name to correctly report the job label in Azure.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2026-01-05 12:01:15 -03:00
Thomas Woerner
6407fd8b2e Merge pull request #1404 from rjeffman/fix_pipeline_names
upstream ci: Fix Azure pipelines invalid names
2025-11-27 10:43:01 +01:00
Rafael Guterres Jeffman
2a1be13d3e upstream ci: Fix Azure pipelines invalid names
Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-11-24 13:25:26 -03:00
Thomas Woerner
2afca1fa5e Merge pull request #1403 from rjeffman/checkpr_ansible_version
upstream CI: Fix CheckPR ansible-core version definition
2025-11-24 11:23:44 +01:00
Thomas Woerner
2a40e42b0c Merge pull request #1402 from rjeffman/fix_nightlies
upstream CI: Fix nightly and azure-pipelines to use version map
2025-11-24 11:23:11 +01:00
Rafael Guterres Jeffman
8a33941188 upstream CI: Fix CheckPR ansible-core version definition
By using the 'ansible-version' variable as '<2.17' allows 'pip' to
install the latest version of the 2.16 series, instead of version 2.16.0
in the case '==2.16'. This ensures we run the tests with the latest
supported version for the specific distro.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-11-21 09:33:47 -03:00
Rafael Guterres Jeffman
0aef995bbe upstream CI: Fix Azure nightly pipelines to use version map
Modify nigtly pipelines to use the same distro-to-Ansible version map
so that the Ansible version matches the required version for the
specific distro. Nightly pipelines are the same used for Weekly tests.

This was required due to recent updates for Python 3.14 and Ansible
upstream versions.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-11-21 09:25:08 -03:00
Thomas Woerner
ed44344519 Merge pull request #1380 from rjeffman/python_requirements
Fixes several linter issues for recent tool versions.
2025-11-11 13:04:51 +01:00
Rafael Guterres Jeffman
b186a1f28f upstream CI: Update Ansible version for c9s
Although the available ansible-core package version for c9s is 2.14, the
upstream "pip" version of this package has a broken certificate and is
unusable against Galaxy.

This patch fixes the version to 2.16, as it is the same version for c8s
and c10s, and the oldest one available as packages for the CentOS
Streams.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-11-10 15:48:26 -03:00
Rafael Guterres Jeffman
d307635c38 pytest: update to work with recent Python
With Python 3.14, the required pytest version stopped working due to
breaking changes in AST.

This patch changes the test tool versions to the most recent one, by
requiring only the minimal version, but not setting a specific one.
Recent pytest version also requires that the search path for Python
modules is defined.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-11-10 15:39:00 -03:00
Thomas Woerner
74f3817531 Merge pull request #1377 from rjeffman/ansible_2_18
Update Ansible version in Upstream CI
2025-11-10 15:39:41 +01:00
Rafael Guterres Jeffman
97378c38cf pylint: Add list of upper case constants to setup.cfg
Pylint 4.0.1 seems to not understand that some of the constants used by
ansible-freeipa roles and modules are constants and not variables, and
complain about the naming style.

By adding these constant names to the "good-names" list avoid pylint
errors and don't require future unnecessary changes.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-11-10 11:38:52 -03:00
Rafael Guterres Jeffman
6f15cd093a ansible-lint: Fix Jinja error
A task in 'roles/ipaclient/tasks/install.yml' uses logic that
ansible-lint and jinja are unable to evaluate due to missing type. By
refactoring the task the tools are able to evaluate the task.
2025-11-10 11:38:52 -03:00
Rafael Guterres Jeffman
52f7f7848e ansible-lint: Fix deprecation warning with bool and omit
The application of the 'bool' filter to an OmitType value is deprecated
and will be removed on ansible-core 2.23.
2025-11-10 11:38:52 -03:00
Rafael Guterres Jeffman
fdd45cc475 pylint: Fix pylint 3.3.8 issues
With the latest pylint version, an issue is raised by inheriting from
BaseInventoryPlugin, as the class has too many ancestors
(too-many-ancestors). This is caused by a class hierarchy that is too
deep, and is not under ansible-freeipa's control.
2025-11-10 11:38:52 -03:00
Rafael Guterres Jeffman
a1cad32a46 requirements.txt: Add setuptools
In recent Python setups, 'setuptools' may not be readily available, and,
as we depend on it, it should be a requirement.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-11-10 11:38:52 -03:00
Thomas Woerner
7036fa3e1b Merge pull request #1392 from rjeffman/fix_cert_msg_change
ipacert: Fix tests for inexistent certificate
2025-11-10 15:20:07 +01:00
Rafael Guterres Jeffman
95d935f185 ansible-docs: Update versions for ansible-doc-test checks
Older versions of ansible-doc-test are failing due to code errors in the
parsing module. This is fixed by using newer versions.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-11-07 14:32:35 -03:00
Rafael Guterres Jeffman
dd3bc4fcdd linter: Pin Python version for ansible-lint
ansible-lint is complaining that Python 3.14 requries ansible-core 2.20,
even if other versions work on that Python version.

Woraround implemented is to pin the ansible-lint Python version to 3.13.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-11-07 14:28:33 -03:00
Rafael Guterres Jeffman
c405229553 ipacert: Fix tests for inexistent certificate
After a PKI update the message returned for 'cert_show' in the case of
an inexistent certificate has changed, causing tests to fail.

The fix is only required for the tests, as the behavior has not changed.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-10-21 15:27:31 -03:00
Rafael Guterres Jeffman
3fa3bf0822 ci: Update ansible-core to 2.18 in CI
The ansible-core version used in the CI pipelines has been updated
from 2.16 to 2.18 to keep the testing environment current.

Additionally, the pull request pipeline has been enhanced to test
against the specific ansible-core versions that are packaged with the
latest stable distributions. This will help ensure that the roles remain
compatible with the versions users are likely to have installed.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-10-17 16:11:49 -03:00
Rafael Guterres Jeffman
7cef44c01d Merge pull request #1387 from t-woerner/Add_capability_sys_admin_to_fix_dbus_broker_in_systemd_258
Add capability sys admin to fix dbus broker in systemd 258
2025-09-18 09:56:15 -03:00
Thomas Woerner
cd7d19bfeb Dockerfiles c8s,c9s,fedora-latest and fedora-rawhide: Install hostname
The hostname command is needed to be able to execute fixnet.service. It
has been missing from some docker files and therefore the script failed
in the -base images. The server images have not been affected as
ipa-client has a requirement for hostname.
2025-09-18 14:54:40 +02:00
Thomas Woerner
0e748d372a infra/image/shdefaults: Add capability SYS_ADMIN for systemd 258
Fedora 43 and 44 switched to systemd 258 rc4. The dbus-broker service
of systemd 258 does not start any more without enabling the capability
SYS_ADMIN.

The capabilities AUDIT_WRITE, SETUID and SETGID should be enough, but
they are not sufficient to be able to start the service.

With final systemd 258 it should be tested if the capability can be
removed again.
2025-09-18 14:54:18 +02:00
Rafael Guterres Jeffman
e24340447d Merge pull request #1379 from t-woerner/backup_test_ansible_2_19_v2
test_backup.yml: Fix evaluation of 'list = False' and 'list = True' v2
2025-08-15 16:29:20 -03:00
Thomas Woerner
092ad81d03 test_backup.yml: Fix evaluation of 'list = False' and 'list = True' v2
ansible-core 2.19 is not automatically converting empty and non empty lists
to bool values. Conditionals must have a boolean result.

The solution is to evaluate the length of the lists instead.
2025-08-15 12:19:21 +02:00
Rafael Guterres Jeffman
4d22e917df Merge pull request #1376 from t-woerner/backup_test_ansible_2_19
test_backup.yml: Fix evaluation of 'list = False' and 'list = True'
2025-08-13 09:54:35 -03:00
Thomas Woerner
a04a357b6a test_backup.yml: Fix evaluation of 'list = False' and 'list = True'
ansible-core 2.19 is not automatically converting empty and non empty lists
to bool values. Conditionals must have a boolean result.

The solution is to evaluate the length of the lists instead.
2025-08-13 14:17:32 +02:00
Thomas Woerner
2081a1a8dd Merge pull request #1369 from rjeffman/prepare_ansible_2_19
Prepare playbooks for ansible core 2.19
2025-08-12 14:30:47 +02:00
Rafael Guterres Jeffman
d1dfdc38c9 tests service: Fixes evaluation of 'Keytab = True'
In ansible-core 2.19 there's no automatic coercion from None or empty
strings to the boolean value "false", so we need to compare the result
of the filter 'regex_search' to 'None' and the empty string to evaluate
if any match occurred.

In fixing this issue, it was found that the tests were incorrectly
evaluating the results, and the comparisons were fixed.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-08-12 08:25:17 -03:00
Varun Mylaraiah
9fc1b043c1 Merge pull request #1375 from t-woerner/ipaclient_client_dns_new_arg_statestore
ipaclient: client_dns has new statestore arg with IPA change e6445b8
v1.15.1
2025-07-31 18:24:22 +05:30
Thomas Woerner
bdf1efde80 ipaclient: client_dns has new statestore arg with IPA change e6445b8
The new argument was introduced with the IPA change e6445b8 to disable
the previous Unbound configuration before setting up new configuration
for DNS over TLS.

Related: https://pagure.io/freeipa/issue/9814
2025-07-31 11:12:52 +02:00
Varun Mylaraiah
513d5ee46b Merge pull request #1371 from t-woerner/dns_over_tls
ipaserver, ipareplica and ipaclient roles: Add DNS over TLS support
v1.15.0
2025-07-21 21:27:58 +05:30
Thomas Woerner
cd440a2049 ipareplica: Add support for DNS over TLS
This change adds support for DNS over TLS to the ipareplica role.

New variables

ipareplica_dot_forwarders
    List of DNS over TLS forwarders. Required if ipareplica_dns_over_tls
    is enabled. (list of strings)
    required: false
ipareplica_dns_over_tls | ipaclient_dns_over_tls
    Configure DNS over TLS. Requires FreeIPA version 4.12.5 or later.
    (bool, default: false)
    required: false
ipareplica_dns_over_tls_cert
    Certificate to use for DNS over TLS. If empty, a new certificate will
    be requested from IPA CA. (string)
    required: false
ipareplica_dns_over_tls_key
    Key for certificate specified in ipareplica_dns_over_tls_cert. (string)
    required: false
ipareplica_dns_policy
    Encrypted DNS policy. Only usable if `ipareplica_dns_over_tls` is
    enabled. (choice: relaxed, enforced, default: relaxed)
    required: false

New distribution specific variable

ipareplica_packages_dot
    List of IPA packages needed for DNS over TLS.
2025-07-21 13:38:36 +02:00
Thomas Woerner
e2317f304c ipaserver: Add support for DNS over TLS
This change adds support for DNS over TLS to the ipaserver role.

New variables

ipaserver_dot_forwarders
    List of DNS over TLS forwarders. Required if ipaserver_dns_over_tls
    is enabled. (list of strings)
    required: false
ipaserver_dns_over_tls | ipaclient_dns_over_tls
    Configure DNS over TLS. Requires FreeIPA version 4.12.5 or later.
    (bool, default: false)
    required: false
ipaserver_dns_over_tls_cert
    Certificate to use for DNS over TLS. If empty, a new certificate will
    be requested from IPA CA. (string)
    required: false
ipaserver_dns_over_tls_key
    Key for certificate specified in ipaserver_dns_over_tls_cert. (string)
    required: false
ipaserver_dns_policy
    Encrypted DNS policy. Only usable if `ipaserver_dns_over_tls` is
    enabled. (choice: relaxed, enforced, default: relaxed)
    required: false

New distribution specific variable

ipaserver_packages_dot
    List of IPA packages needed for DNS over TLS.
2025-07-21 13:37:50 +02:00
Thomas Woerner
7a23c668fc ipaclient: Add support for DNS over TLS
This change adds support for DNS over TLS to the ipaclient role.

New variables

ipaclient_dns_over_tls
    Configure DNS over TLS. Requires FreeIPA version 4.12.5 or later.
    (bool, default: false)
    required: false
ipaclient_no_dnssec_validation
    Disable DNSSEC validation for DNS over TLS. This turns off DNSSEC
    validation for unbound. Only usable if `ipaserver_dns_over_tls` is
    enabled. (bool, default: false)
    reqiured: false

New distribution specific variable

ipaclient_packages_dot
    List of IPA packages needed for DNS over TLS.

The resolver configuratoin for DNS over TLS is not part of this change
and will be added later on. Therefore it is needed to configure the
resolver for DNS over TLS before starting the deployment with ipaclient
role. This is essential for using an IPA DNS server with DoT and enforced
DNS policy so that only DoT is usable.
2025-07-21 11:00:50 +02:00
Thomas Woerner
91d818b334 Merge pull request #1329 from Nihlus/fix-stdout-caching
Cache sys.stdout instead of assuming it is equal to sys.__stdout__
2025-07-14 15:52:36 +02:00
Jarl Gullberg
902d8b7238 Cache sys.stdout instead of assuming it is equal to sys.__stdout__
When running under Mitogen, ipa_server and ipa_replica breaks execution
by overwriting sys.stdout with sys.stdout.

With Mitogen, sys.stdout != sys.stdout at this point in the code, and
changing it in this manner results in access to closed file descriptors
for future invocations. Generally, it is recommended not to use
sys.stdout and instead explicitly cache the current value of sys.stdout.
2025-07-04 18:39:46 +02:00
Rafael Guterres Jeffman
d553f9a0b1 Merge pull request #1360 from t-woerner/drop_misspelled_ipassd_compat_vars
ipaclient: Drop misspelled ipassd_ compat vars
2025-07-03 09:41:20 -03:00
Thomas Woerner
9cfe835b03 Merge pull request #1367 from rjeffman/rhel_79820
ipaidrange: Require usage of range id parameters
2025-07-03 14:39:49 +02:00
Rafael Guterres Jeffman
668830fc94 ansible-core 2.19: 'upper' and 'lower' make lists into strings
As ansible-core 2.19 'upper' and 'lower' filters make lists into strings
and these strings are not interpreted as lists when running the plugins,
it is needed to use 'map(<filter>)' to apply the filter to all entries
of a list.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-06-14 11:45:30 -03:00
Rafael Guterres Jeffman
5ae39ec9de ansible-core 2.19: Templates and expressions must use trusted sources
In ansible-core, templates and expressions must use trusted sources,
such as playbooks or roles, and module results are considered untrusted
sources.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-06-14 11:45:26 -03:00
Rafael Guterres Jeffman
3f59332d99 ansible-core 2.19: when clause don't automatically convert to bool
In ansible-core 2.19, when clauses (when, failed_when, etc) do not
convert values to bool automatically, also, templating with "|bool" does
not work too, so an actual value comparison is required.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-06-14 11:45:21 -03:00
Rafael Guterres Jeffman
30c405cb36 Merge pull request #1364 from t-woerner/infra_image_service_refinement
infra/image: Make fixnet and fixipaip services active by default
2025-06-04 16:04:19 -03:00
Rafael Guterres Jeffman
7275bbf6a3 Merge pull request #1365 from t-woerner/infra_image_start_hosts_safer_removal
infra/image/shcontainer: Safer host removal from /etc/hosts
2025-06-04 15:52:02 -03:00
Rafael Guterres Jeffman
6df89ad7db ipaidrange: Require usage of range id parameters
When adding a new idrange of type 'ipa-local', the 'base_id',
'range_size', 'rid_base' and 'secondary_rid_base' are required so that
range entries are correctly set when SID are enabled.

Fixes: https://issues.redhat.com/browse/RHEL-79820

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-06-03 21:46:15 -03:00
Thomas Woerner
c5fa54f2cf infra/image: Make fixnet and fixipaip services active by default
The services are now active by default and do not need to be activated
after IPA has been deployed.

The fixnet service is always activated and removes all lines containing
the hostname from /etc/hosts and adds a new line with the IP and the
hostname with and without domain. If IPA is deployed with DNS (the
config file /etc/named.conf exists and there is a '^dyndb "ipa"' line
in /etc/named.conf) then /etc/resolv.conf is also changed to use the
local DNS server.

The fixipaip service is now also always activated, but only started IF
IPA has been deployed and the ipa service was started before.

infra/image/build.sh is not actvating the services anymore, the services
are now actiavted in alll dockerfiles.
2025-05-30 15:59:11 +02:00