mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-28 02:14:43 +00:00
roles: Fix when, block and always key order.
ansible-lint warns if 'warn' key is used before block and always keys.
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
register: result_ipabackup
|
register: result_ipabackup
|
||||||
|
|
||||||
- name: Handle backup
|
- name: Handle backup
|
||||||
|
when: ipabackup_to_controller
|
||||||
block:
|
block:
|
||||||
- name: Get ipabackup_item from stderr or stdout output
|
- name: Get ipabackup_item from stderr or stdout output
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
@@ -37,5 +38,3 @@
|
|||||||
- name: Remove backup on server
|
- name: Remove backup on server
|
||||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/remove_backup_from_server.yml"
|
ansible.builtin.include_tasks: "{{ role_path }}/tasks/remove_backup_from_server.yml"
|
||||||
when: not ipabackup_keep_on_server
|
when: not ipabackup_keep_on_server
|
||||||
|
|
||||||
when: ipabackup_to_controller
|
|
||||||
|
|||||||
@@ -50,6 +50,10 @@
|
|||||||
(state == "copied" or state == "restored" or state == "absent")
|
(state == "copied" or state == "restored" or state == "absent")
|
||||||
|
|
||||||
- name: Get all backup names for copy to controller
|
- name: Get all backup names for copy to controller
|
||||||
|
when: state is defined and
|
||||||
|
((state == "copied" and ipabackup_to_controller) or
|
||||||
|
state == "absent") and
|
||||||
|
ipabackup_name is defined and ipabackup_name == "all"
|
||||||
block:
|
block:
|
||||||
- name: Get list of all backups on IPA server
|
- name: Get list of all backups on IPA server
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
@@ -62,12 +66,8 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
ipabackup_names: "{{ result_backup_find_backup_files.stdout_lines }}"
|
ipabackup_names: "{{ result_backup_find_backup_files.stdout_lines }}"
|
||||||
|
|
||||||
when: state is defined and
|
|
||||||
((state == "copied" and ipabackup_to_controller) or
|
|
||||||
state == "absent") and
|
|
||||||
ipabackup_name is defined and ipabackup_name == "all"
|
|
||||||
|
|
||||||
- name: Set ipabackup_names from ipabackup_name
|
- name: Set ipabackup_names from ipabackup_name
|
||||||
|
when: ipabackup_names is not defined and ipabackup_name is defined
|
||||||
block:
|
block:
|
||||||
- name: Fail on ipabackup_name all
|
- name: Fail on ipabackup_name all
|
||||||
ansible.builtin.fail:
|
ansible.builtin.fail:
|
||||||
@@ -83,7 +83,6 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
ipabackup_names: "{{ ipabackup_name }}"
|
ipabackup_names: "{{ ipabackup_name }}"
|
||||||
when: ipabackup_name | type_debug == "list"
|
when: ipabackup_name | type_debug == "list"
|
||||||
when: ipabackup_names is not defined and ipabackup_name is defined
|
|
||||||
|
|
||||||
- name: Set empty ipabackup_names if ipabackup_name is not defined
|
- name: Set empty ipabackup_names if ipabackup_name is not defined
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
@@ -91,6 +90,8 @@
|
|||||||
when: ipabackup_names is not defined and ipabackup_name is not defined
|
when: ipabackup_names is not defined and ipabackup_name is not defined
|
||||||
|
|
||||||
- name: Process "{{ ipabackup_names }}"
|
- name: Process "{{ ipabackup_names }}"
|
||||||
|
when: state is defined and
|
||||||
|
((state == "copied" and ipabackup_to_controller) or state == "absent")
|
||||||
block:
|
block:
|
||||||
- name: Copy backup from IPA server
|
- name: Copy backup from IPA server
|
||||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_backup_from_server.yml"
|
ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_backup_from_server.yml"
|
||||||
@@ -112,9 +113,6 @@
|
|||||||
loop_var: main_item
|
loop_var: main_item
|
||||||
when: state is defined and state == "absent"
|
when: state is defined and state == "absent"
|
||||||
|
|
||||||
when: state is defined and
|
|
||||||
((state == "copied" and ipabackup_to_controller) or state == "absent")
|
|
||||||
|
|
||||||
# Fail with more than one entry in ipabackup_names for copy to sever and
|
# Fail with more than one entry in ipabackup_names for copy to sever and
|
||||||
# restore.
|
# restore.
|
||||||
|
|
||||||
@@ -127,6 +125,10 @@
|
|||||||
# Use only first item in ipabackup_names for copy to server and for restore.
|
# Use only first item in ipabackup_names for copy to server and for restore.
|
||||||
|
|
||||||
- name: Process "{{ ipabackup_names[0] }}"
|
- name: Process "{{ ipabackup_names[0] }}"
|
||||||
|
when: ipabackup_from_controller or
|
||||||
|
(state|default("present") == "copied" and not ipabackup_to_controller)
|
||||||
|
vars:
|
||||||
|
ipabackup_name: "{{ ipabackup_names[0] }}"
|
||||||
block:
|
block:
|
||||||
- name: Copy backup to server
|
- name: Copy backup to server
|
||||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_backup_to_server.yml"
|
ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_backup_to_server.yml"
|
||||||
@@ -135,11 +137,6 @@
|
|||||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/restore.yml"
|
ansible.builtin.include_tasks: "{{ role_path }}/tasks/restore.yml"
|
||||||
when: state|default("present") == "restored"
|
when: state|default("present") == "restored"
|
||||||
|
|
||||||
vars:
|
|
||||||
ipabackup_name: "{{ ipabackup_names[0] }}"
|
|
||||||
when: ipabackup_from_controller or
|
|
||||||
(state|default("present") == "copied" and not ipabackup_to_controller)
|
|
||||||
|
|
||||||
- name: Restore IPA server
|
- name: Restore IPA server
|
||||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/restore.yml"
|
ansible.builtin.include_tasks: "{{ role_path }}/tasks/restore.yml"
|
||||||
vars:
|
vars:
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
### INSTALL PACKAGES
|
### INSTALL PACKAGES
|
||||||
|
|
||||||
- name: Package installation
|
- name: Package installation
|
||||||
|
when: ipabackup_install_packages | bool
|
||||||
block:
|
block:
|
||||||
- name: Ensure that IPA server packages are installed
|
- name: Ensure that IPA server packages are installed
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
@@ -79,11 +80,10 @@
|
|||||||
state: present
|
state: present
|
||||||
when: ipabackup_setup_firewalld | bool
|
when: ipabackup_setup_firewalld | bool
|
||||||
|
|
||||||
when: ipabackup_install_packages | bool
|
|
||||||
|
|
||||||
### START FIREWALLD
|
### START FIREWALLD
|
||||||
|
|
||||||
- name: Firewall configuration
|
- name: Firewall configuration
|
||||||
|
when: ipabackup_setup_firewalld | bool
|
||||||
block:
|
block:
|
||||||
- name: Ensure that firewalld is running
|
- name: Ensure that firewalld is running
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
@@ -106,8 +106,6 @@
|
|||||||
>/dev/null
|
>/dev/null
|
||||||
when: ipabackup_firewalld_zone is defined
|
when: ipabackup_firewalld_zone is defined
|
||||||
|
|
||||||
when: ipabackup_setup_firewalld | bool
|
|
||||||
|
|
||||||
### RESTORE
|
### RESTORE
|
||||||
|
|
||||||
- name: Restore backup
|
- name: Restore backup
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
when: ipaadmin_principal is undefined and ipaclient_keytab is undefined
|
when: ipaadmin_principal is undefined and ipaclient_keytab is undefined
|
||||||
|
|
||||||
- name: Install - DNS resolver configuration
|
- name: Install - DNS resolver configuration
|
||||||
|
when: ipaclient_configure_dns_resolver | bool
|
||||||
|
and not ipaclient_on_master | bool
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Install - Fail on missing ipaclient_domain and ipaserver_domain
|
- name: Install - Fail on missing ipaclient_domain and ipaserver_domain
|
||||||
@@ -47,9 +49,6 @@
|
|||||||
searchdomains: "{{ ipaserver_domain | default(ipaclient_domain) }}"
|
searchdomains: "{{ ipaserver_domain | default(ipaclient_domain) }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
when: ipaclient_configure_dns_resolver | bool
|
|
||||||
and not ipaclient_on_master | bool
|
|
||||||
|
|
||||||
- name: Install - IPA client test
|
- name: Install - IPA client test
|
||||||
ipaclient_test:
|
ipaclient_test:
|
||||||
### basic ###
|
### basic ###
|
||||||
@@ -76,6 +75,9 @@
|
|||||||
register: result_ipaclient_test
|
register: result_ipaclient_test
|
||||||
|
|
||||||
- name: Install - Client deployment
|
- name: Install - Client deployment
|
||||||
|
when: not ansible_check_mode and
|
||||||
|
not (result_ipaclient_test.client_already_configured and
|
||||||
|
not ipaclient_allow_repair | bool and not ipaclient_force_join | bool)
|
||||||
block:
|
block:
|
||||||
- name: Install - Cleanup leftover ccache
|
- name: Install - Cleanup leftover ccache
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@@ -130,6 +132,7 @@
|
|||||||
# If a keytab is specified in the hostent, then the hostent will be disabled
|
# If a keytab is specified in the hostent, then the hostent will be disabled
|
||||||
# if ipaclient_use_otp is set.
|
# if ipaclient_use_otp is set.
|
||||||
- name: Install - Obtain OTP
|
- name: Install - Obtain OTP
|
||||||
|
when: ipaclient_use_otp | bool and ipaclient_otp is not defined
|
||||||
block:
|
block:
|
||||||
- name: Install - Keytab or password is required for getting otp
|
- name: Install - Keytab or password is required for getting otp
|
||||||
ansible.builtin.fail:
|
ansible.builtin.fail:
|
||||||
@@ -175,9 +178,6 @@
|
|||||||
ipaadmin_orig_password: "{{ ipaadmin_password | default(omit) }}"
|
ipaadmin_orig_password: "{{ ipaadmin_password | default(omit) }}"
|
||||||
ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword
|
ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword
|
||||||
if result_ipaclient_get_otp.host is defined }}"
|
if result_ipaclient_get_otp.host is defined }}"
|
||||||
|
|
||||||
when: ipaclient_use_otp | bool and ipaclient_otp is not defined
|
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Install - Remove keytab temporary file
|
- name: Install - Remove keytab temporary file
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@@ -194,7 +194,15 @@
|
|||||||
when: ipaclient_otp is defined
|
when: ipaclient_otp is defined
|
||||||
|
|
||||||
- name: Install - Check keytab, principal and keytab
|
- name: Install - Check keytab, principal and keytab
|
||||||
|
when: not ipaclient_on_master | bool
|
||||||
block:
|
block:
|
||||||
|
# This block is executed only when
|
||||||
|
# not (not ipaclient_on_master | bool and
|
||||||
|
# not result_ipaclient_join.changed and
|
||||||
|
# not ipaclient_allow_repair | bool and
|
||||||
|
# (result_ipaclient_test_keytab.krb5_keytab_ok or
|
||||||
|
# (result_ipaclient_join.already_joined is defined and
|
||||||
|
# result_ipaclient_join.already_joined)))
|
||||||
|
|
||||||
- name: Install - Check if principal and keytab are set
|
- name: Install - Check if principal and keytab are set
|
||||||
ansible.builtin.fail:
|
ansible.builtin.fail:
|
||||||
@@ -208,7 +216,6 @@
|
|||||||
and ipaadmin_password is undefined
|
and ipaadmin_password is undefined
|
||||||
and ipaadmin_keytab is undefined
|
and ipaadmin_keytab is undefined
|
||||||
and ipaclient_keytab is undefined
|
and ipaclient_keytab is undefined
|
||||||
when: not ipaclient_on_master | bool
|
|
||||||
|
|
||||||
- name: Install - Purge {{ result_ipaclient_test.realm }} from host keytab
|
- name: Install - Purge {{ result_ipaclient_test.realm }} from host keytab
|
||||||
ansible.builtin.command: >
|
ansible.builtin.command: >
|
||||||
@@ -254,16 +261,14 @@
|
|||||||
ipaclient_force_join)
|
ipaclient_force_join)
|
||||||
|
|
||||||
- name: Install - Allow repair checks
|
- name: Install - Allow repair checks
|
||||||
|
when: not ipaclient_on_master | bool and
|
||||||
|
not result_ipaclient_join.changed and
|
||||||
|
not ipaclient_allow_repair | bool and
|
||||||
|
(result_ipaclient_test_keytab.krb5_keytab_ok or
|
||||||
|
(result_ipaclient_join.already_joined is defined and
|
||||||
|
result_ipaclient_join.already_joined))
|
||||||
block:
|
block:
|
||||||
# This block is executed only when
|
- name: The krb5 configuration is not correct
|
||||||
# not (not ipaclient_on_master | bool and
|
|
||||||
# not result_ipaclient_join.changed and
|
|
||||||
# not ipaclient_allow_repair | bool and
|
|
||||||
# (result_ipaclient_test_keytab.krb5_keytab_ok or
|
|
||||||
# (result_ipaclient_join.already_joined is defined and
|
|
||||||
# result_ipaclient_join.already_joined)))
|
|
||||||
|
|
||||||
- name: krb5 configuration not correct
|
|
||||||
ansible.builtin.fail:
|
ansible.builtin.fail:
|
||||||
msg: >
|
msg: >
|
||||||
The krb5 configuration is not correct, please enable allow_repair
|
The krb5 configuration is not correct, please enable allow_repair
|
||||||
@@ -278,14 +283,14 @@
|
|||||||
msg: >
|
msg: >
|
||||||
The ca.crt file is missing, please enable allow_repair to fix this.
|
The ca.crt file is missing, please enable allow_repair to fix this.
|
||||||
when: not result_ipaclient_test_keytab.ca_crt_exists
|
when: not result_ipaclient_test_keytab.ca_crt_exists
|
||||||
when: not ipaclient_on_master | bool and
|
|
||||||
not result_ipaclient_join.changed and
|
|
||||||
not ipaclient_allow_repair | bool and
|
|
||||||
(result_ipaclient_test_keytab.krb5_keytab_ok or
|
|
||||||
(result_ipaclient_join.already_joined is defined and
|
|
||||||
result_ipaclient_join.already_joined))
|
|
||||||
|
|
||||||
- name: Install - Configuration
|
- name: Install - Configuration
|
||||||
|
when: not (not ipaclient_on_master | bool and
|
||||||
|
not result_ipaclient_join.changed and
|
||||||
|
not ipaclient_allow_repair | bool
|
||||||
|
and (result_ipaclient_test_keytab.krb5_keytab_ok
|
||||||
|
or (result_ipaclient_join.already_joined is defined
|
||||||
|
and result_ipaclient_join.already_joined)))
|
||||||
block:
|
block:
|
||||||
- name: Install - Configure IPA default.conf
|
- name: Install - Configure IPA default.conf
|
||||||
ipaclient_ipa_conf:
|
ipaclient_ipa_conf:
|
||||||
@@ -407,18 +412,6 @@
|
|||||||
domain: "{{ result_ipaclient_test.domain }}"
|
domain: "{{ result_ipaclient_test.domain }}"
|
||||||
nisdomain: "{{ ipaclient_nisdomain | default(omit) }}"
|
nisdomain: "{{ ipaclient_nisdomain | default(omit) }}"
|
||||||
when: not ipaclient_no_nisdomain | bool
|
when: not ipaclient_no_nisdomain | bool
|
||||||
|
|
||||||
when: not (not ipaclient_on_master | bool and
|
|
||||||
not result_ipaclient_join.changed and
|
|
||||||
not ipaclient_allow_repair | bool
|
|
||||||
and (result_ipaclient_test_keytab.krb5_keytab_ok
|
|
||||||
or (result_ipaclient_join.already_joined is defined
|
|
||||||
and result_ipaclient_join.already_joined)))
|
|
||||||
|
|
||||||
when: not ansible_check_mode and
|
|
||||||
not (result_ipaclient_test.client_already_configured and
|
|
||||||
not ipaclient_allow_repair | bool and not ipaclient_force_join | bool)
|
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Install - Restore original admin password if overwritten by OTP
|
- name: Install - Restore original admin password if overwritten by OTP
|
||||||
no_log: yes
|
no_log: yes
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# tasks file for ipareplica
|
# tasks file for ipareplica
|
||||||
|
|
||||||
- name: Package installation
|
- name: Package installation
|
||||||
|
when: ipareplica_install_packages | bool
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Install - Ensure IPA replica packages are installed
|
- name: Install - Ensure IPA replica packages are installed
|
||||||
@@ -27,9 +28,8 @@
|
|||||||
state: present
|
state: present
|
||||||
when: ipareplica_setup_firewalld | bool
|
when: ipareplica_setup_firewalld | bool
|
||||||
|
|
||||||
when: ipareplica_install_packages | bool
|
|
||||||
|
|
||||||
- name: Firewall configuration
|
- name: Firewall configuration
|
||||||
|
when: ipareplica_setup_firewalld | bool
|
||||||
block:
|
block:
|
||||||
- name: Firewalld service - Ensure that firewalld is running
|
- name: Firewalld service - Ensure that firewalld is running
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
@@ -52,8 +52,6 @@
|
|||||||
>/dev/null
|
>/dev/null
|
||||||
when: ipareplica_firewalld_zone is defined
|
when: ipareplica_firewalld_zone is defined
|
||||||
|
|
||||||
when: ipareplica_setup_firewalld | bool
|
|
||||||
|
|
||||||
- name: Install - Set ipareplica_servers
|
- name: Install - Set ipareplica_servers
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
ipareplica_servers: "{{ groups['ipaservers'] | list }}"
|
ipareplica_servers: "{{ groups['ipaservers'] | list }}"
|
||||||
@@ -104,6 +102,9 @@
|
|||||||
register: result_ipareplica_test
|
register: result_ipareplica_test
|
||||||
|
|
||||||
- name: Install - Deploy replica
|
- name: Install - Deploy replica
|
||||||
|
when: not ansible_check_mode and
|
||||||
|
not (result_ipareplica_test.client_already_configured is defined or
|
||||||
|
result_ipareplica_test.server_already_configured is defined)
|
||||||
block:
|
block:
|
||||||
# This block is executed only when
|
# This block is executed only when
|
||||||
# not ansible_check_mode and
|
# not ansible_check_mode and
|
||||||
@@ -793,7 +794,3 @@
|
|||||||
- "/etc/ipa/.tmp_pkcs12_dirsrv"
|
- "/etc/ipa/.tmp_pkcs12_dirsrv"
|
||||||
- "/etc/ipa/.tmp_pkcs12_http"
|
- "/etc/ipa/.tmp_pkcs12_http"
|
||||||
- "/etc/ipa/.tmp_pkcs12_pkinit"
|
- "/etc/ipa/.tmp_pkcs12_pkinit"
|
||||||
|
|
||||||
when: not ansible_check_mode and
|
|
||||||
not (result_ipareplica_test.client_already_configured is defined or
|
|
||||||
result_ipareplica_test.server_already_configured is defined)
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# tasks file for ipaserver
|
# tasks file for ipaserver
|
||||||
|
|
||||||
- name: Install - Package installation
|
- name: Install - Package installation
|
||||||
|
when: ipaserver_install_packages | bool
|
||||||
block:
|
block:
|
||||||
- name: Install - Ensure that IPA server packages are installed
|
- name: Install - Ensure that IPA server packages are installed
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
@@ -26,9 +27,9 @@
|
|||||||
state: present
|
state: present
|
||||||
when: ipaserver_setup_firewalld | bool
|
when: ipaserver_setup_firewalld | bool
|
||||||
|
|
||||||
when: ipaserver_install_packages | bool
|
|
||||||
|
|
||||||
- name: Install - Firewall configuration
|
- name: Install - Firewall configuration
|
||||||
|
when: ipaserver_setup_firewalld | bool
|
||||||
block:
|
block:
|
||||||
- name: Firewalld service - Ensure that firewalld is running
|
- name: Firewalld service - Ensure that firewalld is running
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
@@ -51,9 +52,7 @@
|
|||||||
>/dev/null
|
>/dev/null
|
||||||
when: ipaserver_firewalld_zone is defined
|
when: ipaserver_firewalld_zone is defined
|
||||||
|
|
||||||
when: ipaserver_setup_firewalld | bool
|
- name: Copy external cert
|
||||||
|
|
||||||
- name: Include tasks "{{ role_path }}/tasks/copy_external_cert.yml"
|
|
||||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_external_cert.yml"
|
ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_external_cert.yml"
|
||||||
with_items: "{{ ipaserver_external_cert_files_from_controller }}"
|
with_items: "{{ ipaserver_external_cert_files_from_controller }}"
|
||||||
when: ipaserver_external_cert_files_from_controller is defined and
|
when: ipaserver_external_cert_files_from_controller is defined and
|
||||||
@@ -131,14 +130,13 @@
|
|||||||
register: result_ipaserver_test
|
register: result_ipaserver_test
|
||||||
|
|
||||||
- name: Install - Deploy server
|
- name: Install - Deploy server
|
||||||
|
when: not ansible_check_mode and not
|
||||||
|
(not result_ipaserver_test.changed and
|
||||||
|
(result_ipaserver_test.client_already_configured is defined or
|
||||||
|
result_ipaserver_test.server_already_configured is defined))
|
||||||
block:
|
block:
|
||||||
# This block is executed only when
|
|
||||||
# not ansible_check_mode and
|
|
||||||
# not (not result_ipaserver_test.changed and
|
|
||||||
# (result_ipaserver_test.client_already_configured is defined or
|
|
||||||
# result_ipaserver_test.server_already_configured is defined)
|
|
||||||
|
|
||||||
- name: Install - Obtain master password
|
- name: Install - Obtain master password
|
||||||
|
when: ipaserver_master_password is undefined
|
||||||
block:
|
block:
|
||||||
- name: Install - Master password creation
|
- name: Install - Master password creation
|
||||||
no_log: yes
|
no_log: yes
|
||||||
@@ -153,8 +151,6 @@
|
|||||||
ipaserver_master_password:
|
ipaserver_master_password:
|
||||||
"{{ result_ipaserver_master_password.password }}"
|
"{{ result_ipaserver_master_password.password }}"
|
||||||
|
|
||||||
when: ipaserver_master_password is undefined
|
|
||||||
|
|
||||||
- name: Install - Server preparation
|
- name: Install - Server preparation
|
||||||
ipaserver_prepare:
|
ipaserver_prepare:
|
||||||
### basic ###
|
### basic ###
|
||||||
@@ -321,6 +317,7 @@
|
|||||||
ipaserver_copy_csr_to_controller | bool
|
ipaserver_copy_csr_to_controller | bool
|
||||||
|
|
||||||
- name: Install - Configure services
|
- name: Install - Configure services
|
||||||
|
when: not result_ipaserver_setup_ca.csr_generated | bool
|
||||||
block:
|
block:
|
||||||
- name: Install - Setup otpd
|
- name: Install - Setup otpd
|
||||||
ipaserver_setup_otpd:
|
ipaserver_setup_otpd:
|
||||||
@@ -476,8 +473,6 @@
|
|||||||
{{ "--add-service=ntp" if not ipaclient_no_ntp | bool else "" }}
|
{{ "--add-service=ntp" if not ipaclient_no_ntp | bool else "" }}
|
||||||
when: ipaserver_setup_firewalld | bool
|
when: ipaserver_setup_firewalld | bool
|
||||||
|
|
||||||
when: not result_ipaserver_setup_ca.csr_generated | bool
|
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Cleanup temporary files
|
- name: Cleanup temporary files
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@@ -487,8 +482,3 @@
|
|||||||
- "/etc/ipa/.tmp_pkcs12_dirsrv"
|
- "/etc/ipa/.tmp_pkcs12_dirsrv"
|
||||||
- "/etc/ipa/.tmp_pkcs12_http"
|
- "/etc/ipa/.tmp_pkcs12_http"
|
||||||
- "/etc/ipa/.tmp_pkcs12_pkinit"
|
- "/etc/ipa/.tmp_pkcs12_pkinit"
|
||||||
|
|
||||||
when: not ansible_check_mode and not
|
|
||||||
(not result_ipaserver_test.changed and
|
|
||||||
(result_ipaserver_test.client_already_configured is defined or
|
|
||||||
result_ipaserver_test.server_already_configured is defined))
|
|
||||||
|
|||||||
@@ -103,6 +103,7 @@
|
|||||||
# Ensure /etc/sssd/pki exists
|
# Ensure /etc/sssd/pki exists
|
||||||
|
|
||||||
- name: Prepare for authselect
|
- name: Prepare for authselect
|
||||||
|
when: ipasmartcard_client_vars.USE_AUTHSELECT
|
||||||
block:
|
block:
|
||||||
- name: Ensure /etc/sssd/pki exists
|
- name: Ensure /etc/sssd/pki exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@@ -115,8 +116,6 @@
|
|||||||
path: /etc/sssd/pki/sssd_auth_ca_db.pem
|
path: /etc/sssd/pki/sssd_auth_ca_db.pem
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
when: ipasmartcard_client_vars.USE_AUTHSELECT
|
|
||||||
|
|
||||||
# Upload smartcard CA certificates to systemwide db
|
# Upload smartcard CA certificates to systemwide db
|
||||||
|
|
||||||
- name: Upload smartcard CA certificates to systemwide db
|
- name: Upload smartcard CA certificates to systemwide db
|
||||||
|
|||||||
@@ -168,10 +168,10 @@
|
|||||||
# HTTPD IFP
|
# HTTPD IFP
|
||||||
|
|
||||||
- name: Allow HTTPD ifp
|
- name: Allow HTTPD ifp
|
||||||
|
when: ipasmartcard_server_vars.allow_httpd_ifp
|
||||||
block:
|
block:
|
||||||
|
|
||||||
# Allow Apache to access SSSD IFP
|
# Allow Apache to access SSSD IFP
|
||||||
|
|
||||||
- name: Allow Apache to access SSSD IFP
|
- name: Allow Apache to access SSSD IFP
|
||||||
ansible.builtin.command: "{{ ipasmartcard_server_vars.python_interpreter }}"
|
ansible.builtin.command: "{{ ipasmartcard_server_vars.python_interpreter }}"
|
||||||
args:
|
args:
|
||||||
@@ -192,11 +192,10 @@
|
|||||||
name: sssd
|
name: sssd
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
when: ipasmartcard_server_vars.allow_httpd_ifp
|
|
||||||
|
|
||||||
# Ensure /etc/sssd/pki exists
|
# Ensure /etc/sssd/pki exists
|
||||||
|
|
||||||
- name: Prepare for authselect
|
- name: Prepare for authselect
|
||||||
|
when: ipasmartcard_server_vars.USE_AUTHSELECT
|
||||||
block:
|
block:
|
||||||
- name: Ensure /etc/sssd/pki exists
|
- name: Ensure /etc/sssd/pki exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@@ -209,8 +208,6 @@
|
|||||||
path: /etc/sssd/pki/sssd_auth_ca_db.pem
|
path: /etc/sssd/pki/sssd_auth_ca_db.pem
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
when: ipasmartcard_server_vars.USE_AUTHSELECT
|
|
||||||
|
|
||||||
# Upload smartcard CA certificates to systemwide db
|
# Upload smartcard CA certificates to systemwide db
|
||||||
|
|
||||||
- name: Upload smartcard CA certificates to systemwide db
|
- name: Upload smartcard CA certificates to systemwide db
|
||||||
|
|||||||
Reference in New Issue
Block a user