From 3d3f950dadec352532e9079b279219784ad82d9e Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 16 Oct 2025 19:29:14 +0200 Subject: [PATCH] Remove 'warn' - its no longer supported. --- roles/common/tasks/apt.yml | 34 +++++++++++++++-------- roles/common/tasks/caching-nameserver.yml | 11 +++----- roles/common/tasks/redis-server.yml | 13 ++++----- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/roles/common/tasks/apt.yml b/roles/common/tasks/apt.yml index 7a5f673..103fe92 100644 --- a/roles/common/tasks/apt.yml +++ b/roles/common/tasks/apt.yml @@ -27,13 +27,11 @@ - apt-webserver-pkgs -- name: (apt.yml) dpkg --configure - command: > - dpkg --configure -a - args: - warn: false - changed_when: _dpkg_configure.stdout_lines | length +- name: (apt.yml) Configure any half-installed packages 'dpkg --configure -a' + ansible.builtin.command: dpkg --configure -a register: _dpkg_configure + changed_when: (_dpkg_configure.stdout | default('')) | length > 0 + failed_when: _dpkg_configure.rc != 0 when: apt_dpkg_configure|bool tags: - apt-dpkg-configure @@ -330,12 +328,24 @@ - apt-compiler-pkgs - apt-webserver-pkgs -- name: (apt.yml) clean - command: apt-get -y clean - args: - warn: false - changed_when: false - when: apt_clean|bool +#- name: (apt.yml) clean +# command: apt-get -y clean +# args: +# warn: false +# changed_when: false +# when: apt_clean|bool +# tags: +# - apt-clean +# - apt-initial-install +# - apt-microcode +# - apt-compiler-pkgs +# - apt-mysql-server-pkgs +# - apt-webserver-pkgs + +- name: (apt.yml) autoclean cache + ansible.builtin.apt: + autoclean: yes + when: apt_clean | bool tags: - apt-clean - apt-initial-install diff --git a/roles/common/tasks/caching-nameserver.yml b/roles/common/tasks/caching-nameserver.yml index a8f59e7..4692e2f 100644 --- a/roles/common/tasks/caching-nameserver.yml +++ b/roles/common/tasks/caching-nameserver.yml @@ -15,14 +15,11 @@ tags: - apt-caching-nameserver - -- name: (caching-nameserver.yml) dpkg --configure - command: > - dpkg --configure -a - args: - warn: false - changed_when: _dpkg_configure.stdout_lines | length +- name: (caching-nameserver.yml) Configure any half-installed packages 'dpkg --configure -a' + ansible.builtin.command: dpkg --configure -a register: _dpkg_configure + changed_when: (_dpkg_configure.stdout | default('')) | length > 0 + failed_when: _dpkg_configure.rc != 0 when: - ansible_distribution == "Debian" - apt_update|bool diff --git a/roles/common/tasks/redis-server.yml b/roles/common/tasks/redis-server.yml index 5f32bba..c6efbc0 100644 --- a/roles/common/tasks/redis-server.yml +++ b/roles/common/tasks/redis-server.yml @@ -15,17 +15,14 @@ tags: - redis-server - -- name: (redis-server.yml) dpkg --configure - command: > - dpkg --configure -a - args: - warn: false - changed_when: _dpkg_configure.stdout_lines | length +- name: (redis-server.yml) Configure any half-installed packages 'dpkg --configure -a' + ansible.builtin.command: dpkg --configure -a register: _dpkg_configure + changed_when: (_dpkg_configure.stdout | default('')) | length > 0 + failed_when: _dpkg_configure.rc != 0 when: - ansible_facts['distribution'] == "Debian" - - apt_update|bool + - apt_dpkg_configure|bool tags: - redis-server