Skip to content

Commit

Permalink
fixup arch in artifact name for rpm
Browse files Browse the repository at this point in the history
  • Loading branch information
gionn committed Jul 15, 2024
1 parent 1efbfbf commit c4ba9ea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
18 changes: 13 additions & 5 deletions roles/transformers/tasks/imagemagick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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 }}"

Expand All @@ -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 }}"
8 changes: 4 additions & 4 deletions roles/transformers/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c4ba9ea

Please sign in to comment.