Split up platform cleanup in tests. (#67320)
* Split up platform cleanup for git test. * Split up platform cleanup for ansible-galaxy test.
This commit is contained in:
parent
a0247d13d8
commit
a3b7d67fb0
7 changed files with 37 additions and 27 deletions
|
@ -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:
|
vars:
|
||||||
git_install: '{{ lookup("file", lookup("env", "OUTPUT_DIR") + "/git_install.json") | from_json }}'
|
git_install: '{{ lookup("file", lookup("env", "OUTPUT_DIR") + "/git_install.json") | from_json }}'
|
||||||
tasks:
|
tasks:
|
||||||
- name: remove unwanted packages
|
- name: cleanup
|
||||||
package:
|
include_tasks: "{{ cleanup_filename }}"
|
||||||
name: git
|
with_first_found:
|
||||||
state: absent
|
- "cleanup-{{ ansible_distribution | lower }}.yml"
|
||||||
when: git_install.changed
|
- "cleanup-default.yml"
|
||||||
|
loop_control:
|
||||||
- name: remove auto-installed packages from FreeBSD
|
loop_var: cleanup_filename
|
||||||
pkgng:
|
|
||||||
name: git
|
|
||||||
state: absent
|
|
||||||
autoremove: yes
|
|
||||||
when: git_install.changed and ansible_distribution == "FreeBSD"
|
|
||||||
|
|
|
@ -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
|
- name: cleanup
|
||||||
# problem is that we should not remove what we hadn't installed
|
include_tasks: "{{ cleanup_filename }}"
|
||||||
- name: remove git
|
with_first_found:
|
||||||
package:
|
- "cleanup-{{ ansible_distribution | lower }}.yml"
|
||||||
name: git
|
- "cleanup-default.yml"
|
||||||
state: absent
|
loop_control:
|
||||||
|
loop_var: cleanup_filename
|
||||||
- name: remove git from FreeBSD
|
|
||||||
pkgng:
|
|
||||||
name: git
|
|
||||||
state: absent
|
|
||||||
autoremove: yes
|
|
||||||
when: ansible_distribution == "FreeBSD"
|
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
name: '{{ item }}'
|
name: '{{ item }}'
|
||||||
when: ansible_distribution != "MacOSX"
|
when: ansible_distribution != "MacOSX"
|
||||||
notify:
|
notify:
|
||||||
- remove git
|
- cleanup
|
||||||
- remove git from FreeBSD
|
|
||||||
with_items: "{{ git_required_packages[ansible_os_family | default('default') ] | default(git_required_packages.default) }}"
|
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
|
- name: SETUP | verify that git is installed so this test can continue
|
||||||
|
|
Loading…
Add table
Reference in a new issue