From 02ac0690753249650ec22bd206562321398fa10a Mon Sep 17 00:00:00 2001 From: iRaven Date: Thu, 10 Apr 2025 01:23:36 -0500 Subject: [PATCH] Check for apt for apt-related tasks. --- linux/compliance.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/linux/compliance.yaml b/linux/compliance.yaml index 45ecbc0..5ed7f38 100644 --- a/linux/compliance.yaml +++ b/linux/compliance.yaml @@ -6,15 +6,18 @@ become: yes tasks: + # APT Cacher-NG Configuration - name: Add APT-Cacher-NG Configuration copy: content: "{{ aptcacher_config }}" dest: /etc/apt/apt.conf.d/proxy + when: "'apt' in ansible_facts.packages" # Update apt package lists after adding our proxy - name: Update apt repo package lists from cacher apt: update_cache=yes force_apt_get=yes cache_valid_time=3600 + when: "'apt' in ansible_facts.packages" # User account (ansible) configuration - name: Add deployment user. @@ -118,6 +121,8 @@ file: path: /root/.ssh/authorized_keys state: absent - # Upgrade all apt packages for good measur + + # Upgrade all apt packages for good measure. - name: Upgrade all apt packages - apt: upgrade=dist force_apt_get=yes \ No newline at end of file + apt: upgrade=dist force_apt_get=yes + when: "'apt' in ansible_facts.packages" \ No newline at end of file