mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-25 00:44:42 +00:00
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
This commit is contained in:
@@ -4,24 +4,24 @@
|
|||||||
- block:
|
- block:
|
||||||
|
|
||||||
- name: Install - Ensure IPA replica packages are installed
|
- name: Install - Ensure IPA replica packages are installed
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: "{{ ipareplica_packages }}"
|
name: "{{ ipareplica_packages }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Install - Ensure IPA replica packages for dns are installed
|
- name: Install - Ensure IPA replica packages for dns are installed
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: "{{ ipareplica_packages_dns }}"
|
name: "{{ ipareplica_packages_dns }}"
|
||||||
state: present
|
state: present
|
||||||
when: ipareplica_setup_dns | bool
|
when: ipareplica_setup_dns | bool
|
||||||
|
|
||||||
- name: Install - Ensure IPA replica packages for adtrust are installed
|
- name: Install - Ensure IPA replica packages for adtrust are installed
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: "{{ ipareplica_packages_adtrust }}"
|
name: "{{ ipareplica_packages_adtrust }}"
|
||||||
state: present
|
state: present
|
||||||
when: ipareplica_setup_adtrust | bool
|
when: ipareplica_setup_adtrust | bool
|
||||||
|
|
||||||
- name: Install - Ensure that firewall packages installed
|
- name: Install - Ensure that firewall packages installed
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: "{{ ipareplica_packages_firewalld }}"
|
name: "{{ ipareplica_packages_firewalld }}"
|
||||||
state: present
|
state: present
|
||||||
when: ipareplica_setup_firewalld | bool
|
when: ipareplica_setup_firewalld | bool
|
||||||
@@ -30,20 +30,20 @@
|
|||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Firewalld service - Ensure that firewalld is running
|
- name: Firewalld service - Ensure that firewalld is running
|
||||||
systemd:
|
ansible.builtin.systemd:
|
||||||
name: firewalld
|
name: firewalld
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
- name: Firewalld - Verify runtime zone "{{ ipareplica_firewalld_zone }}"
|
- name: Firewalld - Verify runtime zone "{{ ipareplica_firewalld_zone }}"
|
||||||
shell: >
|
ansible.builtin.shell: >
|
||||||
firewall-cmd
|
firewall-cmd
|
||||||
--info-zone="{{ ipareplica_firewalld_zone }}"
|
--info-zone="{{ ipareplica_firewalld_zone }}"
|
||||||
>/dev/null
|
>/dev/null
|
||||||
when: ipareplica_firewalld_zone is defined
|
when: ipareplica_firewalld_zone is defined
|
||||||
|
|
||||||
- name: Firewalld - Verify permanent zone "{{ ipareplica_firewalld_zone }}"
|
- name: Firewalld - Verify permanent zone "{{ ipareplica_firewalld_zone }}"
|
||||||
shell: >
|
ansible.builtin.shell: >
|
||||||
firewall-cmd
|
firewall-cmd
|
||||||
--permanent
|
--permanent
|
||||||
--info-zone="{{ ipareplica_firewalld_zone }}"
|
--info-zone="{{ ipareplica_firewalld_zone }}"
|
||||||
@@ -53,12 +53,12 @@
|
|||||||
when: ipareplica_setup_firewalld | bool
|
when: ipareplica_setup_firewalld | bool
|
||||||
|
|
||||||
- name: Install - Set ipareplica_servers
|
- name: Install - Set ipareplica_servers
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
ipareplica_servers: "{{ groups['ipaservers'] | list }}"
|
ipareplica_servers: "{{ groups['ipaservers'] | list }}"
|
||||||
when: groups.ipaservers is defined and ipareplica_servers is not defined
|
when: groups.ipaservers is defined and ipareplica_servers is not defined
|
||||||
|
|
||||||
- name: Install - Set default principal if no keytab is given
|
- name: Install - Set default principal if no keytab is given
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
ipaadmin_principal: admin
|
ipaadmin_principal: admin
|
||||||
when: ipaadmin_principal is undefined and ipaclient_keytab is undefined
|
when: ipaadmin_principal is undefined and ipaclient_keytab is undefined
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
# result_ipareplica_test.server_already_configured is defined)
|
# result_ipareplica_test.server_already_configured is defined)
|
||||||
|
|
||||||
- name: Install - Setup client
|
- name: Install - Setup client
|
||||||
include_role:
|
ansible.builtin.include_role:
|
||||||
name: ipaclient
|
name: ipaclient
|
||||||
vars:
|
vars:
|
||||||
state: present
|
state: present
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
when: not result_ipareplica_test.client_enrolled
|
when: not result_ipareplica_test.client_enrolled
|
||||||
|
|
||||||
- name: Install - Configure firewalld
|
- name: Install - Configure firewalld
|
||||||
command: >
|
ansible.builtin.command: >
|
||||||
firewall-cmd
|
firewall-cmd
|
||||||
--permanent
|
--permanent
|
||||||
--zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is
|
--zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
when: ipareplica_setup_firewalld | bool
|
when: ipareplica_setup_firewalld | bool
|
||||||
|
|
||||||
- name: Install - Configure firewalld runtime
|
- name: Install - Configure firewalld runtime
|
||||||
command: >
|
ansible.builtin.command: >
|
||||||
firewall-cmd
|
firewall-cmd
|
||||||
--zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is
|
--zone="{{ ipareplica_firewalld_zone if ipareplica_firewalld_zone is
|
||||||
defined else '' }}"
|
defined else '' }}"
|
||||||
@@ -222,7 +222,7 @@
|
|||||||
|
|
||||||
- name: Install - Set dirman password
|
- name: Install - Set dirman password
|
||||||
no_log: yes
|
no_log: yes
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
ipareplica_dirman_password:
|
ipareplica_dirman_password:
|
||||||
"{{ result_ipareplica_master_password.password }}"
|
"{{ result_ipareplica_master_password.password }}"
|
||||||
|
|
||||||
@@ -776,14 +776,14 @@
|
|||||||
register: result_ipareplica_enable_ipa
|
register: result_ipareplica_enable_ipa
|
||||||
|
|
||||||
- name: Install - Cleanup root IPA cache
|
- name: Install - Cleanup root IPA cache
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "/root/.ipa_cache"
|
path: "/root/.ipa_cache"
|
||||||
state: absent
|
state: absent
|
||||||
when: result_ipareplica_enable_ipa.changed
|
when: result_ipareplica_enable_ipa.changed
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Cleanup temporary files
|
- name: Cleanup temporary files
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
with_items:
|
with_items:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# tasks file for ipareplica
|
# tasks file for ipareplica
|
||||||
|
|
||||||
- name: Import variables specific to distribution
|
- name: Import variables specific to distribution
|
||||||
include_vars: "{{ item }}"
|
ansible.builtin.include_vars: "{{ item }}"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml"
|
- "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml"
|
||||||
- "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
|
- "vars/{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
- "vars/default.yml"
|
- "vars/default.yml"
|
||||||
|
|
||||||
- name: Install IPA replica
|
- name: Install IPA replica
|
||||||
include_tasks: install.yml
|
ansible.builtin.include_tasks: install.yml
|
||||||
when: state|default('present') == 'present'
|
when: state|default('present') == 'present'
|
||||||
|
|
||||||
- name: Uninstall IPA replica
|
- name: Uninstall IPA replica
|
||||||
include_tasks: uninstall.yml
|
ansible.builtin.include_tasks: uninstall.yml
|
||||||
when: state|default('present') == 'absent'
|
when: state|default('present') == 'absent'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# tasks to uninstall IPA replica
|
# tasks to uninstall IPA replica
|
||||||
|
|
||||||
- name: Uninstall - Uninstall IPA replica
|
- name: Uninstall - Uninstall IPA replica
|
||||||
command: >
|
ansible.builtin.command: >
|
||||||
/usr/sbin/ipa-server-install
|
/usr/sbin/ipa-server-install
|
||||||
--uninstall
|
--uninstall
|
||||||
-U
|
-U
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
delay: 1
|
delay: 1
|
||||||
|
|
||||||
#- name: Uninstall - Remove all replication agreements and data about replica
|
#- name: Uninstall - Remove all replication agreements and data about replica
|
||||||
# command: >
|
# ansible.builtin.command: >
|
||||||
# /usr/sbin/ipa-replica-manage
|
# /usr/sbin/ipa-replica-manage
|
||||||
# del
|
# del
|
||||||
# {{ ipareplica_hostname | default(ansible_facts['fqdn']) }}
|
# {{ ipareplica_hostname | default(ansible_facts['fqdn']) }}
|
||||||
@@ -32,6 +32,6 @@
|
|||||||
# delegate_to: "{{ groups.ipaserver[0] | default(fail) }}"
|
# delegate_to: "{{ groups.ipaserver[0] | default(fail) }}"
|
||||||
|
|
||||||
#- name: Remove IPA replica packages
|
#- name: Remove IPA replica packages
|
||||||
# package:
|
# ansible.builtin.package:
|
||||||
# name: "{{ ipareplica_packages }}"
|
# name: "{{ ipareplica_packages }}"
|
||||||
# state: absent
|
# state: absent
|
||||||
|
|||||||
Reference in New Issue
Block a user