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)
|
||||
|
||||
- name: dpkg --configure -a
|
||||
command: >
|
||||
dpkg --configure -a
|
||||
args:
|
||||
warn: false
|
||||
changed_when: _dpkg_configure.stdout_lines | length
|
||||
ansible.builtin.command: dpkg --configure -a
|
||||
changed_when: (_dpkg_configure.stdout | default('')) | length > 0
|
||||
register: _dpkg_configure
|
||||
when: apt_dpkg_configure|bool
|
||||
tags:
|
||||
@@ -44,4 +41,3 @@
|
||||
state: "{{ apt_install_state }}"
|
||||
tags:
|
||||
- ansible-dependencies
|
||||
|
||||
|
||||
Reference in New Issue
Block a user