switched to new facts-syntax

This commit is contained in:
2026-01-12 12:31:24 +01:00
parent 037b998219
commit 9fd07d57a4
41 changed files with 111 additions and 109 deletions

View File

@@ -4,7 +4,7 @@
- ansible.builtin.import_tasks: global_handlers/global_handlers.yml
connection: local
vars_files:
- "{{ lookup('first_found', ['os_vars/' + (ansible_distribution | lower) + '.yml'], errors='ignore') }}"
- "{{ lookup('first_found', ['os_vars/' + (ansible_facts['distribution'] | lower) + '.yml'], errors='ignore') }}"
become: true
vars:
ansible_reboot_cooldown_minutes: 15 # Cooldown in Minuten
@@ -33,17 +33,17 @@
- name: pre-run | update apt repository (debian, ubuntu, etc.) # noqa no-changed-when
ansible.builtin.apt: update_cache=yes
#changed_when: false
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
ignore_errors: True
- name: pre-run | update pacman repository (arch)
community.general.pacman: update_cache=yes
#changed_when: false
when: ansible_distribution == 'Archlinux'
when: ansible_facts['distribution'] == 'Archlinux'
ignore_errors: True
- name: pre-run |update portage repository (gentoo)
portage:
sync: yes
when: ansible_distribution == 'Gentoo'
when: ansible_facts['distribution'] == 'Gentoo'
ignore_errors: True
@@ -52,11 +52,11 @@
- name: pre-run | upgrade system (debian, ubuntu, etc.)
ansible.builtin.apt: upgrade=dist
#changed_when: false
when: ansible_distribution in ["Debian", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
ignore_errors: True
- name: pre-run | upgrade system (arch)
community.general.pacman: upgrade=true
when: ansible_distribution == 'Archlinux'
when: ansible_facts['distribution'] == 'Archlinux'
ignore_errors: True
# run roles
@@ -227,14 +227,14 @@
ansible.builtin.apt:
autoclean: yes
changed_when: false
when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"]
- name: autoremove orphan packages (debian and ubuntu)
tags: always
ansible.builtin.apt:
autoremove: yes
purge: yes
when: ansible_distribution in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"]
when: ansible_facts['distribution'] in ["Debian", "Pop!_OS", "Ubuntu", "Linux Mint"]
- name: post-run | update marker file timestamp on successful run
file: