apt: fix syntax
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jérémy Lecour 2020-02-04 18:37:00 +01:00 committed by Jérémy Lecour
parent 72f5dc70f8
commit 07fd68b6a4
1 changed files with 8 additions and 6 deletions

View File

@ -3,8 +3,9 @@
- name: "hold packages (apt)"
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 }}"
changed_when: "item + ' set on hold.' in apt_mark.stdout"
failed_when: apt_mark.rc != 0 and not apt_mark.stdout == ''
loop: "{{ apt_hold_packages }}"
tags:
- apt
@ -22,15 +23,16 @@
line: "{{ item }}"
create: True
state: present
with_items: "{{ apt_hold_packages }}"
loop: "{{ apt_hold_packages }}"
tags:
- apt
- name: "unhold packages (apt)"
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 }}"
changed_when: "'Canceled hold on' + item in apt_mark.stdout"
failed_when: apt_mark.rc != 0 and not apt_mark.stdout = ''
loop: "{{ apt_unhold_packages }}"
tags:
- apt
@ -40,7 +42,7 @@
line: "{{ item }}"
create: True
state: absent
with_items: "{{ apt_unhold_packages }}"
loop: "{{ apt_unhold_packages }}"
tags:
- apt