apt: hold packages only if package is installed
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jérémy Lecour 2020-02-04 18:14:57 +01:00 committed by Jérémy Lecour
parent dc7358bc4c
commit 72f5dc70f8
2 changed files with 7 additions and 2 deletions

View File

@ -42,6 +42,7 @@ The **patch** part changes incrementally at each release.
### Changed
* removed some deprecations for Ansible 2.7
* apache: improve permissions in save_apache_status script
* apt: hold packages only if package is installed
* elasticsearch: listen on local interface only by default
* evocheck: upstream version 19.11.2
* evocheck: cron jobs execute in verbose

View File

@ -1,7 +1,7 @@
---
- name: "hold packages (apt)"
shell: "(apt-mark showhold | grep --quiet {{ item }}) || apt-mark hold {{ item }}"
shell: "(dpkg -l {{ item }} 2>/dev/null | grep -q -E '^(i|h)i') && ((apt-mark showhold | grep --quiet {{ item }}) || apt-mark hold {{ item }})"
register: apt_mark
changed_when: "'{{ item }} set on hold.' in apt_mark.stdout"
with_items: "{{ apt_hold_packages }}"
@ -13,6 +13,8 @@
dest: /etc/evolinux
mode: "0700"
state: directory
tags:
- apt
- name: "hold packages (config)"
lineinfile:
@ -25,7 +27,7 @@
- apt
- name: "unhold packages (apt)"
shell: "(apt-mark showhold | grep --quiet {{ item }}) && apt-mark unhold {{ item }}"
shell: "(dpkg -l {{ item }} 2>/dev/null | grep -q -E '^(i|h)i') && ((apt-mark showhold | grep --quiet {{ item }}) && apt-mark unhold {{ item }})"
register: apt_mark
changed_when: "'Canceled hold on {{ item }}.' in apt_mark.stdout"
with_items: "{{ apt_unhold_packages }}"
@ -67,6 +69,8 @@
changed_when: false
failed_when: false
check_mode: no
tags:
- apt
- name: Check for held packages (script)
cron: