Skip to content
Snippets Groups Projects
Commit c7e83685 authored by Thomas Woerner's avatar Thomas Woerner
Browse files

ipareplica 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
parent 882d6051
No related branches found
No related tags found
No related merge requests found
......@@ -4,24 +4,24 @@
- block:
- name: Install - Ensure IPA replica packages are installed
package:
ansible.builtin.package:
name: "{{ ipareplica_packages }}"
state: present
- name: Install - Ensure IPA replica packages for dns are installed
package:
ansible.builtin.package:
name: "{{ ipareplica_packages_dns }}"
state: present
when: ipareplica_setup_dns | bool
- name: Install - Ensure IPA replica packages for adtrust are installed
package:
ansible.builtin.package:
name: "{{ ipareplica_packages_adtrust }}"
state: present
when: ipareplica_setup_adtrust | bool
- name: Install - Ensure that firewall packages installed
package:
ansible.builtin.package:
name: "{{ ipareplica_packages_firewalld }}"
state: present
when: ipareplica_setup_firewalld | bool
......@@ -30,20 +30,20 @@
- block:
- name: Firewalld service - Ensure that firewalld is running
systemd:
ansible.builtin.systemd:
name: firewalld
enabled: yes
state: started
- name: Firewalld - Verify runtime zone "{{ ipareplica_firewalld_zone }}"
shell: >
ansible.builtin.shell: >
firewall-cmd
--info-zone="{{ ipareplica_firewalld_zone }}"
>/dev/null
when: ipareplica_firewalld_zone is defined
- name: Firewalld - Verify permanent zone "{{ ipareplica_firewalld_zone }}"
shell: >
ansible.builtin.shell: >
firewall-cmd
--permanent
--info-zone="{{ ipareplica_firewalld_zone }}"
......@@ -53,12 +53,12 @@
when: ipareplica_setup_firewalld | bool
- name: Install - Set ipareplica_servers
set_fact:
ansible.builtin.set_fact:
ipareplica_servers: "{{ groups['ipaservers'] | list }}"
when: groups.ipaservers is defined and ipareplica_servers is not defined
- name: Install - Set default principal if no keytab is given
set_fact:
ansible.builtin.set_fact:
ipaadmin_principal: admin
when: ipaadmin_principal is undefined and ipaclient_keytab is undefined
......@@ -108,7 +108,7 @@
# result_ipareplica_test.server_already_configured is defined)
- name: Install - Setup client
include_role:
ansible.builtin.include_role:
name: ipaclient
vars:
state: present
......@@ -120,7 +120,7 @@
when: not result_ipareplica_test.client_enrolled
- name: Install - Configure firewalld
command: >
ansible.builtin.command: >
firewall-cmd
--permanent
--zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is
......@@ -134,7 +134,7 @@
when: ipareplica_setup_firewalld | bool
- name: Install - Configure firewalld runtime
command: >
ansible.builtin.command: >
firewall-cmd
--zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is
defined else '' }}"
......@@ -222,7 +222,7 @@
- name: Install - Set dirman password
no_log: yes
set_fact:
ansible.builtin.set_fact:
ipareplica_dirman_password:
"{{ result_ipareplica_master_password.password }}"
......@@ -776,14 +776,14 @@
register: result_ipareplica_enable_ipa
- name: Install - Cleanup root IPA cache
file:
ansible.builtin.file:
path: "/root/.ipa_cache"
state: absent
when: result_ipareplica_enable_ipa.changed
always:
- name: Cleanup temporary files
file:
ansible.builtin.file:
path: "{{ item }}"
state: absent
with_items:
......
......@@ -2,7 +2,7 @@
# tasks file for ipareplica
- name: Import variables specific to distribution
include_vars: "{{ item }}"
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml"
- "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
......@@ -17,9 +17,9 @@
- "vars/default.yml"
- name: Install IPA replica
include_tasks: install.yml
ansible.builtin.include_tasks: install.yml
when: state|default('present') == 'present'
- name: Uninstall IPA replica
include_tasks: uninstall.yml
ansible.builtin.include_tasks: uninstall.yml
when: state|default('present') == 'absent'
......@@ -2,7 +2,7 @@
# tasks to uninstall IPA replica
- name: Uninstall - Uninstall IPA replica
command: >
ansible.builtin.command: >
/usr/sbin/ipa-server-install
--uninstall
-U
......@@ -22,7 +22,7 @@
delay: 1
#- name: Uninstall - Remove all replication agreements and data about replica
# command: >
# ansible.builtin.command: >
# /usr/sbin/ipa-replica-manage
# del
# {{ ipareplica_hostname | default(ansible_facts['fqdn']) }}
......@@ -32,6 +32,6 @@
# delegate_to: "{{ groups.ipaserver[0] | default(fail) }}"
#- name: Remove IPA replica packages
# package:
# ansible.builtin.package:
# name: "{{ ipareplica_packages }}"
# state: absent
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment