apt: fix syntax
All checks were successful
continuous-integration/drone/push Build is passing

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

View file

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