From c4ba9ea0e8fd1d1626a58b134a55ebe66163a4ec Mon Sep 17 00:00:00 2001 From: Giovanni Toraldo Date: Mon, 1 Jul 2024 10:12:34 +0200 Subject: [PATCH] fixup arch in artifact name for rpm --- roles/transformers/tasks/imagemagick.yml | 18 +++++++++++++----- roles/transformers/tasks/main.yml | 8 ++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/roles/transformers/tasks/imagemagick.yml b/roles/transformers/tasks/imagemagick.yml index 73b794596..8c6739ee4 100644 --- a/roles/transformers/tasks/imagemagick.yml +++ b/roles/transformers/tasks/imagemagick.yml @@ -3,14 +3,22 @@ ansible.builtin.set_fact: imagemagick_package_arch: >- {%- if ansible_architecture == 'x86_64' -%} - amd64 + {%- if ansible_os_family == 'Debian' -%} + -amd64 + {%- else -%} + '' + {%- endif -%} {%- elif ansible_architecture == 'aarch64' -%} - arm64 + {%- if ansible_os_family == 'Debian' -%} + -arm64 + {%- else -%} + -aarch64 + {%- endif -%} {%- endif -%} - name: Download ImageMagick distribution vars: - pkg_name: "{{ item | replace('imagemagick-distribution', 'imagemagick-distribution-' + imagemagick_version) }}-{{ imagemagick_package_arch }}.{{ pkg_format }}" + pkg_name: "{{ item | replace('imagemagick-distribution', 'imagemagick-distribution-' + imagemagick_version) }}{{ imagemagick_package_arch }}.{{ pkg_format }}" pkg_url: "{{ nexus_repository.releases }}/../imagemagick/imagemagick-distribution/{{ imagemagick_version }}/{{ pkg_name }}" ansible.builtin.get_url: url: "{{ pkg_url }}" @@ -23,7 +31,7 @@ become: true when: pkg_format == 'deb' ansible.builtin.apt: - deb: "{{ download_location }}/{{ item | replace('imagemagick-distribution', 'imagemagick-distribution-' + imagemagick_version) }}-{{ imagemagick_package_arch }}.{{ pkg_format }}" + deb: "{{ download_location }}/{{ item | replace('imagemagick-distribution', 'imagemagick-distribution-' + imagemagick_version) }}{{ imagemagick_package_arch }}.{{ pkg_format }}" state: present loop: "{{ imagemagick_packages }}" @@ -33,6 +41,6 @@ ansible.builtin.yum: state: present name: >- - {{ download_location }}/{{ item | replace('imagemagick-distribution', 'imagemagick-distribution-' + imagemagick_version) }}.{{ pkg_format }} + {{ download_location }}/{{ item | replace('imagemagick-distribution', 'imagemagick-distribution-' + imagemagick_version) }}{{ imagemagick_package_arch }}.{{ pkg_format }} disable_gpg_check: true loop: "{{ imagemagick_packages }}" diff --git a/roles/transformers/tasks/main.yml b/roles/transformers/tasks/main.yml index 03230bf62..b14f22cbc 100644 --- a/roles/transformers/tasks/main.yml +++ b/roles/transformers/tasks/main.yml @@ -160,15 +160,15 @@ - name: Install Imagemagick ansible.builtin.include_tasks: imagemagick.yml -- name: Install LibreOffice - when: ansible_architecture == 'x86_64' - ansible.builtin.include_tasks: "dependencies-{{ pkg_format }}.yml" - - name: Warning about lack of support for arm64 libreoffice when: ansible_architecture == 'aarch64' ansible.builtin.debug: msg: "LibreOffice is not supported on arm64 architecture. Skipping installation." +- name: Install LibreOffice + when: ansible_architecture == 'x86_64' + ansible.builtin.include_tasks: "dependencies-{{ pkg_format }}.yml" + - name: Check if service restart is needed ansible.builtin.debug: msg: triggering service restart