2023-11-28 09:57:22 +00:00
|
|
|
---
|
|
|
|
# tasks file for apt
|
|
|
|
|
|
|
|
- name: Télécharger la clef du dépôt
|
|
|
|
ansible.builtin.get_url:
|
2024-06-03 16:05:23 +00:00
|
|
|
url: "{{ item.key_url }}"
|
|
|
|
dest: "{{ item.key_path }}"
|
2023-11-28 09:57:22 +00:00
|
|
|
mode: u=rw,g=r,o=r
|
|
|
|
become: true
|
2024-06-03 16:05:23 +00:00
|
|
|
when:
|
|
|
|
- apt_repositories | length > 0
|
|
|
|
- item.get('key_url', '') | length > 0
|
2023-11-28 09:57:22 +00:00
|
|
|
loop: "{{ apt_repositories }}"
|
|
|
|
loop_control:
|
2024-06-07 08:51:58 +00:00
|
|
|
label: "{{ item.url }}"
|
2023-11-28 09:57:22 +00:00
|
|
|
notify: Mettre à jour le cache
|
|
|
|
|
|
|
|
- name: Ajouter le dépôt
|
|
|
|
ansible.builtin.template:
|
2024-06-03 16:05:23 +00:00
|
|
|
src: repository.sources.j2
|
2024-06-05 11:26:41 +00:00
|
|
|
dest: /etc/apt/sources.list.d/99custom.sources
|
2023-11-28 09:57:22 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: u=rw,g=r,o=r
|
2024-06-03 16:05:23 +00:00
|
|
|
when: apt_repositories | length > 0
|
2023-11-28 09:57:22 +00:00
|
|
|
become: true
|
|
|
|
notify: Mettre à jour le cache
|
2024-06-03 16:05:23 +00:00
|
|
|
|
|
|
|
- name: Ajouter le fichier de priorité
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: preferences.j2
|
2024-06-05 11:26:41 +00:00
|
|
|
dest: /etc/apt/preferences.d/99custom
|
2024-06-03 16:05:23 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: u=rw,g=r,o=r
|
2024-06-05 11:26:41 +00:00
|
|
|
when: apt_preferences | length > 0
|
2024-06-03 16:05:23 +00:00
|
|
|
become: true
|
|
|
|
notify: Mettre à jour le cache
|