diff --git a/README.md b/README.md index d48c072..8bebe8c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ Define the APT or YUM/DNF repositories, with the path to the GPG key. # Mellanox GPG Key infiniband_gpg_key: 'http://www.mellanox.com/downloads/ofed/RPM-GPG-KEY-Mellanox' +To pin the priority of the repository (APT only). + + infiniband_apt_priority: 490 + The name of the kernel headers package might change across distros. This can be defined with: diff --git a/defaults/main.yml b/defaults/main.yml index 4014a17..7176456 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -8,6 +8,9 @@ infiniband_yum_repository: 'https://linux.mellanox.com/public/repo/infiniband/la # Mellanox GPG Key infiniband_gpg_key: 'http://www.mellanox.com/downloads/ofed/RPM-GPG-KEY-Mellanox' +# Pin the priority of the APT repository. +# infiniband_apt_priority: 490 + # IPoIB interfaces # # Define the list of interfaces to configure with IPoIB. Each item of the list diff --git a/tasks/repositories-Debian.yml b/tasks/repositories-Debian.yml index d43ced3..9546122 100644 --- a/tasks/repositories-Debian.yml +++ b/tasks/repositories-Debian.yml @@ -10,6 +10,16 @@ dest: /etc/apt/sources.list.d/infiniband.list mode: 0644 +- name: Configure APT preferences for InfiniBand repository + ansible.builtin.copy: + content: | + Package: * + Pin: release o=MLNX_OFED + Pin-Priority: {{ infiniband_apt_priority }} + dest: /etc/apt/preferences.d/priority-infiniband + mode: 0644 + when: infiniband_apt_priority is defined + - name: "Update repository cache" apt: update_cache: yes