collection 교체

This commit is contained in:
정훈 변
2024-02-23 16:37:40 +09:00
parent b494779b5b
commit 3fd554eee9
38862 changed files with 220204 additions and 6600073 deletions

View File

@@ -1,5 +1,12 @@
shippable/posix/group1
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
azp/posix/1
azp/posix/vm
skip/aix
skip/alpine
skip/fedora
skip/freebsd
skip/osx
skip/macos

View File

@@ -1,2 +1,8 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
dependencies:
- setup_snap
- setup_remote_tmp_dir

View File

@@ -4,186 +4,20 @@
# and should not be used as examples of how to write Ansible roles #
####################################################################
- block:
- name: Make sure package is not installed (hello-world)
community.general.snap:
name: hello-world
state: absent
- name: Install package (hello-world) (check mode)
community.general.snap:
name: hello-world
state: present
register: install_check
check_mode: true
- name: Install package (hello-world)
community.general.snap:
name: hello-world
state: present
register: install
- name: Install package again (hello-world) (check mode)
community.general.snap:
name: hello-world
state: present
register: install_again_check
check_mode: true
- name: Install package again (hello-world)
community.general.snap:
name: hello-world
state: present
register: install_again
- name: Assert package has been installed just once (hello-world)
assert:
that:
- install is changed
- install_check is changed
- install_again is not changed
- install_again_check is not changed
- name: Check package has been installed correctly (hello-world)
command: hello-world
environment:
PATH: /var/lib/snapd/snap/bin/
- name: Remove package (hello-world) (check mode)
community.general.snap:
name: hello-world
state: absent
register: remove_check
check_mode: true
- name: Remove package (hello-world)
community.general.snap:
name: hello-world
state: absent
register: remove
- name: Remove package again (hello-world) (check mode)
community.general.snap:
name: hello-world
state: absent
register: remove_again_check
check_mode: true
- name: Remove package again (hello-world)
community.general.snap:
name: hello-world
state: absent
register: remove_again
- name: Assert package has been removed just once (hello-world)
assert:
that:
- remove is changed
- remove_check is changed
- remove_again is not changed
- remove_again_check is not changed
- name: Make sure package from classic snap is not installed (nvim)
community.general.snap:
name: nvim
state: absent
- name: Install package from classic snap (nvim)
community.general.snap:
name: nvim
state: present
classic: true
register: classic_install
# testing classic idempotency
- name: Install package from classic snap again (nvim)
community.general.snap:
name: nvim
state: present
classic: true
register: classic_install_again
- name: Assert package has been installed just once (nvim)
assert:
that:
- classic_install is changed
- classic_install_again is not changed
# this is just testing if a package which has been installed
# with true classic can be removed without setting classic to true
- name: Remove package from classic snap without setting classic to true (nvim)
community.general.snap:
name: nvim
state: absent
register: classic_remove_without_true_classic
- name: Remove package from classic snap with setting classic to true (nvim)
community.general.snap:
name: nvim
state: absent
classic: true
register: classic_remove_with_true_classic
- name: Assert package has been removed without setting classic to true (nvim)
assert:
that:
- classic_remove_without_true_classic is changed
- classic_remove_with_true_classic is not changed
- name: Make sure package is not installed (uhttpd)
community.general.snap:
name: uhttpd
state: absent
- name: Install package (uhttpd)
community.general.snap:
name: uhttpd
state: present
register: install
- name: Install package (uhttpd)
community.general.snap:
name: uhttpd
state: present
options:
- "listening-port=8080"
register: install_with_option
- name: Install package again with option (uhttpd)
community.general.snap:
name: uhttpd
state: present
options:
- "listening-port=8080"
register: install_with_option_again
- name: Install package again with different options (uhttpd)
community.general.snap:
name: uhttpd
state: present
options:
- "listening-port=8088"
- "document-root-dir=/tmp"
register: install_with_option_changed
- name: Remove package (uhttpd)
community.general.snap:
name: uhttpd
state: absent
register: remove
- name: Assert package has been installed with options just once and only changed options trigger a change (uhttpd)
assert:
that:
- install is changed
- install_with_option is changed
- "install_with_option.options_changed[0] == 'uhttpd:listening-port=8080'"
- install_with_option_again is not changed
- install_with_option_changed is changed
- "'uhttpd:listening-port=8088' in install_with_option_changed.options_changed"
- "'uhttpd:document-root-dir=/tmp' in install_with_option_changed.options_changed"
- "'uhttpd:listening-port=8080' not in install_with_option_changed.options_changed"
- remove is changed
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Has-snap include
when: has_snap
block:
- name: Include test
ansible.builtin.include_tasks: test.yml
- name: Include test_channel
ansible.builtin.include_tasks: test_channel.yml
- name: Include test_dangerous
ansible.builtin.include_tasks: test_dangerous.yml
- name: Include test_3dash
ansible.builtin.include_tasks: test_3dash.yml
- name: Include test_empty_list
ansible.builtin.include_tasks: test_empty_list.yml

