get rid of deprecated code.

This commit is contained in:
2026-02-01 12:30:17 +01:00
parent 4d8631cead
commit 29cf8fec49
15 changed files with 223 additions and 63 deletions

View File

@@ -2,7 +2,7 @@
- name: (apt.yml) update configuration file - /etc/apt/sources.list
template:
src: "etc/apt/sources.list.{{ ansible_distribution }}.j2"
src: "etc/apt/sources.list.{{ ansible_facts['distribution'] }}.j2"
dest: /etc/apt/sources.list
owner: root
group: root
@@ -11,6 +11,7 @@
when:
- ansible_facts['distribution'] == "Debian"
- apt_manage_sources_list|bool
- (ansible_facts['distribution_major_version'] | int) < 13
tags:
- apt-configuration
@@ -167,7 +168,7 @@
apt:
name: "{{ microcode_intel_package }}"
state: present
default_release: "{{ ansible_distribution_release }}-backports"
default_release: "{{ ansible_facts['distribution_release'] }}-backports"
when:
- apt_backports_enable
- ansible_facts['distribution'] == "Debian"
@@ -182,7 +183,7 @@
apt:
name: "{{ microcode_intel_package }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- apt_debian_contrib_nonfree_enable
- ansible_facts['distribution'] == "Debian"
@@ -197,7 +198,7 @@
apt:
name: "{{ microcode_amd_package }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- apt_debian_contrib_nonfree_enable
- ansible_facts['distribution'] == "Debian"
@@ -212,7 +213,7 @@
apt:
name: "{{ microcode_intel_package }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- ansible_facts['distribution'] == "Ubuntu"
- ansible_facts['distribution_release'] == "bionic"
@@ -226,7 +227,7 @@
apt:
name: "{{ microcode_amd_package }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- apt_debian_contrib_nonfree_enable
- ansible_facts['distribution'] == "Ubuntu"
@@ -241,7 +242,7 @@
apt:
name: "{{ microcode_intel_package }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- ansible_facts['distribution'] == "Ubuntu"
- ansible_facts['distribution_release'] == "xenial"
@@ -255,7 +256,7 @@
apt:
name: "{{ microcode_amd_package }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- apt_debian_contrib_nonfree_enable
- ansible_facts['distribution'] == "Ubuntu"
@@ -270,7 +271,7 @@
apt:
name: "{{ microcode_intel_package }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- ansible_facts['distribution'] == "Ubuntu"
- ansible_facts['distribution_release'] == "jammy" or ansible_facts['distribution_release'] == "noble"
@@ -284,7 +285,7 @@
apt:
name: "{{ microcode_amd_package }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- apt_debian_contrib_nonfree_enable
- ansible_facts['distribution'] == "Ubuntu"
@@ -302,7 +303,7 @@
apt:
name: "{{ firmware_packages_ubuntu }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- ansible_facts['distribution'] == "Ubuntu"
tags:
@@ -314,7 +315,7 @@
apt:
name: "{{ firmware_packages_debian }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- ansible_facts['distribution'] == "Debian"
tags:
@@ -326,7 +327,7 @@
apt:
name: "{{ firmware_non_free_packages_debian }}"
state: present
default_release: "{{ ansible_distribution_release }}"
default_release: "{{ ansible_facts['distribution_release'] }}"
when:
- ansible_facts['distribution'] == "Debian"
- apt_debian_contrib_nonfree_enable

View File

@@ -238,7 +238,7 @@
- name: "For OS: Ubuntu 16.04LTS, Arch: amd64"
import_tasks: ubuntu-x11vnc-1604-amd64.yml
when:
- ansible_distribution_version == "16.04"
- ansible_facts["distribution_version"] == "16.04"
- ansible_architecture == "x86_64"
tags:
- x11vnc
@@ -249,7 +249,7 @@
- name: "For OS: Ubuntu 18.04LTS, Arch: amd64"
import_tasks: ubuntu-x11vnc-1804-amd64.yml
when:
- ansible_distribution_version == "18.04"
- ansible_facts["distribution_version"] == "18.04"
- ansible_architecture == "x86_64"
tags:
- x11vnc
@@ -260,7 +260,7 @@
- name: "For OS: Ubuntu 20.04LTS, Arch: amd64"
import_tasks: ubuntu-x11vnc-2004-amd64.yml
when:
- ansible_distribution_version == "20.04"
- ansible_facts["distribution_version"] == "20.04"
- ansible_architecture == "x86_64"
tags:
- x11vnc
@@ -271,7 +271,7 @@
- name: "For OS: Ubuntu 22.04LTS, Arch: amd64"
import_tasks: ubuntu-x11vnc-2204-amd64.yml
when:
- ansible_distribution_version == "22.04"
- ansible_facts["distribution_version"] == "22.04"
- ansible_architecture == "x86_64"
tags:
- x11vnc

