From fab494285258a3ed1cb5583fa66e395e41c3f842 Mon Sep 17 00:00:00 2001 From: June Date: Mon, 2 Dec 2024 00:36:04 +0100 Subject: [PATCH] check.yaml: add logic for printing all .dpkg-* files --- playbooks/check.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/playbooks/check.yaml b/playbooks/check.yaml index 1b019e7..63ea631 100644 --- a/playbooks/check.yaml +++ b/playbooks/check.yaml @@ -5,3 +5,27 @@ - name: Print OS distribution and version ansible.builtin.debug: msg: "{{ ansible_facts['distribution'] }} {{ ansible_facts['distribution_version'] }} ({{ ansible_facts['distribution_release'] }})" + + - name: Find all .dpkg-* files + ansible.builtin.find: + paths: /etc + file_type: file + recurse: true + use_regex: false + patterns: + - "*.dpkg-*" + become: true + register: check__dpkg_files + + - name: Create variable for list of all .dpkg-* files + ansible.builtin.set_fact: + check__dpkg_files_list: [ ] + + - name: Populate list of all .dpkg-* files + ansible.builtin.set_fact: + check__dpkg_files_list: "{{ check__dpkg_files_list + [item.path] }}" + loop: "{{ check__dpkg_files.files }}" + + - name: Print .dpkg-* files list + ansible.builtin.debug: + var: check__dpkg_files_list