From f36406c2db6dd102515102b22826490f0f3b1352 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 22 Jan 2023 17:44:22 +0100 Subject: [PATCH] Make sure paramiko is installed on localhost as well. --- .../targets/setup_paramiko/tasks/main.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/integration/targets/setup_paramiko/tasks/main.yml b/tests/integration/targets/setup_paramiko/tasks/main.yml index 41af930f..12394cbd 100644 --- a/tests/integration/targets/setup_paramiko/tasks/main.yml +++ b/tests/integration/targets/setup_paramiko/tasks/main.yml @@ -4,3 +4,25 @@ name: "paramiko{% if cryptography_version.stdout is version('2.5.0', '<') %}<2.5.0{% endif %}" extra_args: "-c {{ remote_constraints }}" become: true + +- name: Gather facts on localhost + setup: + filter: + - ansible_python + gather_subset: + - '!all' + - '!min' + - python + delegate_to: localhost + delegate_facts: true + +- name: Register cryptography version on localhost + command: "{{ hostvars['localhost'].ansible_facts.python.executable }} -c 'import cryptography; print(cryptography.__version__)'" + register: cryptography_version_localhost + delegate_to: localhost + +- name: Install paramiko on localhost + pip: + name: "paramiko{% if cryptography_version_localhost.stdout is version('2.5.0', '<') %}<2.5.0{% endif %}" + become: true + delegate_to: localhost