Commit Graph

14 Commits

Author SHA1 Message Date
Rafael Guterres Jeffman
91c4b83311 Configure yamllint to be compatible with ansible-lint
Current version of ansible-list pre-commit hook required changes in the
ansible-freeipa yamllint configuration and these changes triggered
issues in the current playbooks on roles and tests.

This patch adds the required changes to yaml lint configuration and
fixes the affected playbooks.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
2025-01-31 11:32:59 -03:00
Thomas Woerner
dde5b06b97 ipaclient role: Use FQCN for ansible.builtin
Use Fully Qualified Collection Name (FQCN) for ansible builtins. This is
ansible.builtin.set_fact instead of set_fact for example and aplies for
all actions that are part of ansible.builtin.

All the replaced ansible.builtins:
  assert, command, copy, debug, fail, fetch, file, import_playbook,
  import_tasks, include_role, include_tasks, include_vars, package,
  set_fact, shell, slurp, stat, systemd
2022-12-20 13:37:07 +01:00
Thomas Woerner
1c17f426ac ipaclient: Configure DNS resolver
The configuration of the DNS resolver is useful if the IPA server has
internal DNS support.

The installation of packages is happening before the DNS resolver is
configured, therefore package installation needs to be possible without
the configuration of the DNS resolver.

The DNS nameservers are configured for `NetworkManager`, `systemd-resolved`
(if installed and enabled) and `/etc/resolv.conf` if neither NetworkManager
nor systemd-resolved is used.

Example inventory:

  [ipaserver]
  ipaserver.example.com

  [ipaclients]
  ipaclient1.example.com

  [ipaclients:vars]
  ipaadmin_principal=admin
  ipaadmin_password=MySecretPassword123
  ipaclient_domain=example.com
  ipaclient_configure_dns_resolver=yes
  ipaclient_dns_servers=192.168.100.1
  ipaclient_cleanup_dns_resolver=yes

New parameters:

ipaclient_configure_dns_resolver
  The bool value defines if the DNS resolver is configured. before deploying
  the client. This is useful if the IPA server has internal DNS support.
  ipaclient_dns_server need to be set also.
ipaclient_dns_servers
  The list of DNS server IP addresses. This is only useful with
  ipaclient_configure_dns_resolver.
ipaclient_cleanup_dns_resolver
  The bool value defines if DNS resolvers that have been configured before
  with ipaclient_configure_dns_resolver will be cleaned up again.

New module:

roles/ipaclient/library/ipaclient_configure_dns_resolver.py

Fixes: #902 (Consider adding support for client DNS resolver
             configuration)
2022-11-23 11:40:47 +01:00
Thomas Woerner
cf4c590303 ipa[server,replica,client]: Drop deactivated Python2/3 test
These tests have been deactivated for some time with b51397e and are
removed now.
2020-09-08 14:44:39 +02:00
David Sastre Medina
20e5338ad5 Fixes #17 Improve how tasks manage package installation
The use of squash_actions to invoke a package module, such as “yum”, to
only invoke the module once is deprecated, and will be removed in
Ansible 2.11.
Instead of relying on implicit squashing, tasks should instead supply
the list directly to the name, pkg or package parameter of the module.

See [1] for a reference to the upstream documentation.

The ipa-krb5 and ipa-sssd modules include *_packages variables in both
defaults/ and vars/, additionally, the list of packages in ipa-sssd differs
from one to the other.
Unify list of packages into vars/

[1]: https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.7.html#using-a-loop-on-a-package-module-via-squash-actions
2019-06-04 12:42:19 +02:00
Thomas Woerner
65fb75feaf ipaclient: Calm down ansible and yaml lint in ansible-galaxy 2019-05-03 18:37:22 +02:00
Thomas Woerner
12006859d9 Fix white space issues in yaml files and ansible vars 2019-05-03 17:36:52 +02:00
Thomas Woerner
20d25d0d43 Replace deprecated include with import_tasks and include_tasks
As the old way to include tasks is deprecated, replace static include
statements with import_tasks and dynamic ones with include_tasks.

Increaded the required ansible version to 2.5.0 to make sure that
include_tasks and import_tasks is working as expected.

Fixes issue #38
2018-11-22 16:26:58 +01:00
Thomas Woerner
bb603fbd9f roles/ipaclient/tasks/uninstall.yml: No need to use python3 test for uninstall 2017-11-09 13:19:58 +01:00
Thomas Woerner
7b51df6c33 roles/ipaclient/tasks/[un]install.yml: Use better formatting for commands 2017-11-09 13:19:08 +01:00
Florence Blanc-Renaud
a0b8bd39e0 Simplify ipaclient uninstall
Currently ipaclient role is using the module ipaclient only for uninstallation,
and this module contains a lot of unused code.
It is simpler to directly call the command-line
   ipa-client-install --uninstall -U
and remove the ipaclient module.
2017-10-12 09:47:03 +02:00
Thomas Woerner
63fd53eb77 Use Python2/3 to detect ansible_python_interpreter
With the test it is not needed to pin down the python interpreter for ansible
modules. It is therefore possible to use a Python2 version on Fedora-27 and
a Python3 version on Fedora-26.
2017-10-10 17:20:59 +02:00
Thomas Woerner
990da8341f ipaclient vars: Renamed ipaclient_package to ipaclient_packages
The rename was needed to be able to have more than one package in the list
of required packages.

For RHEL-7.3 it has been needed to add ipa-admintools to have /usr/bin/ipa
available. libselinux-python has been added for all.
2017-10-04 17:22:40 +02:00
Florence Blanc-Renaud
09f45e4acd Ansible for IPA 2017-07-03 09:55:23 +02:00