Skip to content

Commit

Permalink
allow overwrite ansible_python_interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Dec 21, 2024
1 parent 8a8445e commit e6deb3e
Show file tree
Hide file tree
Showing 22 changed files with 45 additions and 41 deletions.
2 changes: 1 addition & 1 deletion roles/ansible_node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ansible_node_disallowed_packages:
# Problems with 11.1:
# fatal: [127.0.0.1]: FAILED! => {"changed": false, "module_stderr": "/bin/sh: line 1: /root/.venvs/ansible/bin/python3.11: Permission denied\n", "module_stdout": "", "msg": "MODULE FAILURE: No start of json char found\nSee stdout/stderr for the exact error", "rc": 126}

ansible_node_ansible_version: 10.7
ansible_node_ansible_version: 11.1

# required switching from 2.9 to newer version
ansible_node_remove_before_install: false
Expand Down
4 changes: 4 additions & 0 deletions roles/ansible_node/tasks/instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
available_playbook: "{{ r_playbook.value }}"
available_playbook_name: "{{ r_playbook.key }}"

- name: Set playbook_ansible_python_interpreter - {{ available_playbook_name }}
ansible.builtin.set_fact:
playbook_ansible_python_interpreter: '{{ ansible_python_interpreter if ansible_python_interpreter is defined else ansible_node_playbook_ansible_python_interpreter }}'

- name: Set playbook_filename - {{ available_playbook_name }}
ansible.builtin.set_fact:
playbook_filename: '{{ ansible_node_playbook_dir }}/{{ available_playbook.playbook }}'
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/backup.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
{% if backup_max_days is defined %}
backup_max_days: {{ backup_max_days }}
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/drupal_cron.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
drupal_task_name: cron
drush_path: {{ drush_path }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
drupal_task_name: scheduler
drush_path: {{ drush_path }}
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/git_mirror.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
git_mirrors:
{{ git_mirrors | to_nice_yaml(indent=2) | trim | indent(6) }}
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/goaccess.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
system_task_name: goaccess
{% if system_task_goaccess_index_file is defined %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
{% if matomo_config_master is defined %}
matomo_config_master: {{ matomo_config_master }}
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/matomo_cron.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
{% if matomo_task_become is defined %}
matomo_task_become: {{ matomo_task_become | bool | lower }}
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/matomo_geoip.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
{% if matomo_task_become is defined %}
matomo_task_become: {{ matomo_task_become | bool | lower }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
{% if matomo_task_become is defined %}
matomo_task_become: {{ matomo_task_become | bool | lower }}
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/nextcloud_cron.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
nextcloud_task_name: 'cron'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
system_task_name: pgbadger_query
{% if postgresql_version is defined %}
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/postgres_vacuum.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
system_task_name: postgres_vacuum
system_task_postgres_quiet: {{ system_task_postgres_quiet | bool | lower if system_task_postgres_quiet is defined else true }}
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/project_sync.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
{% if project_sync_instance_name is defined %}
project_sync_instance_name: {{ project_sync_instance_name }}
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/puma_restart.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
system_task_name: service_restart
system_task_service_name: {{ puma_restart_service_name | default('puma-redmine') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
redmine_task_name: automation
{% if rails_env is defined and rails_env != 'production' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
redmine_task_name: helpdesk
{% if rails_env is defined and rails_env != 'production' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
redmine_task_name: maintenance
{% if rails_env is defined and rails_env != 'production' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
redmine_task_name: receive
{% if rails_env is defined and rails_env != 'production' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
redmine_task_name: reminder
{% if rails_env is defined and rails_env != 'production' %}
Expand Down
4 changes: 2 additions & 2 deletions roles/ansible_node/templates/playbooks/system_watch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
serial: 1

vars:
{% if ansible_node_playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ ansible_node_playbook_ansible_python_interpreter }}
{% if playbook_ansible_python_interpreter != '' %}
ansible_python_interpreter: {{ playbook_ansible_python_interpreter }}
{% endif %}
system_watch_repo: {{ system_watch_repo }}
{% if https_user is defined and https_user != '' %}
Expand Down

0 comments on commit e6deb3e

Please sign in to comment.