Fix pull test on FreeBSD with Python 3.x. (#54565)

This commit is contained in:
Matt Clay 2019-03-28 16:23:16 -07:00 committed by GitHub
parent 2a9e6e4282
commit 5eb9fa90f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,16 @@
- hosts: localhost
vars:
git_install: '{{ lookup("file", lookup("env", "OUTPUT_DIR") + "/git_install.json") | from_json }}'
tasks:
- 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"

View file

@ -13,6 +13,10 @@ temp_log="${temp_dir}/pull.log"
ansible-playbook setup.yml
cleanup="$(pwd)/cleanup.yml"
trap 'ansible-playbook "${cleanup}"' EXIT
cp -av "pull-integration-test" "${repo_dir}"
cd "${repo_dir}"
(

View file

@ -4,3 +4,8 @@
package:
name: git
when: ansible_distribution != "MacOSX"
register: git_install
- name: save install result
copy:
content: '{{ git_install }}'
dest: '{{ lookup("env", "OUTPUT_DIR") }}/git_install.json'