From f5b9100bc39de96e31ca9978686e58248af51ffc Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Thu, 6 Nov 2025 13:05:02 +0300 Subject: [PATCH] Use maximal acceptable ansible version vor correctly worked debops roles (with legacy buildin.include functions) Set to currently newest version of debops Use newest python version Native way for create pma nginx config symlink Correct disable local nginx host - appropriate dict item name field for preventing errors --- .python-version | 2 +- hosts | 9 +++++---- playbooks/debops/nginx.yml | 1 + playbooks/own/phpmyadmin-nginx-auth.yml | 9 +++++---- requirements.txt | 2 +- requirements.yml | 4 ++-- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.python-version b/.python-version index 2b6882d..97c6841 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.11.4 \ No newline at end of file +3.13.2 \ No newline at end of file diff --git a/hosts b/hosts index b7c5e08..d6ca78e 100644 --- a/hosts +++ b/hosts @@ -9,16 +9,17 @@ # - You can enter hostnames or ip addresses # - A hostname/ip can be a member of multiple groups +# Check ansible facts: ansible all -m setup -a 'filter=ansible_domain' -e lxc_host=IP_ADDRESS [lxc_templates] #debian10 ansible_host=debian10.dedic106-dhcp.dimti.ru ansible_user=root #debian10 ansible_host='{{ lxc_host }}' ansible_port=22230 debian10 ansible_host='{{ lxc_host }}' [anygroup] -server1 ansible_host=192.168.0.1 -server2 ansible_host=192.168.0.2 -server3 ansible_host=192.168.0.3 -server4 ansible_host=192.168.0.4 +#server1 ansible_host=192.168.0.1 +#server2 ansible_host=192.168.0.2 +#server3 ansible_host=192.168.0.3 +#server4 ansible_host=192.168.0.4 # Add your own groups here. Hosts can be added to multiple groups like so: # [anothergroup] diff --git a/playbooks/debops/nginx.yml b/playbooks/debops/nginx.yml index 05af210..070e192 100644 --- a/playbooks/debops/nginx.yml +++ b/playbooks/debops/nginx.yml @@ -32,6 +32,7 @@ # TODO: Replace [::]:443 to 443 and [::]:80 to 80 in site nginx config nginx_server_localhost: enabled: False + name: [ 'localhost', '127.0.0.1', '[::1]' ] nginx_listen_port: [ '80' ] nginx_listen_ssl_port: [ '443' ] nginx__servers: diff --git a/playbooks/own/phpmyadmin-nginx-auth.yml b/playbooks/own/phpmyadmin-nginx-auth.yml index 095715d..428b598 100644 --- a/playbooks/own/phpmyadmin-nginx-auth.yml +++ b/playbooks/own/phpmyadmin-nginx-auth.yml @@ -52,10 +52,11 @@ shell: |- echo "pma:$(openssl passwd -apr1 {{ lookup("password", secret + "/basic/" + site_name + "/pma " + "length=30")}} )" > /etc/nginx/passwords.d/pma.passwords - - name: 'Turning on pma web site nginx config' - shell: |- - cd /etc/nginx/sites-enabled - ln -s ../sites-available/pma.conf ./ + - name: Ensure pma nginx site is enabled (via symlink) + ansible.builtin.file: + src: /etc/nginx/sites-available/pma.conf + dest: /etc/nginx/sites-enabled/pma.conf + state: link - name: 'Restarting nginx' shell: |- diff --git a/requirements.txt b/requirements.txt index d0c578f..890953b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -ansible==2.10.7 +ansible==8.7.0 netaddr==1.3.0 \ No newline at end of file diff --git a/requirements.yml b/requirements.yml index d237a66..f258489 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,7 +1,7 @@ --- - +# https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html collections: - name: nginxinc.nginx_core version: 0.8.0 - name: debops.debops - version: 2.3.0 + version: 3.2.5