67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
- name: install base prerequisites
|
|
ansible.builtin.apt:
|
|
name:
|
|
- apt-transport-https
|
|
- ca-certificates
|
|
- curl
|
|
- git
|
|
- gnupg
|
|
- python3
|
|
- python3-yaml
|
|
- unzip
|
|
- wget
|
|
state: present
|
|
update_cache: true
|
|
|
|
- name: download icinga archive keyring package
|
|
ansible.builtin.get_url:
|
|
url: "{{ life_noc_icinga_keyring_deb_url }}"
|
|
dest: /tmp/icinga-archive-keyring.deb
|
|
mode: "0644"
|
|
when: life_noc_icinga_repo_enabled | bool
|
|
|
|
- name: install icinga archive keyring package
|
|
ansible.builtin.apt:
|
|
deb: /tmp/icinga-archive-keyring.deb
|
|
state: present
|
|
when: life_noc_icinga_repo_enabled | bool
|
|
|
|
- name: verify icinga keyring exists
|
|
ansible.builtin.stat:
|
|
path: /usr/share/keyrings/icinga-archive-keyring.gpg
|
|
register: icinga_keyring_file
|
|
|
|
- name: fail if icinga keyring is missing
|
|
ansible.builtin.fail:
|
|
msg: "La keyring Icinga /usr/share/keyrings/icinga-archive-keyring.gpg est absente après installation."
|
|
when: not icinga_keyring_file.stat.exists
|
|
|
|
- name: configure official icinga apt repository
|
|
ansible.builtin.apt_repository:
|
|
repo: "deb [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/debian {{ life_noc_icinga_repo_distribution }} main"
|
|
filename: icinga
|
|
state: present
|
|
update_cache: false
|
|
when: life_noc_icinga_repo_enabled | bool
|
|
|
|
- name: configure official icinga apt source repository
|
|
ansible.builtin.apt_repository:
|
|
repo: "deb-src [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/debian {{ life_noc_icinga_repo_distribution }} main"
|
|
filename: icinga
|
|
state: present
|
|
update_cache: false
|
|
when: life_noc_icinga_repo_enabled | bool
|
|
|
|
- name: verify icinga repository file exists
|
|
ansible.builtin.stat:
|
|
path: /etc/apt/sources.list.d/icinga.list
|
|
register: icinga_repo_file
|
|
|
|
- name: fail if icinga repository file is missing
|
|
ansible.builtin.fail:
|
|
msg: "Le fichier /etc/apt/sources.list.d/icinga.list est absent."
|
|
when: not icinga_repo_file.stat.exists
|
|
|
|
- name: update apt cache after icinga repository configuration
|
|
ansible.builtin.apt:
|
|
update_cache: true
|