View File

@@ -11,8 +11,8 @@
- nfs-kernel-server
state: present
when:
- ansible_os_family == "Debian"
- "groups['nfs_server']|string is search(inventory_hostname)"
- ansible_facts['os_family'] == "Debian"
- inventory_hostname in groups['nfs_server']
tags:
- nfs-server
@@ -27,7 +27,7 @@
loop_control:
label: '{{ item.path }}'
when:
- "groups['nfs_server']|string is search(inventory_hostname)"
- inventory_hostname in groups['nfs_server']
tags:
- nfs-server
@@ -39,7 +39,7 @@
group: root
mode: 0644
when:
- "groups['nfs_server']|string is search(inventory_hostname)"
- inventory_hostname in groups['nfs_server']
notify: Reload nfs
tags:
- nfs-server
@@ -50,14 +50,14 @@
enabled: yes
masked: no
when:
- "groups['nfs_server']|string is search(inventory_hostname)"
- inventory_hostname in groups['nfs_server']
- name: Make sure service rpc-statd is running
systemd:
state: started
name: rpc-statd
when:
- "groups['nfs_server']|string is search(inventory_hostname)"
- inventory_hostname in groups['nfs_server']
tags:
- nfs-server
@@ -70,14 +70,14 @@
path: /etc/default/nfs-kernel-server
register: default_nfs_kernel_server_exists
when:
- "groups['nfs_server']|string is search(inventory_hostname)"
- inventory_hostname in groups['nfs_server']
tags:
- nfs-server
- name: (nfs.yml) Backup existing file /etc/default/nfs-kernel-server
command: cp -a /etc/default/nfs-kernel-server /etc/default/nfs-kernel-server.ORIG
when:
- "groups['nfs_server']|string is search(inventory_hostname)"
- inventory_hostname in groups['nfs_server']
- default_nfs_kernel_server_exists.stat.exists == False
tags:
- nfs-server
@@ -88,7 +88,7 @@
regexp: '^RPCNFSDCOUNT=.*'
replace: "RPCNFSDCOUNT={{ nfs_start_servers | default('16') }}"
when:
- "groups['nfs_server']|string is search(inventory_hostname)"
- inventory_hostname in groups['nfs_server']
tags:
- nfs-server
@@ -132,8 +132,8 @@
pkg: nfs-common
state: present
when:
- ansible_os_family == "Debian"
- "groups['nfs_client']|string is search(inventory_hostname)"
- ansible_facts['os_family'] == "Debian"
- inventory_hostname in groups['nfs_client']
tags:
- nfs-client
@@ -150,7 +150,7 @@
loop_control:
label: '{{ item.src }}'
when:
- "groups['nfs_client']|string is search(inventory_hostname)"
- inventory_hostname in groups['nfs_client']
tags:
- nfs-client

View File

@@ -71,7 +71,7 @@
- presence_of_passwprd_hashing_yescrypt.rc >= 2
when:
- ansible_facts['distribution'] == "Debian"
- ansible_distribution_major_version|int >= 11
- ansible_facts['distribution_major_version']|int >= 11
- file_etc_pam_d_common_password.stat.exists == True
#- ansible_distribution_major_version|int <= 12

View File

@@ -61,7 +61,8 @@
loop_control:
label: '{{ item.name }}'
when:
- item.name not in getent_passwd
- ansible_facts.getent_passwd is defined
- item.name not in ansible_facts.getent_passwd
notify: Renew nis databases
tags:
- nis-user

View File

@@ -10,7 +10,7 @@
- ntpsec
state: present
when:
- ansible_os_family == "Debian"
- ansible_facts.os_family == "Debian"
- groups['file_server']|string is search(inventory_hostname)
tags:
- ntp-server
@@ -33,7 +33,7 @@
group: ntpsec
mode: '0755'
when:
- ansible_distribution == "Debian"
- ansible_facts.distribution == "Debian"
- name: (ntp.yml) Backup installation version of file '/etc/ntpsec/ntp.conf'

View File

@@ -57,7 +57,8 @@
loop_control:
label: '{{ item.name }}'
when:
- item.name not in getent_passwd
- ansible_facts.getent_passwd is defined
- item.name not in ansible_facts.getent_passwd
notify: Renew nis databases
tags:
- system-user