From: Kienan Stewart Date: Wed, 14 Feb 2024 20:45:48 +0000 (-0500) Subject: ansible: Switch SLES product registrations to use common task X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=883b70386ae17f6f183231387477d1aed35eac9a;p=lttng-ci.git ansible: Switch SLES product registrations to use common task Change-Id: Ide81884d4bf64e61f0d824668455d78235715c71 Signed-off-by: Kienan Stewart --- diff --git a/automation/ansible/roles/common/tasks/setup-Suse.yml b/automation/ansible/roles/common/tasks/setup-Suse.yml index 23b681b..a35ee7b 100644 --- a/automation/ansible/roles/common/tasks/setup-Suse.yml +++ b/automation/ansible/roles/common/tasks/setup-Suse.yml @@ -28,9 +28,12 @@ - name: Connect SLES Repo when: ansible_distribution == 'SLES' - ansible.builtin.command: - argv: ['suseconnect', '-p', "{{item}}/{{ansible_distribution_version}}/{{ansible_architecture}}"] - with_items: "{{common_sles_connect_repos}}" + include_role: + name: suse + tasks_from: product + loop: "{{common_sles_connect_repos}}" + loop_control: + loop_var: 'product' - name: Ensure common patterns are installed. zypper: "name={{ common_patterns }} type=pattern state=present update_cache=yes" diff --git a/automation/ansible/roles/developer/tasks/setup-Suse.yml b/automation/ansible/roles/developer/tasks/setup-Suse.yml index 1373dff..bda46e9 100644 --- a/automation/ansible/roles/developer/tasks/setup-Suse.yml +++ b/automation/ansible/roles/developer/tasks/setup-Suse.yml @@ -2,6 +2,9 @@ - name: Activate required products when: ansible_distribution == 'SLES' - ansible.builtin.command: - argv: ['suseconnect', '-p', "{{item}}/{{ansible_distribution_version}}/{{ansible_architecture}}"] - with_items: "{{developer_sles_products|default([])}}" + include_role: + name: suse + tasks_from: product + loop: "{{developer_sles_products|default([])}}" + loop_control: + loop_var: 'product'