From c921954649ff698fa867f9e6197fcc7be2481b1e Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 6 Dec 2022 16:25:30 +1100 Subject: [PATCH] pip: use latest instead of upgrade I'm not sure if this is clearer or not (which is why I proposed it separately here). From inspection of the code, adding "state: latest" just means Ansible runs "install -U" ... which is pretty much the same thing as adding --upgrade. Which is clearer, I'm not sure? Change-Id: I6e31523686555e33d062f3b05f2385d7e21e2620 --- playbooks/roles/create-venv/tasks/main.yaml | 2 +- playbooks/roles/install-ansible/tasks/main.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/create-venv/tasks/main.yaml b/playbooks/roles/create-venv/tasks/main.yaml index 2fa84f6392..a84dcec874 100644 --- a/playbooks/roles/create-venv/tasks/main.yaml +++ b/playbooks/roles/create-venv/tasks/main.yaml @@ -49,6 +49,6 @@ when: _venv_requirements_txt.changed pip: requirements: '{{ create_venv_path }}/requirements-venv.txt' - extra_args: '--upgrade' + state: latest virtualenv: '{{ create_venv_path }}' virtualenv_command: '/usr/bin/python3 -m venv' diff --git a/playbooks/roles/install-ansible/tasks/main.yaml b/playbooks/roles/install-ansible/tasks/main.yaml index 23fdfc0381..dabfba0ad2 100644 --- a/playbooks/roles/install-ansible/tasks/main.yaml +++ b/playbooks/roles/install-ansible/tasks/main.yaml @@ -67,10 +67,10 @@ when: _requirements_updated.changed pip: requirements: '/usr/ansible-venv/requirements.txt' - virtualenv: '/usr/ansible-venv' # Always upgrade because only called in response to # requirements.txt changes. - extra_args: '--upgrade' + state: latest + virtualenv: '/usr/ansible-venv' # From Ansible 2.10 >= most of the fun stuff is in collections. Clone # our required collections here. Note this is only for our testing of