Compare commits

..

2 commits

Author SHA1 Message Date
June ed5222e6bf
check.yaml: add logic for printing all .dpkg-* files 2024-11-23 01:48:49 +01:00
June 4162564c25
check.yaml: introduce check playbook with it printing host distro info
This playbook is for checking various host parameters.
2024-11-23 00:10:28 +01:00

31
playbooks/check.yaml Normal file
View file

@ -0,0 +1,31 @@
---
- name: Host information
hosts: all
tasks:
- 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