From b609420fda75f58a93dac6335b827af481e2be38 Mon Sep 17 00:00:00 2001 From: Bill Anastasiadis Date: Tue, 5 Nov 2024 18:37:40 +0100 Subject: [PATCH] Add support for additional module registration --- ansible/playbooks/registration.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ansible/playbooks/registration.yaml b/ansible/playbooks/registration.yaml index ae93ae6e..82e2efbc 100644 --- a/ansible/playbooks/registration.yaml +++ b/ansible/playbooks/registration.yaml @@ -97,6 +97,27 @@ - not_registered_found - "(rcg.rc != 0) or (use_suseconnect | bool)" + - name: Debug sles_modules variable + debug: + msg: + - "sles_modules is: {{ sles_modules }}" + - "Type of sles_modules is: {{ sles_modules | type_debug }}" + - "Length of sles_modules is: {{ sles_modules | length }}" + + - name: Add additional authenticated modules + ansible.builtin.command: SUSEConnect -p {{ item.key }} -r {{ item.value }} + register: result + until: result is succeeded + retries: 10 + delay: 60 + when: + - ansible_facts['distribution_major_version'] == "12" + - not_registered_found + - sles_modules is defined and sles_modules | length > 0 + loop: "{{ sles_modules }}" + loop_control: + label: "{{ item.key }}" + - name: Check if repos are added after registration ansible.builtin.command: zypper lr -u register: repos_after