From e278168b8776e950cb27f9a84b2c277ee2baf3da Mon Sep 17 00:00:00 2001 From: Fabricio Aguiar Date: Fri, 6 Dec 2024 12:25:15 -0300 Subject: [PATCH] Adding a playbook for managing RH subscription and Insights https://linux-system-roles.github.io/rhc/ closes OSPRH-11938 Signed-off-by: Fabricio Aguiar --- playbooks/redhat.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 playbooks/redhat.yml diff --git a/playbooks/redhat.yml b/playbooks/redhat.yml new file mode 100644 index 000000000..f39b0b0e6 --- /dev/null +++ b/playbooks/redhat.yml @@ -0,0 +1,24 @@ +--- + +- name: RH subscription management and Insights + hosts: "{{ edpm_override_hosts | default('all', true) }}" + strategy: linear + gather_facts: "{{ gather_facts | default(false) }}" + any_errors_fatal: "{{ edpm_any_errors_fatal | default(true) }}" + max_fail_percentage: "{{ edpm_max_fail_percentage | default(0) }}" + tasks: + - name: Gather facts if they don't exist + ansible.builtin.setup: + gather_subset: + - "!all" + - "!min" + - "distribution" + when: "'distribution' not in ansible_facts" + - name: Load system-roles.rhc tasks + ansible.builtin.include_role: + name: "{{ lookup('ansible.builtin.env', 'EDPM_SYSTEMROLES', default='redhat.rhel_system_roles') + '.rhc' }}" + apply: + become: true + when: ansible_facts['distribution'] | lower == 'redhat' + tags: + - edpm_bootstrap