View File

@@ -0,0 +1,235 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Make sure package is not installed (hello-world)
community.general.snap:
name: hello-world
state: absent
- name: Install package (hello-world) (check mode)
community.general.snap:
name: hello-world
state: present
register: install_check
check_mode: true
- name: Install package (hello-world)
community.general.snap:
name: hello-world
state: present
register: install
- name: Install package again (hello-world) (check mode)
community.general.snap:
name: hello-world
state: present
register: install_again_check
check_mode: true
- name: Install package again (hello-world)
community.general.snap:
name: hello-world
state: present
register: install_again
- name: Assert package has been installed just once (hello-world)
assert:
that:
- install is changed
- install_check is changed
- install_again is not changed
- install_again_check is not changed
- name: Check package has been installed correctly (hello-world)
command: hello-world
environment:
PATH: /snap/bin/
- name: Remove package (hello-world) (check mode)
community.general.snap:
name: hello-world
state: absent
register: remove_check
check_mode: true
- name: Remove package (hello-world)
community.general.snap:
name: hello-world
state: absent
register: remove
- name: Remove package again (hello-world) (check mode)
community.general.snap:
name: hello-world
state: absent
register: remove_again_check
check_mode: true
- name: Remove package again (hello-world)
community.general.snap:
name: hello-world
state: absent
register: remove_again
- name: Assert package has been removed just once (hello-world)
assert:
that:
- remove is changed
- remove_check is changed
- remove_again is not changed
- remove_again_check is not changed
- name: Make sure package from classic snap is not installed (nvim)
community.general.snap:
name: nvim
state: absent
- name: Install package from classic snap (nvim)
community.general.snap:
name: nvim
state: present
classic: true
register: classic_install
# testing classic idempotency
- name: Install package from classic snap again (nvim)
community.general.snap:
name: nvim
state: present
classic: true
register: classic_install_again
- name: Assert package has been installed just once (nvim)
assert:
that:
- classic_install is changed
- classic_install_again is not changed
# this is just testing if a package which has been installed
# with true classic can be removed without setting classic to true
- name: Remove package from classic snap without setting classic to true (nvim)
community.general.snap:
name: nvim
state: absent
register: classic_remove_without_true_classic
- name: Remove package from classic snap with setting classic to true (nvim)
community.general.snap:
name: nvim
state: absent
classic: true
register: classic_remove_with_true_classic
- name: Assert package has been removed without setting classic to true (nvim)
assert:
that:
- classic_remove_without_true_classic is changed
- classic_remove_with_true_classic is not changed
- name: Make sure package is not installed (uhttpd)
community.general.snap:
name: uhttpd
state: absent
- name: Install package (uhttpd)
community.general.snap:
name: uhttpd
state: present
register: install
- name: Install package (uhttpd)
community.general.snap:
name: uhttpd
state: present
options:
- "listening-port=8080"
register: install_with_option
- name: Install package again with option (uhttpd)
community.general.snap:
name: uhttpd
state: present
options:
- "listening-port=8080"
register: install_with_option_again
- name: Install package again with different options (uhttpd)
community.general.snap:
name: uhttpd
state: present
options:
- "listening-port=8088"
- "document-root-dir=/tmp"
register: install_with_option_changed
- name: Remove package (uhttpd)
community.general.snap:
name: uhttpd
state: absent
register: remove
- name: Assert package has been installed with options just once and only changed options trigger a change (uhttpd)
assert:
that:
- install is changed
- install_with_option is changed
- "install_with_option.options_changed[0] == 'uhttpd:listening-port=8080'"
- install_with_option_again is not changed
- install_with_option_changed is changed
- "'uhttpd:listening-port=8088' in install_with_option_changed.options_changed"
- "'uhttpd:document-root-dir=/tmp' in install_with_option_changed.options_changed"
- "'uhttpd:listening-port=8080' not in install_with_option_changed.options_changed"
- remove is changed
- name: Install two packages at the same time
community.general.snap:
name:
- hello-world
- uhttpd
state: present
register: install_two
- name: Install two packages at the same time (again)
community.general.snap:
name:
- hello-world
- uhttpd
state: present
register: install_two_again
- name: Remove packages (hello-world & uhttpd)
community.general.snap:
name:
- hello-world
- uhttpd
state: absent
register: install_two_remove
- name: Remove packages again (hello-world & uhttpd)
community.general.snap:
name:
- hello-world
- uhttpd
state: absent
register: install_two_remove_again
- name: Assert installation of two packages
assert:
that:
- install_two is changed
- "'hello-world' in install_two.snaps_installed"
- "'uhttpd' in install_two.snaps_installed"
- install_two.snaps_removed is not defined
- install_two_again is not changed
- install_two_again.snaps_installed is not defined
- install_two_again.snaps_removed is not defined
- install_two_remove is changed
- install_two_again.snaps_installed is not defined
- "'hello-world' in install_two_remove.snaps_removed"
- "'uhttpd' in install_two_remove.snaps_removed"
- install_two_remove_again is not changed
- install_two_remove_again.snaps_installed is not defined
- install_two_remove_again.snaps_removed is not defined

