Split up platform cleanup in tests. (#67320)

* Split up platform cleanup for git test.

* Split up platform cleanup for ansible-galaxy test.
pull/67323/head
Matt Clay 5 years ago committed by GitHub
parent a0247d13d8
commit a3b7d67fb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
- name: remove unwanted packages
package:
name: git
state: absent
when: git_install.changed

@ -0,0 +1,6 @@
- name: remove auto-installed packages from FreeBSD
pkgng:
name: git
state: absent
autoremove: yes
when: git_install.changed

@ -2,15 +2,10 @@
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"
- name: cleanup
include_tasks: "{{ cleanup_filename }}"
with_first_found:
- "cleanup-{{ ansible_distribution | lower }}.yml"
- "cleanup-default.yml"
loop_control:
loop_var: cleanup_filename

@ -0,0 +1,6 @@
# TODO remove everything we'd installed (see git_required_packages), not just git
# problem is that we should not remove what we hadn't installed
- name: remove git
package:
name: git
state: absent

@ -0,0 +1,5 @@
- name: remove git fromn FreeBSD
pkgng:
name: git
state: absent
autoremove: yes

@ -1,13 +1,7 @@
# TODO remove everything we'd installed (see git_required_packages), not just git
# problem is that we should not remove what we hadn't installed
- name: remove git
package:
name: git
state: absent
- name: remove git from FreeBSD
pkgng:
name: git
state: absent
autoremove: yes
when: ansible_distribution == "FreeBSD"
- name: cleanup
include_tasks: "{{ cleanup_filename }}"
with_first_found:
- "cleanup-{{ ansible_distribution | lower }}.yml"
- "cleanup-default.yml"
loop_control:
loop_var: cleanup_filename

@ -13,8 +13,7 @@
name: '{{ item }}'
when: ansible_distribution != "MacOSX"
notify:
- remove git
- remove git from FreeBSD
- cleanup
with_items: "{{ git_required_packages[ansible_os_family | default('default') ] | default(git_required_packages.default) }}"
- name: SETUP | verify that git is installed so this test can continue

Loading…
Cancel
Save