diff --git a/tests/integration/targets/snap/defaults/main.yml b/tests/integration/targets/setup_snap/defaults/main.yml similarity index 100% rename from tests/integration/targets/snap/defaults/main.yml rename to tests/integration/targets/setup_snap/defaults/main.yml diff --git a/tests/integration/targets/snap/handlers/main.yml b/tests/integration/targets/setup_snap/handlers/main.yml similarity index 100% rename from tests/integration/targets/snap/handlers/main.yml rename to tests/integration/targets/setup_snap/handlers/main.yml diff --git a/tests/integration/targets/setup_snap/meta/main.yml b/tests/integration/targets/setup_snap/meta/main.yml new file mode 100644 index 0000000000..0e51c36ebd --- /dev/null +++ b/tests/integration/targets/setup_snap/meta/main.yml @@ -0,0 +1,3 @@ +dependencies: + - setup_pkg_mgr + - setup_epel diff --git a/tests/integration/targets/snap/tasks/Debian.yml b/tests/integration/targets/setup_snap/tasks/D-Fedora.yml similarity index 100% rename from tests/integration/targets/snap/tasks/Debian.yml rename to tests/integration/targets/setup_snap/tasks/D-Fedora.yml diff --git a/tests/integration/targets/setup_snap/tasks/D-RedHat-8.2.yml b/tests/integration/targets/setup_snap/tasks/D-RedHat-8.2.yml new file mode 120000 index 0000000000..0b06951496 --- /dev/null +++ b/tests/integration/targets/setup_snap/tasks/D-RedHat-8.2.yml @@ -0,0 +1 @@ +nothing.yml \ No newline at end of file diff --git a/tests/integration/targets/setup_snap/tasks/D-RedHat-8.3.yml b/tests/integration/targets/setup_snap/tasks/D-RedHat-8.3.yml new file mode 120000 index 0000000000..0b06951496 --- /dev/null +++ b/tests/integration/targets/setup_snap/tasks/D-RedHat-8.3.yml @@ -0,0 +1 @@ +nothing.yml \ No newline at end of file diff --git a/tests/integration/targets/snap_alias/tasks/Debian.yml b/tests/integration/targets/setup_snap/tasks/Debian.yml similarity index 100% rename from tests/integration/targets/snap_alias/tasks/Debian.yml rename to tests/integration/targets/setup_snap/tasks/Debian.yml diff --git a/tests/integration/targets/snap/tasks/RedHat.yml b/tests/integration/targets/setup_snap/tasks/RedHat.yml similarity index 100% rename from tests/integration/targets/snap/tasks/RedHat.yml rename to tests/integration/targets/setup_snap/tasks/RedHat.yml diff --git a/tests/integration/targets/snap/tasks/default.yml b/tests/integration/targets/setup_snap/tasks/default.yml similarity index 100% rename from tests/integration/targets/snap/tasks/default.yml rename to tests/integration/targets/setup_snap/tasks/default.yml diff --git a/tests/integration/targets/setup_snap/tasks/main.yml b/tests/integration/targets/setup_snap/tasks/main.yml new file mode 100644 index 0000000000..26e02ddc56 --- /dev/null +++ b/tests/integration/targets/setup_snap/tasks/main.yml @@ -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" diff --git a/tests/integration/targets/snap/tasks/nothing.yml b/tests/integration/targets/setup_snap/tasks/nothing.yml similarity index 100% rename from tests/integration/targets/snap/tasks/nothing.yml rename to tests/integration/targets/setup_snap/tasks/nothing.yml diff --git a/tests/integration/targets/snap/aliases b/tests/integration/targets/snap/aliases index 69547e21e7..ee303bf346 100644 --- a/tests/integration/targets/snap/aliases +++ b/tests/integration/targets/snap/aliases @@ -4,4 +4,3 @@ skip/freebsd skip/osx skip/macos skip/docker -disabled # FIXME diff --git a/tests/integration/targets/snap/meta/main.yml b/tests/integration/targets/snap/meta/main.yml index 0e51c36ebd..6ee9a022c1 100644 --- a/tests/integration/targets/snap/meta/main.yml +++ b/tests/integration/targets/snap/meta/main.yml @@ -1,3 +1,2 @@ dependencies: - - setup_pkg_mgr - - setup_epel + - setup_snap diff --git a/tests/integration/targets/snap/tasks/Fedora.yml b/tests/integration/targets/snap/tasks/Fedora.yml deleted file mode 120000 index 0abaec1677..0000000000 --- a/tests/integration/targets/snap/tasks/Fedora.yml +++ /dev/null @@ -1 +0,0 @@ -default.yml \ No newline at end of file diff --git a/tests/integration/targets/snap/tasks/main.yml b/tests/integration/targets/snap/tasks/main.yml index 0f8c9b4c26..9ca431bafe 100644 --- a/tests/integration/targets/snap/tasks/main.yml +++ b/tests/integration/targets/snap/tasks/main.yml @@ -4,19 +4,6 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### -- name: Include distribution specific tasks - include_tasks: "{{ lookup('first_found', params) }}" - vars: - params: - files: - - "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml" - - "{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}.yml" - - "{{ ansible_facts.distribution }}.yml" - - "{{ ansible_facts.os_family }}.yml" - - "nothing.yml" - paths: - - "{{ role_path }}/tasks" - - block: - name: Make sure package is not installed community.general.snap: diff --git a/tests/integration/targets/snap_alias/aliases b/tests/integration/targets/snap_alias/aliases index 69547e21e7..ee303bf346 100644 --- a/tests/integration/targets/snap_alias/aliases +++ b/tests/integration/targets/snap_alias/aliases @@ -4,4 +4,3 @@ skip/freebsd skip/osx skip/macos skip/docker -disabled # FIXME diff --git a/tests/integration/targets/snap_alias/defaults/main.yml b/tests/integration/targets/snap_alias/defaults/main.yml deleted file mode 100644 index 2290001f7e..0000000000 --- a/tests/integration/targets/snap_alias/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ -has_snap: false - -snap_packages: - - snapd diff --git a/tests/integration/targets/snap_alias/handlers/main.yml b/tests/integration/targets/snap_alias/handlers/main.yml deleted file mode 100644 index a80cc98e49..0000000000 --- a/tests/integration/targets/snap_alias/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Remove snapd - package: - name: "{{ snap_packages }}" - state: absent diff --git a/tests/integration/targets/snap_alias/meta/main.yml b/tests/integration/targets/snap_alias/meta/main.yml index 0e51c36ebd..6ee9a022c1 100644 --- a/tests/integration/targets/snap_alias/meta/main.yml +++ b/tests/integration/targets/snap_alias/meta/main.yml @@ -1,3 +1,2 @@ dependencies: - - setup_pkg_mgr - - setup_epel + - setup_snap diff --git a/tests/integration/targets/snap_alias/tasks/Fedora.yml b/tests/integration/targets/snap_alias/tasks/Fedora.yml deleted file mode 120000 index 0abaec1677..0000000000 --- a/tests/integration/targets/snap_alias/tasks/Fedora.yml +++ /dev/null @@ -1 +0,0 @@ -default.yml \ No newline at end of file diff --git a/tests/integration/targets/snap_alias/tasks/RedHat.yml b/tests/integration/targets/snap_alias/tasks/RedHat.yml deleted file mode 120000 index 0abaec1677..0000000000 --- a/tests/integration/targets/snap_alias/tasks/RedHat.yml +++ /dev/null @@ -1 +0,0 @@ -default.yml \ No newline at end of file diff --git a/tests/integration/targets/snap_alias/tasks/default.yml b/tests/integration/targets/snap_alias/tasks/default.yml deleted file mode 100644 index 938addc33a..0000000000 --- a/tests/integration/targets/snap_alias/tasks/default.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- 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 diff --git a/tests/integration/targets/snap_alias/tasks/main.yml b/tests/integration/targets/snap_alias/tasks/main.yml index 2ed419bf57..81b7c3618a 100644 --- a/tests/integration/targets/snap_alias/tasks/main.yml +++ b/tests/integration/targets/snap_alias/tasks/main.yml @@ -4,19 +4,6 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### -- name: Include distribution specific tasks - include_tasks: "{{ lookup('first_found', params) }}" - vars: - params: - files: - - "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml" - - "{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}.yml" - - "{{ ansible_facts.distribution }}.yml" - - "{{ ansible_facts.os_family }}.yml" - - "nothing.yml" - paths: - - "{{ role_path }}/tasks" - - name: Test include_tasks: test.yml when: has_snap diff --git a/tests/integration/targets/snap_alias/tasks/nothing.yml b/tests/integration/targets/snap_alias/tasks/nothing.yml deleted file mode 100644 index 11642d1fcd..0000000000 --- a/tests/integration/targets/snap_alias/tasks/nothing.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# Do nothing