switched to new facts-syntax
This commit is contained in:
16
local.yml
16
local.yml
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user