From bb0a45ffde2987996ede36d0b9e1d457dac2b01f Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Mon, 22 Jun 2020 13:11:54 +0200 Subject: [PATCH] Update role tasks to reduce false 'changed' state Change-Id: If7b1d35bdf89a249214b81ee8979c16cea275789 --- roles/tobiko-ensure-python3/tasks/install.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/tobiko-ensure-python3/tasks/install.yaml b/roles/tobiko-ensure-python3/tasks/install.yaml index 93d79b6a1..a72233bec 100644 --- a/roles/tobiko-ensure-python3/tasks/install.yaml +++ b/roles/tobiko-ensure-python3/tasks/install.yaml @@ -31,6 +31,7 @@ export PATH={{ python_exe_path }} which "{{ python_command }}" register: get_python_exe + changed_when: no - name: "get '{{ get_python_exe.stdout_lines | first }}' info" @@ -38,6 +39,7 @@ cmd: get_python_info.py --base --quiet executable: '{{ get_python_exe.stdout_lines | first }}' register: get_python_info + changed_when: no - name: "set python_info['{{ python_command }}'] fact" @@ -51,6 +53,9 @@ command: > '{{ python_info[python_command].executable }}' -m pip install '{{ item }}' \ --upgrade --user -c '{{ remote_constraints_file }}' + register: upgrade_python_packages + changed_when: + "'Successfully installed' in upgrade_python_packages.stdout" loop: - pip - setuptools