diff options
19 files changed, 52 insertions, 28 deletions
diff --git a/ansible.cfg b/ansible.cfg index 47140ec2..6dff2c62 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -22,8 +22,6 @@ var_compression_level = 9 bin_ansible_callbacks = True -interpreter_python = auto_legacy_silent - ## https://github.com/ansible/ansible/issues/56930 force_valid_group_names = ignore diff --git a/inventory/group_vars/openbsd/main.yml b/inventory/group_vars/openbsd/main.yml deleted file mode 100644 index 913008d0..00000000 --- a/inventory/group_vars/openbsd/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -ansible_python_interpreter: /usr/local/bin/python3.7 diff --git a/inventory/hosts.ini b/inventory/hosts.ini index 9cf3b168..7e8051e0 100644 --- a/inventory/hosts.ini +++ b/inventory/hosts.ini @@ -2,6 +2,8 @@ host_name={{ inventory_hostname }} ansible_user=root ansible_port=222 +ansible_python_interpreter=/usr/bin/python3 +python_basename=python3 ############################### @@ -206,10 +208,41 @@ emc-0[1:3] chaos-at-home-switches +[openbsd:vars] +ansible_python_interpreter=/usr/local/bin/python3.7 + [openbsd] ch-router-obsd +## legacy python version +[python2:vars] +ansible_python_interpreter=/usr/bin/python +python_basename=python + +[python2] +ch-atlas +ch-pan +ch-mimas +ch-mimas2 +ch-gnocchi +ch-gw-lan +ch-jump +s2-build +lw-master +sk-2019 +sk-cloudia +sk-2019vm +sk-tomnext +sk-tomnext-nc +sk-tomnext-hp +sk-torrent +ele-media +ele-lt +ele-gwhetzner +ele-mur + + ## virtualization [vmhost-ch-gnocchi-guests] ch-router diff --git a/roles/acmetool/base/tasks/main.yml b/roles/acmetool/base/tasks/main.yml index a5ab88d3..f19002b3 100644 --- a/roles/acmetool/base/tasks/main.yml +++ b/roles/acmetool/base/tasks/main.yml @@ -8,7 +8,7 @@ apt: name: - acmetool - - python-openssl + - "{{ python_basename }}-openssl" state: present - name: create initial directory structure diff --git a/roles/apps/collabora/code/tasks/custom-image.yml b/roles/apps/collabora/code/tasks/custom-image.yml index 9659fd75..b49ec667 100644 --- a/roles/apps/collabora/code/tasks/custom-image.yml +++ b/roles/apps/collabora/code/tasks/custom-image.yml @@ -14,7 +14,7 @@ - name: install python-docker apt: - name: python-docker + name: "{{ python_basename }}-docker" state: present - name: build custom image diff --git a/roles/apps/nextcloud/tasks/custom-image.yml b/roles/apps/nextcloud/tasks/custom-image.yml index c7e37654..6702d70b 100644 --- a/roles/apps/nextcloud/tasks/custom-image.yml +++ b/roles/apps/nextcloud/tasks/custom-image.yml @@ -14,7 +14,7 @@ - name: install python-docker apt: - name: python-docker + name: "{{ python_basename }}-docker" state: present - name: build custom image diff --git a/roles/cloud/install/templates/hetzner_postinst.sh.j2 b/roles/cloud/install/templates/hetzner_postinst.sh.j2 index d9de15c9..ad701364 100644 --- a/roles/cloud/install/templates/hetzner_postinst.sh.j2 +++ b/roles/cloud/install/templates/hetzner_postinst.sh.j2 @@ -8,20 +8,15 @@ export DEBIAN_FRONTEND=noninteractive apt-get update -q apt-get full-upgrade -y -q -PYTHON_BASENAME="python" -if [ "$OS_DISTRO" == "ubuntu" ]; then - if [ "$OS_MAJOR_VERSION" -ge 20 ]; then PYTHON_BASENAME="python3"; fi {% if cloud_provider == 'hcloud' %} +if [ "$OS_DISTRO" == "ubuntu" ]; then apt-get install -y -q --no-install-recommends linux-image-virtual apt-get purge -y -q linux-image-generic intel-microcode amd64-microcode iucode-tool linux-firmware -{% endif %} elif [ "$OS_DISTRO" == "debian" ]; then - if [ "$OS_MAJOR_VERSION" -ge 11 ]; then PYTHON_BASENAME="python3"; fi -{% if cloud_provider == 'hcloud' %} apt-get purge -y -q intel-microcode amd64-microcode iucode-tool firmware-bnx2x firmware-realtek firmware-linux firmware-linux-free firmware-linux-nonfree -{% endif %} fi -apt-get install -y -q --no-install-recommends openssh-server "$PYTHON_BASENAME" "$PYTHON_BASENAME-apt" +{% endif %} +apt-get install -y -q --no-install-recommends openssh-server "{{ python_basename }}" "{{ python_basename }}-apt" passwd -d root && passwd -l root {% if install_distro == "debian" %} diff --git a/roles/elevate/liquidtruth/tasks/mongodb.yml b/roles/elevate/liquidtruth/tasks/mongodb.yml index 77355f0f..390e9f7d 100644 --- a/roles/elevate/liquidtruth/tasks/mongodb.yml +++ b/roles/elevate/liquidtruth/tasks/mongodb.yml @@ -17,7 +17,7 @@ name: - mongodb - mongo-tools - - python-pymongo + - "{{ python_basename }}-pymongo" state: present # - name: check if admin user already exists diff --git a/roles/elevate/media/tasks/main.yml b/roles/elevate/media/tasks/main.yml index f2d8b85d..13ffa766 100644 --- a/roles/elevate/media/tasks/main.yml +++ b/roles/elevate/media/tasks/main.yml @@ -4,9 +4,9 @@ name: - mdadm - nginx - - python-docker + - "{{ python_basename }}-docker" - systemd-docker - - python-openssl + - "{{ python_basename }}-openssl" - samba - saswall state: present diff --git a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 index adad515e..a6e7b3fc 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-buster.cfg.j2 @@ -53,7 +53,7 @@ d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[hostvars[install_hostname].apt_repo_provider].debian }} tasksel tasksel/first multiselect -d-i pkgsel/include string openssh-server python python-apt +d-i pkgsel/include string openssh-server {{ hostvars[install_hostname].python_basename }} {{ hostvars[install_hostname].python_basename }}-apt d-i pkgsel/upgrade select safe-upgrade popularity-contest popularity-contest/participate boolean false diff --git a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 index bd712a08..bb275e98 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-jessie.cfg.j2 @@ -53,7 +53,7 @@ d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string tasksel tasksel/first multiselect -d-i pkgsel/include string openssh-server python python-apt +d-i pkgsel/include string openssh-server {{ hostvars[install_hostname].python_basename }} {{ hostvars[install_hostname].python_basename }}-apt d-i pkgsel/upgrade select safe-upgrade popularity-contest popularity-contest/participate boolean false diff --git a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 index 487e4727..fc41e876 100644 --- a/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_debian-stretch.cfg.j2 @@ -53,7 +53,7 @@ d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[hostvars[install_hostname].apt_repo_provider].debian }} tasksel tasksel/first multiselect -d-i pkgsel/include string openssh-server python python-apt +d-i pkgsel/include string openssh-server {{ hostvars[install_hostname].python_basename }} {{ hostvars[install_hostname].python_basename }}-apt d-i pkgsel/upgrade select safe-upgrade popularity-contest popularity-contest/participate boolean false diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 index 47d1065a..c2863382 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-bionic.cfg.j2 @@ -61,7 +61,7 @@ d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[hostvars[install_hostname].apt_repo_provider].ubuntu }} tasksel tasksel/first multiselect -d-i pkgsel/include string openssh-server python python-apt ifupdown +d-i pkgsel/include string openssh-server {{ hostvars[install_hostname].python_basename }} {{ hostvars[install_hostname].python_basename }}-apt ifupdown d-i pkgsel/upgrade select safe-upgrade popularity-contest popularity-contest/participate boolean false d-i pkgsel/update-policy select none diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 index d7438fd7..997617c1 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-focal.cfg.j2 @@ -61,7 +61,7 @@ d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[hostvars[install_hostname].apt_repo_provider].ubuntu }} tasksel tasksel/first multiselect -d-i pkgsel/include string openssh-server python3 python3-apt ifupdown +d-i pkgsel/include string openssh-server {{ hostvars[install_hostname].python_basename }} {{ hostvars[install_hostname].python_basename }}-apt ifupdown d-i pkgsel/upgrade select safe-upgrade popularity-contest popularity-contest/participate boolean false d-i pkgsel/update-policy select none diff --git a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 index e4536d4e..7144dc4f 100644 --- a/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_ubuntu-xenial.cfg.j2 @@ -58,7 +58,7 @@ d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[hostvars[install_hostname].apt_repo_provider].ubuntu }} tasksel tasksel/first multiselect -d-i pkgsel/include string openssh-server python python-apt +d-i pkgsel/include string openssh-server {{ hostvars[install_hostname].python_basename }} {{ hostvars[install_hostname].python_basename }}-apt d-i pkgsel/upgrade select safe-upgrade popularity-contest popularity-contest/participate boolean false d-i pkgsel/update-policy select none diff --git a/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 b/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 index 2312f2b0..46403443 100644 --- a/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 +++ b/roles/installer/debian/preseed/templates/preseed_xubuntu-focal-desktop.cfg.j2 @@ -64,7 +64,7 @@ d-i base-installer/install-recommends boolean false d-i apt-setup/security_host string {{ apt_repo_providers[hostvars[install_hostname].apt_repo_provider].ubuntu }} tasksel tasksel/first multiselect xubuntu-desktop -d-i pkgsel/include string openssh-server python3 python3-apt ifupdown +d-i pkgsel/include string openssh-server {{ hostvars[install_hostname].python_basename }} {{ hostvars[install_hostname].python_basename }}-apt ifupdown d-i pkgsel/upgrade select safe-upgrade popularity-contest popularity-contest/participate boolean false d-i pkgsel/update-policy select none diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 402cb55a..3f142f6b 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -7,7 +7,7 @@ apt: name: - "{{ mysql_pkg_name }}" - - python-pymysql + - "{{ python_basename }}-pymysql" state: present force: yes diff --git a/roles/ubuntu-ws/tasks/main.yml b/roles/ubuntu-ws/tasks/main.yml index 6fceef7f..cdf29182 100644 --- a/roles/ubuntu-ws/tasks/main.yml +++ b/roles/ubuntu-ws/tasks/main.yml @@ -62,7 +62,7 @@ - gnome-software-common - software-properties-gtk - software-properties-common - - python3-software-properties + - "{{ python_basename }}-software-properties" - flashplugin-installer - network-manager - network-manager-gnome diff --git a/roles/vm/host/base/tasks/main.yml b/roles/vm/host/base/tasks/main.yml index 1a7cb7d8..f789d2e0 100644 --- a/roles/vm/host/base/tasks/main.yml +++ b/roles/vm/host/base/tasks/main.yml @@ -5,7 +5,7 @@ - qemu-kvm - # configuration package, pulls in libvirt-clients and libvirt-daemon libvirt-daemon-system - - python-libvirt + - "{{ python_basename }}-libvirt" - haveged - bridge-utils - acl |