Skip to content

Commit

Permalink
Add PIP_BREAK_SYSTEM_PACKAGES to the pip module (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Oct 11, 2023
1 parent e65abf1 commit c030eea
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions consul.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
name: netaddr
executable: pip3
become: false
environment:
PIP_BREAK_SYSTEM_PACKAGES: "1"

- name: consul.yml | Configure Consul instances
hosts: consul_instances
Expand Down
2 changes: 2 additions & 0 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@
ansible.builtin.pip:
name: netaddr
become: false
environment:
PIP_BREAK_SYSTEM_PACKAGES: "1"

...
2 changes: 2 additions & 0 deletions molecule/pg_upgrade/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@
ansible.builtin.pip:
name: netaddr
become: false
environment:
PIP_BREAK_SYSTEM_PACKAGES: "1"

...
9 changes: 9 additions & 0 deletions roles/patroni/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
umask: "0022"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
when: patroni_pip_requirements_repo | length < 1

- name: Install requirements
Expand All @@ -37,6 +38,7 @@
umask: "0022"
environment:
PATH: "{{ ansible_env.PATH }}:{{ postgresql_bin_dir }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
when: patroni_pip_requirements_repo | length < 1

- name: Install patroni
Expand All @@ -48,6 +50,7 @@
umask: "0022"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
when: patroni_pip_package_repo | length < 1 and patroni_install_version == "latest"

- name: "Install patroni {{ patroni_install_version }}"
Expand All @@ -58,6 +61,7 @@
umask: "0022"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
when: patroni_pip_package_repo | length < 1 and patroni_install_version != "latest"
when: installation_method == "repo" and patroni_installation_method == "pip"
environment: "{{ proxy_env | default({}) }}"
Expand Down Expand Up @@ -93,6 +97,7 @@
loop: "{{ patroni_pip_requirements_repo | map('basename') | list }}"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
when: patroni_pip_requirements_repo | length > 0

- name: Install patroni
Expand All @@ -104,6 +109,7 @@
loop: "{{ patroni_pip_package_repo | map('basename') | list }}"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
when: patroni_pip_package_repo | length > 0
when: installation_method == "repo" and patroni_installation_method == "pip"
vars:
Expand Down Expand Up @@ -134,6 +140,7 @@
loop: "{{ patroni_pip_requirements_file | map('basename') | list }}"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
when: patroni_pip_requirements_file | length > 0

- name: Install patroni
Expand All @@ -145,6 +152,7 @@
loop: "{{ patroni_pip_package_file | map('basename') | list }}"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
when: patroni_pip_package_file | length > 0
when: installation_method == "file" and patroni_installation_method == "pip"
vars:
Expand Down Expand Up @@ -617,6 +625,7 @@
- ruamel.yaml
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
vars:
ansible_python_interpreter: /usr/bin/python3
# Run PITR
Expand Down
1 change: 1 addition & 0 deletions roles/update/tasks/patroni.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
umask: "0022"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
when: installation_method == "repo" and patroni_installation_method == "pip"
environment: "{{ proxy_env | default({}) }}"
vars:
Expand Down
1 change: 1 addition & 0 deletions roles/upgrade/tasks/pre_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- pexpect
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
vars:
ansible_python_interpreter: /usr/bin/python3

Expand Down

0 comments on commit c030eea

Please sign in to comment.