From 92164be957331977de3510f98b34760dd7afbdaf Mon Sep 17 00:00:00 2001 From: saibotk Date: Tue, 21 Sep 2021 06:04:35 +0200 Subject: [PATCH] playbooks: Add `env_ansible_deps_python_version` for python path This patch allows to optionally define a `env_ansible_deps_python_version` variable for a host, to change the python version used to import dynamic ansible python dependencies like docker and docker-compose. This is useful on newer systems, where python2.7 is not used anymore. --- playbooks/camo.yml | 2 +- playbooks/codimd.yml | 2 +- playbooks/docker_ipv6_nat.yml | 2 +- playbooks/factorio.yml | 2 +- playbooks/gitlab.yml | 2 +- playbooks/gitlab_runner.yml | 2 +- playbooks/keycloak.yml | 2 +- playbooks/lvm_self_backup.yml | 2 +- playbooks/mailcow.yml | 2 +- playbooks/mastodon.yml | 2 +- playbooks/matrix.yml | 2 +- playbooks/matrix_maubot.yml | 2 +- playbooks/matrix_webhooks.yml | 2 +- playbooks/minecraft.yml | 2 +- playbooks/minecraft_blockmap.yml | 2 +- playbooks/minio.yml | 2 +- playbooks/monitoring.yml | 4 ++-- playbooks/owncast.yml | 2 +- playbooks/penpot.yml | 2 +- playbooks/static_websites.yml | 2 +- playbooks/teamspeak.yml | 2 +- playbooks/vikunja.yml | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) diff --git a/playbooks/camo.yml b/playbooks/camo.yml index 7b24604..6a1b77b 100644 --- a/playbooks/camo.yml +++ b/playbooks/camo.yml @@ -25,4 +25,4 @@ - traefik - camo environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/codimd.yml b/playbooks/codimd.yml index cbe0e5d..c142953 100644 --- a/playbooks/codimd.yml +++ b/playbooks/codimd.yml @@ -24,4 +24,4 @@ - traefik - codimd environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/docker_ipv6_nat.yml b/playbooks/docker_ipv6_nat.yml index f963de7..812130e 100644 --- a/playbooks/docker_ipv6_nat.yml +++ b/playbooks/docker_ipv6_nat.yml @@ -23,4 +23,4 @@ - docker_cleanup - docker_ipv6_nat environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/factorio.yml b/playbooks/factorio.yml index 043a62f..a44854f 100644 --- a/playbooks/factorio.yml +++ b/playbooks/factorio.yml @@ -23,4 +23,4 @@ - docker_cleanup - factorio environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/gitlab.yml b/playbooks/gitlab.yml index 4542706..506c185 100644 --- a/playbooks/gitlab.yml +++ b/playbooks/gitlab.yml @@ -25,4 +25,4 @@ - traefik - gitlab environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/gitlab_runner.yml b/playbooks/gitlab_runner.yml index 103a0c3..5251129 100644 --- a/playbooks/gitlab_runner.yml +++ b/playbooks/gitlab_runner.yml @@ -24,4 +24,4 @@ - docker_cleanup - gitlab_runner environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/keycloak.yml b/playbooks/keycloak.yml index aa14357..54173d3 100644 --- a/playbooks/keycloak.yml +++ b/playbooks/keycloak.yml @@ -25,4 +25,4 @@ - traefik - keycloak environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/lvm_self_backup.yml b/playbooks/lvm_self_backup.yml index c59780f..ccff1bb 100644 --- a/playbooks/lvm_self_backup.yml +++ b/playbooks/lvm_self_backup.yml @@ -21,4 +21,4 @@ - docker - lvm_self_backup environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/mailcow.yml b/playbooks/mailcow.yml index 9119e5e..b43fb02 100644 --- a/playbooks/mailcow.yml +++ b/playbooks/mailcow.yml @@ -21,7 +21,7 @@ - docker - docker_compose environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages tasks: - name: Install backup crontab cron: diff --git a/playbooks/mastodon.yml b/playbooks/mastodon.yml index f5f863f..8309390 100644 --- a/playbooks/mastodon.yml +++ b/playbooks/mastodon.yml @@ -25,4 +25,4 @@ - traefik - mastodon environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/matrix.yml b/playbooks/matrix.yml index 366f0b8..4c72692 100644 --- a/playbooks/matrix.yml +++ b/playbooks/matrix.yml @@ -24,4 +24,4 @@ - traefik - matrix environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/matrix_maubot.yml b/playbooks/matrix_maubot.yml index 055b1ca..eb1a167 100644 --- a/playbooks/matrix_maubot.yml +++ b/playbooks/matrix_maubot.yml @@ -24,4 +24,4 @@ - traefik - matrix_maubot environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/matrix_webhooks.yml b/playbooks/matrix_webhooks.yml index 3294342..b10185d 100644 --- a/playbooks/matrix_webhooks.yml +++ b/playbooks/matrix_webhooks.yml @@ -24,4 +24,4 @@ - traefik - matrix_webhooks environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/minecraft.yml b/playbooks/minecraft.yml index 71560d3..e5879b5 100644 --- a/playbooks/minecraft.yml +++ b/playbooks/minecraft.yml @@ -24,4 +24,4 @@ - docker_cleanup - minecraft environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/minecraft_blockmap.yml b/playbooks/minecraft_blockmap.yml index b3c72f1..d89cfe9 100644 --- a/playbooks/minecraft_blockmap.yml +++ b/playbooks/minecraft_blockmap.yml @@ -24,4 +24,4 @@ - traefik - minecraft_blockmap environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/minio.yml b/playbooks/minio.yml index 7cae329..41ad12a 100644 --- a/playbooks/minio.yml +++ b/playbooks/minio.yml @@ -25,4 +25,4 @@ - traefik - minio environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/monitoring.yml b/playbooks/monitoring.yml index 6c47f11..ef7485d 100644 --- a/playbooks/monitoring.yml +++ b/playbooks/monitoring.yml @@ -25,7 +25,7 @@ - traefik - monitoring environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages - hosts: all serial: 1 @@ -35,4 +35,4 @@ - docker_cleanup - telegraf environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/owncast.yml b/playbooks/owncast.yml index bc4b1ca..03b03cc 100644 --- a/playbooks/owncast.yml +++ b/playbooks/owncast.yml @@ -24,4 +24,4 @@ - traefik - owncast environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/penpot.yml b/playbooks/penpot.yml index 8983ac5..408cceb 100644 --- a/playbooks/penpot.yml +++ b/playbooks/penpot.yml @@ -24,4 +24,4 @@ - traefik - penpot environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/static_websites.yml b/playbooks/static_websites.yml index 7a05528..5bee581 100644 --- a/playbooks/static_websites.yml +++ b/playbooks/static_websites.yml @@ -26,4 +26,4 @@ - traefik - static_websites environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/teamspeak.yml b/playbooks/teamspeak.yml index fe359f4..1a20e86 100644 --- a/playbooks/teamspeak.yml +++ b/playbooks/teamspeak.yml @@ -25,4 +25,4 @@ - teamspeak - ts3audiobot environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages diff --git a/playbooks/vikunja.yml b/playbooks/vikunja.yml index df2d85a..7b46e31 100644 --- a/playbooks/vikunja.yml +++ b/playbooks/vikunja.yml @@ -24,4 +24,4 @@ - traefik - vikunja environment: - PYTHONPATH: /opt/ansible-dependencies/lib/python2.7/site-packages + PYTHONPATH: /opt/ansible-dependencies/lib/python{{ env_ansible_deps_python_version | default(2.7) }}/site-packages