Skip to content

Fix installation of cni plugins on hosts with different archs #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,5 @@ nomad_cni_version: "{{ lookup('env', 'NOMAD_CNI_VERSION') | default('0.9.1', tru
nomad_cni_pkg: cni-plugins-linux-{{ nomad_architecture }}-v{{ nomad_cni_version }}.tgz
nomad_cni_url: https://github.com/containernetworking/plugins/releases/download/v{{ nomad_cni_version }}
nomad_cni_zip_url: "{{ nomad_cni_url }}/{{ nomad_cni_pkg }}"
nomad_cni_checksum_file: "{{ nomad_cni_pkg }}.sha256"
nomad_cni_checksum_file_url: "{{ nomad_cni_zip_url }}.sha256"
8 changes: 3 additions & 5 deletions tasks/cni.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,26 @@

- name: Check CNI package checksum file
ansible.builtin.stat:
path: "{{ role_path }}/files/nomad_cni_{{ nomad_cni_version }}_SHA256SUMS"
path: "{{ role_path }}/files/{{ nomad_cni_checksum_file }}"
become: false
run_once: true
tags: installation
register: nomad_cni_checksum
delegate_to: 127.0.0.1

- name: Get Nomad CNI package checksum file
ansible.builtin.get_url:
url: "{{ nomad_cni_checksum_file_url }}"
dest: "{{ role_path }}/files/nomad_cni_{{ nomad_cni_version }}_SHA256SUMS"
dest: "{{ role_path }}/files/{{ nomad_cni_checksum_file }}"
mode: "0640"
become: false
run_once: true
tags: installation
when: not nomad_cni_checksum.stat.exists
delegate_to: 127.0.0.1

- name: Get Nomad CNI package checksum # noqa no-changed-when
ansible.builtin.shell: |
set -o pipefail
grep "{{ nomad_cni_pkg }}" "{{ role_path }}/files/nomad_cni_{{ nomad_cni_version }}_SHA256SUMS" | awk '{print $1}'
grep "{{ nomad_cni_pkg }}" "{{ role_path }}/files/{{ nomad_cni_checksum_file }}" | awk '{print $1}'
args:
executable: /bin/bash
become: false
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
notify:
- Restart nomad

- name: Remove custome configuration
- name: Remove custom configuration
ansible.builtin.file:
dest: "{{ nomad_config_dir }}/custom.json"
state: absent
Expand Down