mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Re-enable snap tests (#3967)
* Re-enable snap tests. * Skip tests on RHEL 8.2 and 8.3. * Refactor snap setup. * Try to simplify setup.
This commit is contained in:
parent
1ba79f3c6a
commit
bb78d98f8f
24 changed files with 30 additions and 67 deletions
4
tests/integration/targets/setup_snap/defaults/main.yml
Normal file
4
tests/integration/targets/setup_snap/defaults/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
has_snap: false
|
||||
|
||||
snap_packages:
|
||||
- snapd
|
5
tests/integration/targets/setup_snap/handlers/main.yml
Normal file
5
tests/integration/targets/setup_snap/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: Remove snapd
|
||||
package:
|
||||
name: "{{ snap_packages }}"
|
||||
state: absent
|
3
tests/integration/targets/setup_snap/meta/main.yml
Normal file
3
tests/integration/targets/setup_snap/meta/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
dependencies:
|
||||
- setup_pkg_mgr
|
||||
- setup_epel
|
1
tests/integration/targets/setup_snap/tasks/D-Fedora.yml
Symbolic link
1
tests/integration/targets/setup_snap/tasks/D-Fedora.yml
Symbolic link
|
@ -0,0 +1 @@
|
|||
default.yml
|
1
tests/integration/targets/setup_snap/tasks/D-RedHat-8.2.yml
Symbolic link
1
tests/integration/targets/setup_snap/tasks/D-RedHat-8.2.yml
Symbolic link
|
@ -0,0 +1 @@
|
|||
nothing.yml
|
1
tests/integration/targets/setup_snap/tasks/D-RedHat-8.3.yml
Symbolic link
1
tests/integration/targets/setup_snap/tasks/D-RedHat-8.3.yml
Symbolic link
|
@ -0,0 +1 @@
|
|||
nothing.yml
|
1
tests/integration/targets/setup_snap/tasks/Debian.yml
Symbolic link
1
tests/integration/targets/setup_snap/tasks/Debian.yml
Symbolic link
|
@ -0,0 +1 @@
|
|||
default.yml
|
1
tests/integration/targets/setup_snap/tasks/RedHat.yml
Symbolic link
1
tests/integration/targets/setup_snap/tasks/RedHat.yml
Symbolic link
|
@ -0,0 +1 @@
|
|||
default.yml
|
21
tests/integration/targets/setup_snap/tasks/default.yml
Normal file
21
tests/integration/targets/setup_snap/tasks/default.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
- name: Install snapd
|
||||
package:
|
||||
name: "{{ snap_packages }}"
|
||||
state: present
|
||||
notify: Remove snapd
|
||||
|
||||
- name: Make sure that snapd is running
|
||||
service:
|
||||
name: snapd
|
||||
state: started
|
||||
|
||||
- name: Create link /snap
|
||||
file:
|
||||
src: /var/lib/snapd/snap
|
||||
dest: /snap
|
||||
state: link
|
||||
|
||||
- name: Inform that snap is installed
|
||||
set_fact:
|
||||
has_snap: true
|
23
tests/integration/targets/setup_snap/tasks/main.yml
Normal file
23
tests/integration/targets/setup_snap/tasks/main.yml
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
####################################################################
|
||||
# WARNING: These are designed specifically for Ansible tests #
|
||||
# and should not be used as examples of how to write Ansible roles #
|
||||
####################################################################
|
||||
|
||||
- name: Print information on which we distinguish
|
||||
debug:
|
||||
msg: "Distribution '{{ ansible_facts.distribution }}', version '{{ ansible_facts.distribution_version }}', OS family '{{ ansible_facts.os_family }}'"
|
||||
|
||||
- name: Include distribution specific tasks
|
||||
include_tasks: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- "D-{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_version }}.yml"
|
||||
- "D-{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml"
|
||||
- "{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}.yml"
|
||||
- "D-{{ ansible_facts.distribution }}.yml"
|
||||
- "{{ ansible_facts.os_family }}.yml"
|
||||
- "nothing.yml"
|
||||
paths:
|
||||
- "{{ role_path }}/tasks"
|
2
tests/integration/targets/setup_snap/tasks/nothing.yml
Normal file
2
tests/integration/targets/setup_snap/tasks/nothing.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
# Do nothing
|
Loading…
Add table
Add a link
Reference in a new issue