fetch a newer package of node-exporter for ubuntu 20.04 (we want support for mSSL)

This commit is contained in:
histausse 2021-09-22 13:50:33 +02:00
parent 9b1307fba8
commit 8da94bd6ce
Signed by: histausse
GPG key ID: 67486F107F62E9E9

View file

@ -1,4 +1,28 @@
--- ---
- name: Use a newer version of Node exporter for ubuntu 20.04
block:
- name: Set the default release
lineinfile:
path: /etc/apt/apt.conf.d/01-vendor-ubuntu
regexp: '^APT::Default-Release '
line: "APT::Default-Release \"{{ ansible_facts['lsb']['codename'] }}\";"
- name: Pin node exporter
copy:
dest: /etc/apt/preferences.d/pin-prometheus-node-exporter
content: |
Package: prometheus-node-exporter
Pin: release n={{ ansible_facts['lsb']['codename'] }}
Pin-Priority: -10
Package: prometheus-node-exporter
Pin: release n=groovy
Pin-Priority: 900
- name: Add the repo from groovy
apt_repository:
repo: deb http://fr.archive.ubuntu.com/ubuntu groovy universe
state: present
when: ansible_facts['lsb']['id'] == 'Ubuntu' and ansible_facts['lsb']['codename'] == 'focal'
- name: Install Prometheus Node exporter - name: Install Prometheus Node exporter
apt: apt:
name: name: