From f27077bcf8d304742bc4c0eb4d95f3f2ae1b801e Mon Sep 17 00:00:00 2001 From: iRaven Date: Thu, 10 Apr 2025 01:36:05 -0500 Subject: [PATCH] Update APT checker --- linux/compliance.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/linux/compliance.yaml b/linux/compliance.yaml index 5ed7f38..a25bc7a 100644 --- a/linux/compliance.yaml +++ b/linux/compliance.yaml @@ -7,17 +7,23 @@ tasks: + # Check for package managers + - name: Check for APT installation + stat: + path: /etc/apt + register: aptfolder + # 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" + when: aptfolder.stat.exists # 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" + when: aptfolder.stat.exists # User account (ansible) configuration - name: Add deployment user. @@ -125,4 +131,4 @@ # Upgrade all apt packages for good measure. - name: Upgrade all apt packages apt: upgrade=dist force_apt_get=yes - when: "'apt' in ansible_facts.packages" \ No newline at end of file + when: aptfolder.stat.exists \ No newline at end of file