From 2434abaaf73bbcc58f869cd0963767277fd50036 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 28 Mar 2019 15:09:17 -0700 Subject: [PATCH] Fix git test on FreeBSD with Python 3.x. (#54560) --- test/integration/targets/pip/tasks/main.yml | 23 ++++++++++++++++++++- test/integration/targets/pip/tasks/pip.yml | 8 +------ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/test/integration/targets/pip/tasks/main.yml b/test/integration/targets/pip/tasks/main.yml index d81d103559..d796d13b81 100644 --- a/test/integration/targets/pip/tasks/main.yml +++ b/test/integration/targets/pip/tasks/main.yml @@ -10,7 +10,28 @@ set_fact: virtualenv: "{{ command.stdout_lines[0] }}" -- include: 'pip.yml' +- block: + - name: install git, needed for repo installs + package: + name: git + state: present + when: ansible_distribution != "MacOSX" + register: git_install + + - include_tasks: pip.yml + always: + - name: remove unwanted packages + package: + name: git + state: absent + when: git_install.changed + + - name: remove auto-installed packages from FreeBSD + pkgng: + name: git + state: absent + autoremove: yes + when: git_install.changed and ansible_distribution == "FreeBSD" when: ansible_fips|bool != True module_defaults: pip: diff --git a/test/integration/targets/pip/tasks/pip.yml b/test/integration/targets/pip/tasks/pip.yml index 78b0b9cd50..3ff453289c 100644 --- a/test/integration/targets/pip/tasks/pip.yml +++ b/test/integration/targets/pip/tasks/pip.yml @@ -18,12 +18,6 @@ # FIXME: replace the python test package -- name: install git, needed for repo installs - package: - name: git - state: present - when: ansible_distribution != "MacOSX" - # first some tests installed system-wide # verify things were not installed to start with @@ -139,7 +133,7 @@ - "not (req_installed is changed)" - name: install the same module from url - pip: + pip: name: "git+https://github.com/dvarrazzo/pyiso8601#egg=pyiso8601" virtualenv: "{{ output_dir }}/pipenv" editable: True