get rid of deprecated code.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,57 +1,57 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
deb {{ apt_debian_mirror }} {{ ansible_lsb.codename }} main
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_lsb.codename }} main
|
||||
deb {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }} main
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }} main
|
||||
|
||||
{% if ansible_facts['distribution_major_version'] | int >= 12 %}
|
||||
deb http://security.debian.org/debian-security {{ ansible_lsb.codename }}-security main contrib non-free non-free-firmware
|
||||
deb http://security.debian.org/debian-security {{ ansible_facts['lsb']['codename'] }}-security main contrib non-free non-free-firmware
|
||||
{% elif ansible_facts['distribution_major_version'] | int == 11 %}
|
||||
deb http://security.debian.org/debian-security {{ ansible_lsb.codename }}-security main contrib non-free
|
||||
deb http://security.debian.org/debian-security {{ ansible_facts['lsb']['codename'] }}-security main contrib non-free
|
||||
{% else %}
|
||||
deb http://security.debian.org/ {{ ansible_lsb.codename }}/updates main contrib non-free
|
||||
deb http://security.debian.org/ {{ ansible_facts['lsb']['codename'] }}/updates main contrib non-free
|
||||
{% endif %}
|
||||
{% if not apt_src_enable %}
|
||||
{% if ansible_facts['distribution_major_version'] | int >= 12 %}
|
||||
#deb-src http://security.debian.org/debian-security {{ ansible_lsb.codename }}-security main contrib non-free non-free-firmware
|
||||
#deb-src http://security.debian.org/debian-security {{ ansible_facts['lsb']['codename'] }}-security main contrib non-free non-free-firmware
|
||||
{% elif ansible_facts['distribution_major_version'] | int == 11 %}
|
||||
#deb-src http://security.debian.org/debian-security {{ ansible_lsb.codename }}-security main contrib non-free
|
||||
#deb-src http://security.debian.org/debian-security {{ ansible_facts['lsb']['codename'] }}-security main contrib non-free
|
||||
{% else %}
|
||||
#deb-src http://security.debian.org/ {{ ansible_lsb.codename }}/updates main contrib non-free
|
||||
#deb-src http://security.debian.org/ {{ ansible_facts['lsb']['codename'] }}/updates main contrib non-free
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if ansible_facts['distribution_major_version'] | int >= 12 %}
|
||||
deb-src http://security.debian.org/debian-security {{ ansible_lsb.codename }}-security main contrib non-free non-free-firmware
|
||||
deb-src http://security.debian.org/debian-security {{ ansible_facts['lsb']['codename'] }}-security main contrib non-free non-free-firmware
|
||||
{% elif ansible_facts['distribution_major_version'] | int == 11 %}
|
||||
deb-src http://security.debian.org/debian-security {{ ansible_lsb.codename }}-security main contrib non-free
|
||||
deb-src http://security.debian.org/debian-security {{ ansible_facts['lsb']['codename'] }}-security main contrib non-free
|
||||
{% else %}
|
||||
deb-src http://security.debian.org/ {{ ansible_lsb.codename }}/updates main contrib non-free
|
||||
deb-src http://security.debian.org/ {{ ansible_facts['lsb']['codename'] }}/updates main contrib non-free
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# {{ ansible_lsb.codename }}-updates, previously known as 'volatile'
|
||||
deb {{ apt_debian_mirror }} {{ ansible_lsb.codename }}-updates main
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_lsb.codename }}-updates main
|
||||
# {{ ansible_facts['lsb']['codename'] }}-updates, previously known as 'volatile'
|
||||
deb {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }}-updates main
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }}-updates main
|
||||
|
||||
# Contrib packages contain DFSG-compliant software,
|
||||
# but have dependencies not in main (possibly packaged for Debian in non-free).
|
||||
# Non-free contains software that does not comply with the DFSG.
|
||||
{% if apt_debian_contrib_nonfree_enable %}
|
||||
{% if ansible_facts['distribution_major_version'] | int >= 12 %}
|
||||
deb {{ apt_debian_mirror }} {{ ansible_lsb.codename }} contrib non-free non-free-firmware
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_lsb.codename }} contrib non-free non-free-firmware
|
||||
deb {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }} contrib non-free non-free-firmware
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }} contrib non-free non-free-firmware
|
||||
{% else %}
|
||||
deb {{ apt_debian_mirror }} {{ ansible_lsb.codename }} contrib non-free
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_lsb.codename }} contrib non-free
|
||||
deb {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }} contrib non-free
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }} contrib non-free
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if apt_debian_contrib_nonfree_enable %}
|
||||
{% if ansible_facts['distribution_major_version'] | int >= 12 %}
|
||||
deb {{ apt_debian_mirror }} {{ ansible_lsb.codename }}-updates contrib non-free non-free-firmware
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_lsb.codename }}-updates contrib non-free non-free-firmware
|
||||
deb {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }}-updates contrib non-free non-free-firmware
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }}-updates contrib non-free non-free-firmware
|
||||
{% else %}
|
||||
deb {{ apt_debian_mirror }} {{ ansible_lsb.codename }}-updates contrib non-free
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_lsb.codename }}-updates contrib non-free
|
||||
deb {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }}-updates contrib non-free
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_facts['lsb']['codename'] }}-updates contrib non-free
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -60,11 +60,11 @@ deb {{ apt_debian_mirror }} {{ ansible_lsb.codename }}-updates contrib non-free
|
||||
# # newer versions of some applications which may provide useful features.
|
||||
{% if apt_backports_enable %}
|
||||
{% if ansible_facts['distribution_major_version'] | int >= 12 %}
|
||||
deb {{ apt_debian_mirror }} {{ ansible_distribution_release }}-backports main contrib non-free non-free-firmware
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_distribution_release }}-backports main contrib non-free non-free-firmware
|
||||
deb {{ apt_debian_mirror }} {{ ansible_facts['distribution_release'] }}-backports main contrib non-free non-free-firmware
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_facts['distribution_release'] }}-backports main contrib non-free non-free-firmware
|
||||
{% else %}
|
||||
deb {{ apt_debian_mirror }} {{ ansible_distribution_release }}-backports main contrib non-free
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_distribution_release }}-backports main contrib non-free
|
||||
deb {{ apt_debian_mirror }} {{ ansible_facts['distribution_release'] }}-backports main contrib non-free
|
||||
{{ '# ' if not apt_src_enable else '' }}deb-src {{ apt_debian_mirror }} {{ ansible_facts['distribution_release'] }}-backports main contrib non-free
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ back {{ item }}
|
||||
{% endfor -%}
|
||||
|
||||
|
||||
{%- if ansible_virtualization_role == 'host' %}
|
||||
{%- if ansible_facts.virtualization_role == 'host' %}
|
||||
|
||||
{% for item in sudoers_server_file_user_back_disk_privileges | default([]) %}
|
||||
back {{ item }}
|
||||
|
||||
Reference in New Issue
Block a user