Browse Source

apt: use conditionnal instead of handler for update

evolinux-users
Victor LABORIE 4 years ago
parent
commit
17ddda8ed3
  1. 4
      apt/handlers/main.yml
  2. 10
      apt/tasks/backports.yml
  3. 8
      apt/tasks/basics.yml
  4. 8
      apt/tasks/evolix_public.yml

4
apt/handlers/main.yml

@ -1,4 +0,0 @@
---
- name: apt update
apt:
update_cache: yes

10
apt/tasks/backports.yml

@ -13,7 +13,7 @@
dest: /etc/apt/sources.list.d/backports.list
force: yes
mode: "0640"
notify: apt update
register: apt_backports_list
tags:
- apt
@ -23,11 +23,13 @@
dest: /etc/apt/preferences.d/0-backports-defaults
force: yes
mode: "0640"
notify: apt update
register: apt_backports_config
tags:
- apt
- name: Intermediate flush of handlers
meta: flush_handlers
- name: Apt update
apt:
update_cache: yes
when: apt_backports_list | changed or apt_backports_config | changed
tags:
- apt

8
apt/tasks/basics.yml

@ -6,7 +6,7 @@
dest: /etc/apt/sources.list
mode: "0644"
force: yes
notify: apt update
register: apt_basic_list
tags:
- apt
@ -20,7 +20,9 @@
- /etc/apt/sources.list.d/debian-update.list
when: apt_clean_gandi_sourceslist
- name: Intermediate flush of handlers
meta: flush_handlers
- name: Apt update
apt:
update_cache: yes
when: apt_basic_list | changed
tags:
- apt

8
apt/tasks/evolix_public.yml

@ -19,11 +19,13 @@
dest: /etc/apt/sources.list.d/evolix_public.list
force: yes
mode: "0640"
notify: apt update
register: apt_evolix_public
tags:
- apt
- name: Intermediate flush of handlers
meta: flush_handlers
- name: Apt update
apt:
update_cache: yes
when: apt_evolix_public | changed
tags:
- apt
Loading…
Cancel
Save