apt: use conditionnal instead of handler for update

This commit is contained in:
Victor LABORIE 2017-10-31 15:50:25 +01:00
parent acf85bfffc
commit 17ddda8ed3
4 changed files with 16 additions and 14 deletions

View File

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

View File

@ -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

View File

@ -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

View File

@ -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