Refactor dpkg command task for improved clarity and reliability
This commit is contained in:
@@ -19,11 +19,8 @@
|
|||||||
raw: test -e /usr/bin/python3 || (apt -y update && apt install -y python3-apt)
|
raw: test -e /usr/bin/python3 || (apt -y update && apt install -y python3-apt)
|
||||||
|
|
||||||
- name: dpkg --configure -a
|
- name: dpkg --configure -a
|
||||||
command: >
|
ansible.builtin.command: dpkg --configure -a
|
||||||
dpkg --configure -a
|
changed_when: (_dpkg_configure.stdout | default('')) | length > 0
|
||||||
args:
|
|
||||||
warn: false
|
|
||||||
changed_when: _dpkg_configure.stdout_lines | length
|
|
||||||
register: _dpkg_configure
|
register: _dpkg_configure
|
||||||
when: apt_dpkg_configure|bool
|
when: apt_dpkg_configure|bool
|
||||||
tags:
|
tags:
|
||||||
@@ -44,4 +41,3 @@
|
|||||||
state: "{{ apt_install_state }}"
|
state: "{{ apt_install_state }}"
|
||||||
tags:
|
tags:
|
||||||
- ansible-dependencies
|
- ansible-dependencies
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user