mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Fix pull test on FreeBSD with Python 3.x. (#54565)
This commit is contained in:
parent
2a9e6e4282
commit
5eb9fa90f4
3 changed files with 25 additions and 0 deletions
16
test/integration/targets/pull/cleanup.yml
Normal file
16
test/integration/targets/pull/cleanup.yml
Normal 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"
|
|
@ -13,6 +13,10 @@ temp_log="${temp_dir}/pull.log"
|
||||||
|
|
||||||
ansible-playbook setup.yml
|
ansible-playbook setup.yml
|
||||||
|
|
||||||
|
cleanup="$(pwd)/cleanup.yml"
|
||||||
|
|
||||||
|
trap 'ansible-playbook "${cleanup}"' EXIT
|
||||||
|
|
||||||
cp -av "pull-integration-test" "${repo_dir}"
|
cp -av "pull-integration-test" "${repo_dir}"
|
||||||
cd "${repo_dir}"
|
cd "${repo_dir}"
|
||||||
(
|
(
|
||||||
|
|
|
@ -4,3 +4,8 @@
|
||||||
package:
|
package:
|
||||||
name: git
|
name: git
|
||||||
when: ansible_distribution != "MacOSX"
|
when: ansible_distribution != "MacOSX"
|
||||||
|
register: git_install
|
||||||
|
- name: save install result
|
||||||
|
copy:
|
||||||
|
content: '{{ git_install }}'
|
||||||
|
dest: '{{ lookup("env", "OUTPUT_DIR") }}/git_install.json'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue