From 03183738014369817b27e183ce5f7b55e8966e3a Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Mon, 5 Feb 2024 22:34:37 -0300 Subject: [PATCH] depolyment roles: Allow deployment without gather_facts When using the deployment roles, some facts about the target node distribution are required, but using 'gather_facts: true' takes a long time as it probes for a lot of facts which are not used by the deployment roles. By restricting the facts loaded to the ones that are used, there's a reduction in the deployment tasks, as there's less data to be probed before the role is executed. --- roles/ipaclient/tasks/main.yml | 9 +++++++++ roles/ipareplica/tasks/main.yml | 9 +++++++++ roles/ipaserver/tasks/main.yml | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/roles/ipaclient/tasks/main.yml b/roles/ipaclient/tasks/main.yml index 7bd774c7d..905f45786 100644 --- a/roles/ipaclient/tasks/main.yml +++ b/roles/ipaclient/tasks/main.yml @@ -1,6 +1,15 @@ --- # tasks file for ipaclient +- name: Ensure distribution facts are available + ansible.builtin.setup: + gather_subset: + - dns + - distribution + - distribution_version + - distribution_major_version + - os_family + - name: Import variables specific to distribution ansible.builtin.include_vars: "{{ item }}" with_first_found: diff --git a/roles/ipareplica/tasks/main.yml b/roles/ipareplica/tasks/main.yml index 943b52c54..12b5055ca 100644 --- a/roles/ipareplica/tasks/main.yml +++ b/roles/ipareplica/tasks/main.yml @@ -1,6 +1,15 @@ --- # tasks file for ipareplica +- name: Ensure distribution facts are available + ansible.builtin.setup: + gather_subset: + - dns + - distribution + - distribution_version + - distribution_major_version + - os_family + - name: Import variables specific to distribution ansible.builtin.include_vars: "{{ item }}" with_first_found: diff --git a/roles/ipaserver/tasks/main.yml b/roles/ipaserver/tasks/main.yml index 8e8d9b8e0..8778e130a 100644 --- a/roles/ipaserver/tasks/main.yml +++ b/roles/ipaserver/tasks/main.yml @@ -1,6 +1,15 @@ --- # tasks file for ipaserver +- name: Ensure distribution facts are available + ansible.builtin.setup: + gather_subset: + - dns + - distribution + - distribution_version + - distribution_major_version + - os_family + - name: Import variables specific to distribution ansible.builtin.include_vars: "{{ item }}" with_first_found: