Skip to content

Commit

Permalink
fix: actually add own pip version comparison changed_when idemponency…
Browse files Browse the repository at this point in the history
… task

previous was comparing python version with same python version, like tf
  • Loading branch information
JonasPammer committed Jun 16, 2022
1 parent 9db8160 commit dbc3ea4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
- name: import tasks to determine default pip version
ansible.builtin.import_tasks: determine-default-pip-version.yml

# TODO: tmate'ly debug
- name: execute command to get current pip version
ansible.builtin.command: "{{ pip_executable }} --version"
register: pip__register_shell_pip_version
changed_when: false

- name: Install pip using pip to ensure desired version (forcereinstall).
ansible.builtin.pip:
name: "pip"
Expand All @@ -27,11 +31,12 @@
executable: "{{ pip_executable }}"
when: pip_state != 'forcereinstall'

- name: execute command to check if python version has been altered (when forcereinstall was used)
ansible.builtin.command: "{{ pip_python_executable }} --version"
register: pip__register_shell_pip_python_version_after
# FIXME: we need pip version before/after here
changed_when: pip__register_shell_pip_python_version.stdout != pip__register_shell_pip_python_version_after.stdout
- name: >
Execute command to check if pip version has been altered
(this task adds changed_when behaviour for when 'forcereinstall' was used).
ansible.builtin.command: "{{ pip_executable }} --version"
register: pip__register_shell_pip_version_after
changed_when: pip__register_shell_pip_version.stdout != pip__register_shell_pip_version_after.stdout
when: pip_state == "forcereinstall"

- name: Install virtualenv system packages.
Expand Down

0 comments on commit dbc3ea4

Please sign in to comment.