View File

@@ -0,0 +1,31 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Make sure packages are not installed (3 dashes)
community.general.snap:
name:
- bw
- shellcheck
state: absent
- name: Install package with 3 dashes in description (check)
community.general.snap:
name:
- bw
- shellcheck
state: present
check_mode: true
register: install_3dash_check
- name: Remove packages (3 dashes)
community.general.snap:
name:
- bw
- shellcheck
state: absent
- assert:
that:
- install_3dash_check is changed

View File

@@ -0,0 +1,79 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Make sure package is not installed (microk8s)
community.general.snap:
name: microk8s
state: absent
# Test for https://github.com/ansible-collections/community.general/issues/1606
- name: Install package (microk8s)
community.general.snap:
name: microk8s
classic: true
state: present
register: install_microk8s
- name: Install package with channel (microk8s)
community.general.snap:
name: microk8s
classic: true
channel: 1.20/stable
state: present
register: install_microk8s_chan
- name: Install package with channel (microk8s) again
community.general.snap:
name: microk8s
classic: true
channel: 1.20/stable
state: present
register: install_microk8s_chan_again
- name: Remove package (microk8s)
community.general.snap:
name: microk8s
state: absent
register: remove_microk8s
- assert:
that:
- install_microk8s is changed
- install_microk8s_chan is changed
- install_microk8s_chan_again is not changed
- remove_microk8s is changed
- name: Install package (shellcheck)
community.general.snap:
name: shellcheck
state: present
register: install_shellcheck
- name: Install package with channel (shellcheck)
community.general.snap:
name: shellcheck
channel: edge
state: present
register: install_shellcheck_chan
- name: Install package with channel (shellcheck) again
community.general.snap:
name: shellcheck
channel: edge
state: present
register: install_shellcheck_chan_again
- name: Remove package (shellcheck)
community.general.snap:
name: shellcheck
state: absent
register: remove_shellcheck
- assert:
that:
- install_shellcheck is changed
- install_shellcheck_chan is changed
- install_shellcheck_chan_again is not changed
- remove_shellcheck is changed

View File

@@ -0,0 +1,51 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Make sure package is not installed (cider)
community.general.snap:
name: cider
state: absent
- name: Download cider snap
ansible.builtin.get_url:
url: https://github.com/ciderapp/cider-releases/releases/download/v1.6.0/cider_1.6.0_amd64.snap
dest: "{{ remote_tmp_dir }}/cider_1.6.0_amd64.snap"
mode: "0644"
# Test for https://github.com/ansible-collections/community.general/issues/5715
- name: Install package from file (check)
community.general.snap:
name: "{{ remote_tmp_dir }}/cider_1.6.0_amd64.snap"
dangerous: true
state: present
check_mode: true
register: install_dangerous_check
- name: Install package from file
community.general.snap:
name: "{{ remote_tmp_dir }}/cider_1.6.0_amd64.snap"
dangerous: true
state: present
register: install_dangerous
- name: Install package from file
community.general.snap:
name: "{{ remote_tmp_dir }}/cider_1.6.0_amd64.snap"
dangerous: true
state: present
register: install_dangerous_idempot
- name: Remove package
community.general.snap:
name: cider
state: absent
register: remove_dangerous
- assert:
that:
- install_dangerous_check is changed
- install_dangerous is changed
- install_dangerous_idempot is not changed
- remove_dangerous is changed

View File

@@ -0,0 +1,14 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Empty list present
community.general.snap:
name: []
state: present
- name: Empty list absent
community.general.snap:
name: []
state: absent