Skip to content

Commit

Permalink
feat: add ability to pin repo priority for APT
Browse files Browse the repository at this point in the history
The priority might be set with `infiniband_apt_priority`.
  • Loading branch information
btravouillon committed Feb 24, 2022
1 parent 77c4b98 commit baeef6f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions tasks/repositories-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit baeef6f

Please sign in to comment.