Skip to content

Commit

Permalink
Set variable "ansible_python_interpreter" if not defined (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Apr 20, 2024
1 parent 3bbd3e1 commit c121826
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 1 deletion.
6 changes: 6 additions & 0 deletions add_balancer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
any_errors_fatal: true
gather_facts: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down
6 changes: 6 additions & 0 deletions add_pgnode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
- ansible.builtin.import_tasks: roles/patroni/handlers/main.yml

pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down
6 changes: 6 additions & 0 deletions balancers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
vip_manager_disable: false # or 'true' for disable vip-manager service (if installed)

pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down
6 changes: 6 additions & 0 deletions config_pgcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
hosts: postgres_cluster
gather_facts: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"

Expand Down
6 changes: 6 additions & 0 deletions consul.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
environment: "{{ proxy_env | default({}) }}"

pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down
6 changes: 6 additions & 0 deletions deploy_pgcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
environment: "{{ proxy_env | default({}) }}"

pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down
6 changes: 6 additions & 0 deletions etcd_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
gather_facts: true

pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down
1 change: 0 additions & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
tasks:
- name: Set variables for PostgreSQL Cluster deployment test
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
firewall_enabled_at_boot: false
firewall_enable_ipv6: false # Added to prevent test failures in CI.
swap_file_create: false # Added to prevent test failures in CI.
Expand Down
5 changes: 5 additions & 0 deletions pg_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
become_user: postgres
any_errors_fatal: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"

Expand Down
5 changes: 5 additions & 0 deletions pg_upgrade_rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
gather_facts: true
any_errors_fatal: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
- name: Include upgrade variables
Expand Down
5 changes: 5 additions & 0 deletions remove_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
hosts: postgres_cluster
become: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
- name: Include OS-specific variables
Expand Down
6 changes: 6 additions & 0 deletions update_pgcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
become_method: sudo
any_errors_fatal: true
pre_tasks:
- name: "Set variable: ansible_python_interpreter"
ansible.builtin.set_fact:
ansible_python_interpreter: "/usr/bin/env python3"
when: "'python3' not in (ansible_python_interpreter | default(''))"
tags: always

- name: Include main variables
ansible.builtin.include_vars: "vars/main.yml"
tags: always
Expand Down

0 comments on commit c121826

Please sign in to comment.