V1
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# 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
|
||||
destructive
|
||||
skip/aix
|
||||
skip/freebsd
|
||||
skip/osx
|
||||
skip/macos
|
||||
skip/rhel
|
||||
needs/root
|
||||
@@ -0,0 +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_remote_tmp_dir
|
||||
- setup_pkg_mgr
|
||||
@@ -0,0 +1,86 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
- vars:
|
||||
package_name: unarj
|
||||
block:
|
||||
- name: Make sure that {{ package_name }} is not installed
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: absent
|
||||
|
||||
- name: Install {{ package_name }} (check mode)
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: present
|
||||
check_mode: true
|
||||
register: install_1
|
||||
|
||||
- name: Install {{ package_name }}
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: present
|
||||
register: install_2
|
||||
|
||||
- name: Install {{ package_name }} (check mode, idempotent)
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: present
|
||||
check_mode: true
|
||||
register: install_3
|
||||
|
||||
- name: Install {{ package_name }} (idempotent)
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: present
|
||||
register: install_4
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- install_1 is changed
|
||||
- install_1.msg == 'Would have installed 1 packages'
|
||||
- install_2 is changed
|
||||
- install_2.msg == 'Installed 1 package(s)'
|
||||
- install_3 is not changed
|
||||
- install_3.msg == 'package(s) already installed'
|
||||
- install_4 is not changed
|
||||
- install_4.msg == 'package(s) already installed'
|
||||
|
||||
- name: Uninstall {{ package_name }} (check mode)
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: absent
|
||||
check_mode: true
|
||||
register: uninstall_1
|
||||
|
||||
- name: Uninstall {{ package_name }}
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: absent
|
||||
register: uninstall_2
|
||||
|
||||
- name: Uninstall {{ package_name }} (check mode, idempotent)
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: absent
|
||||
check_mode: true
|
||||
register: uninstall_3
|
||||
|
||||
- name: Uninstall {{ package_name }} (idempotent)
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: absent
|
||||
register: uninstall_4
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- uninstall_1 is changed
|
||||
- uninstall_1.msg == 'Would have removed 1 packages'
|
||||
- uninstall_2 is changed
|
||||
- uninstall_2.msg == 'Removed 1 package(s)'
|
||||
- uninstall_3 is not changed
|
||||
- uninstall_3.msg == 'package(s) already absent'
|
||||
- uninstall_4 is not changed
|
||||
- uninstall_4.msg == 'package(s) already absent'
|
||||
@@ -0,0 +1,85 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
- vars:
|
||||
package_name: ansible-test-foo
|
||||
username: ansible-regular-user
|
||||
block:
|
||||
- name: Install fakeroot
|
||||
pacman:
|
||||
state: present
|
||||
name:
|
||||
- fakeroot
|
||||
|
||||
- name: Create user
|
||||
user:
|
||||
name: '{{ username }}'
|
||||
home: '/home/{{ username }}'
|
||||
create_home: true
|
||||
|
||||
- name: Create directory
|
||||
file:
|
||||
path: '/home/{{ username }}/{{ package_name }}'
|
||||
state: directory
|
||||
owner: '{{ username }}'
|
||||
|
||||
- name: Create PKGBUILD
|
||||
copy:
|
||||
dest: '/home/{{ username }}/{{ package_name }}/PKGBUILD'
|
||||
content: |
|
||||
pkgname=('{{ package_name }}')
|
||||
pkgver=1.0.0
|
||||
pkgrel=1
|
||||
pkgdesc="Test removing a local package not in the repositories"
|
||||
arch=('any')
|
||||
license=('GPL v3+')
|
||||
owner: '{{ username }}'
|
||||
|
||||
- name: Build package
|
||||
command:
|
||||
cmd: su {{ username }} -c "makepkg -srf"
|
||||
chdir: '/home/{{ username }}/{{ package_name }}'
|
||||
|
||||
- name: Install package
|
||||
pacman:
|
||||
state: present
|
||||
name:
|
||||
- '/home/{{ username }}/{{ package_name }}/{{ package_name }}-1.0.0-1-any.pkg.tar.zst'
|
||||
|
||||
- name: Remove package (check mode)
|
||||
pacman:
|
||||
state: absent
|
||||
name:
|
||||
- '{{ package_name }}'
|
||||
check_mode: true
|
||||
register: remove_1
|
||||
|
||||
- name: Remove package
|
||||
pacman:
|
||||
state: absent
|
||||
name:
|
||||
- '{{ package_name }}'
|
||||
register: remove_2
|
||||
|
||||
- name: Remove package (idempotent)
|
||||
pacman:
|
||||
state: absent
|
||||
name:
|
||||
- '{{ package_name }}'
|
||||
register: remove_3
|
||||
|
||||
- name: Check conditions
|
||||
assert:
|
||||
that:
|
||||
- remove_1 is changed
|
||||
- remove_2 is changed
|
||||
- remove_3 is not changed
|
||||
|
||||
always:
|
||||
- name: Remove directory
|
||||
file:
|
||||
path: '{{ remote_tmp_dir }}/{{ package_name }}'
|
||||
state: absent
|
||||
become: true
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
####################################################################
|
||||
# WARNING: These are designed specifically for Ansible tests #
|
||||
# and should not be used as examples of how to write Ansible roles #
|
||||
####################################################################
|
||||
|
||||
# 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
|
||||
|
||||
- when: ansible_os_family == 'Archlinux'
|
||||
block:
|
||||
# Add more tests here by including more task files:
|
||||
- include: 'basic.yml'
|
||||
- include: 'package_urls.yml'
|
||||
- include: 'remove_nosave.yml'
|
||||
- include: 'update_cache.yml'
|
||||
- include: 'locally_installed_package.yml'
|
||||
- include: 'reason.yml'
|
||||
@@ -0,0 +1,219 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
- vars:
|
||||
http_port: 27617
|
||||
reg_pkg: ed
|
||||
url_pkg: lemon
|
||||
url_pkg_filename: url.pkg.zst
|
||||
url_pkg_path: '/tmp/'
|
||||
url_pkg_url: 'http://localhost:{{http_port}}/{{url_pkg_filename}}'
|
||||
file_pkg: hdparm
|
||||
file_pkg_path: /tmp/file.pkg.zst
|
||||
extra_pkg: core/sdparm
|
||||
extra_pkg_outfmt: sdparm
|
||||
block:
|
||||
- name: Make sure that test packages are not installed
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg}}'
|
||||
- '{{file_pkg}}'
|
||||
- '{{extra_pkg}}'
|
||||
state: absent
|
||||
- name: Make sure that url package is not cached
|
||||
file:
|
||||
path: '/var/cache/pacman/pkg/{{url_pkg_filename}}'
|
||||
state: absent
|
||||
|
||||
- name: Get URL for {{url_pkg}}
|
||||
command:
|
||||
cmd: pacman --sync --print-format "%l" {{url_pkg}}
|
||||
register: url_pkg_stdout
|
||||
- name: Download {{url_pkg}} pkg
|
||||
get_url:
|
||||
url: '{{url_pkg_stdout.stdout}}'
|
||||
dest: '{{url_pkg_path}}/{{url_pkg_filename}}'
|
||||
- name: Download {{url_pkg}} pkg sig
|
||||
get_url:
|
||||
url: '{{url_pkg_stdout.stdout}}.sig'
|
||||
dest: '{{url_pkg_path}}/{{url_pkg_filename}}.sig'
|
||||
- name: Host {{url_pkg}}
|
||||
shell:
|
||||
cmd: 'python -m http.server --directory {{url_pkg_path}} {{http_port}} >/dev/null 2>&1'
|
||||
async: 90
|
||||
poll: 0
|
||||
- name: Wait for http.server to come up online
|
||||
wait_for:
|
||||
host: 'localhost'
|
||||
port: '{{http_port}}'
|
||||
state: started
|
||||
|
||||
- name: Get URL for {{file_pkg}}
|
||||
command:
|
||||
cmd: pacman --sync --print-format "%l" {{file_pkg}}
|
||||
register: file_pkg_url
|
||||
- name: Download {{file_pkg}} pkg
|
||||
get_url:
|
||||
url: '{{file_pkg_url.stdout}}'
|
||||
dest: '{{file_pkg_path}}'
|
||||
|
||||
- name: Install packages from mixed sources (check mode)
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url}}'
|
||||
- '{{file_pkg_path}}'
|
||||
check_mode: True
|
||||
register: install_1
|
||||
|
||||
- name: Install packages from url (check mode, cached)
|
||||
pacman:
|
||||
name:
|
||||
- '{{url_pkg_url}}'
|
||||
check_mode: True
|
||||
register: install_1c
|
||||
- name: Delete cached {{url_pkg}}
|
||||
file:
|
||||
path: '/var/cache/pacman/pkg/{{url_pkg_filename}}'
|
||||
state: absent
|
||||
|
||||
- name: Install packages from mixed sources
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url}}'
|
||||
- '{{file_pkg_path}}'
|
||||
register: install_2
|
||||
- name: Delete cached {{url_pkg}}
|
||||
file:
|
||||
path: '/var/cache/pacman/pkg/{{url_pkg_filename}}'
|
||||
state: absent
|
||||
|
||||
- name: Install packages from mixed sources - (idempotency)
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url}}'
|
||||
- '{{file_pkg_path}}'
|
||||
register: install_3
|
||||
- name: Install packages from url - (idempotency, cached)
|
||||
pacman:
|
||||
name:
|
||||
- '{{url_pkg_url}}'
|
||||
register: install_3c
|
||||
- name: Delete cached {{url_pkg}}
|
||||
file:
|
||||
path: '/var/cache/pacman/pkg/{{url_pkg_filename}}'
|
||||
state: absent
|
||||
|
||||
- name: Install packages with their regular names (idempotency)
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg}}'
|
||||
- '{{file_pkg}}'
|
||||
register: install_4
|
||||
- name: Delete cached {{url_pkg}}
|
||||
file:
|
||||
path: '/var/cache/pacman/pkg/{{url_pkg_filename}}'
|
||||
state: absent
|
||||
|
||||
- name: Install new package with already installed packages from mixed sources
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url}}'
|
||||
- '{{file_pkg_path}}'
|
||||
- '{{extra_pkg}}'
|
||||
register: install_5
|
||||
- name: Delete cached {{url_pkg}}
|
||||
file:
|
||||
path: '/var/cache/pacman/pkg/{{url_pkg_filename}}'
|
||||
state: absent
|
||||
|
||||
- name: Uninstall packages - mixed sources (check mode)
|
||||
pacman:
|
||||
state: absent
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url}}'
|
||||
- '{{file_pkg_path}}'
|
||||
check_mode: True
|
||||
register: uninstall_1
|
||||
- name: Uninstall packages - url (check mode, cached)
|
||||
pacman:
|
||||
state: absent
|
||||
name:
|
||||
- '{{url_pkg_url}}'
|
||||
check_mode: True
|
||||
register: uninstall_1c
|
||||
- name: Delete cached {{url_pkg}}
|
||||
file:
|
||||
path: '/var/cache/pacman/pkg/{{url_pkg_filename}}'
|
||||
state: absent
|
||||
|
||||
- name: Uninstall packages - mixed sources
|
||||
pacman:
|
||||
state: absent
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url}}'
|
||||
- '{{file_pkg_path}}'
|
||||
register: uninstall_2
|
||||
- name: Delete cached {{url_pkg}}
|
||||
file:
|
||||
path: '/var/cache/pacman/pkg/{{url_pkg_filename}}'
|
||||
state: absent
|
||||
|
||||
- name: Uninstall packages - mixed sources (idempotency)
|
||||
pacman:
|
||||
state: absent
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url}}'
|
||||
- '{{file_pkg_path}}'
|
||||
register: uninstall_3
|
||||
|
||||
- name: Uninstall package - url (idempotency, cached)
|
||||
pacman:
|
||||
state: absent
|
||||
name:
|
||||
- '{{url_pkg_url}}'
|
||||
register: uninstall_3c
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- install_1 is changed
|
||||
- install_1.msg == 'Would have installed 3 packages'
|
||||
- install_1.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort()
|
||||
- install_1c is changed
|
||||
- install_1c.msg == 'Would have installed 1 packages'
|
||||
- install_1c.packages|sort() == [url_pkg]
|
||||
- install_2 is changed
|
||||
- install_2.msg == 'Installed 3 package(s)'
|
||||
- install_2.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort()
|
||||
- install_3 is not changed
|
||||
- install_3.msg == 'package(s) already installed'
|
||||
- install_3c is not changed
|
||||
- install_3c.msg == 'package(s) already installed'
|
||||
- install_4 is not changed
|
||||
- install_4.msg == 'package(s) already installed'
|
||||
- install_5 is changed
|
||||
- install_5.msg == 'Installed 1 package(s)'
|
||||
- install_5.packages == [extra_pkg_outfmt]
|
||||
- uninstall_1 is changed
|
||||
- uninstall_1.msg == 'Would have removed 3 packages'
|
||||
- uninstall_1.packages | length() == 3 # pkgs have versions here
|
||||
- uninstall_1c is changed
|
||||
- uninstall_1c.msg == 'Would have removed 1 packages'
|
||||
- uninstall_1c.packages | length() == 1 # pkgs have versions here
|
||||
- uninstall_2 is changed
|
||||
- uninstall_2.msg == 'Removed 3 package(s)'
|
||||
- uninstall_2.packages | length() == 3
|
||||
- uninstall_3 is not changed
|
||||
- uninstall_3.msg == 'package(s) already absent'
|
||||
- uninstall_3c is not changed
|
||||
- uninstall_3c.msg == 'package(s) already absent'
|
||||
@@ -0,0 +1,101 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
- vars:
|
||||
reg_pkg: ed
|
||||
url_pkg: lemon
|
||||
file_pkg: hdparm
|
||||
file_pkg_path: /tmp/pkg.zst
|
||||
extra_pkg: core/sdparm
|
||||
extra_pkg_outfmt: sdparm
|
||||
block:
|
||||
- name: Make sure that test packages are not installed
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg}}'
|
||||
- '{{file_pkg}}'
|
||||
- '{{extra_pkg}}'
|
||||
state: absent
|
||||
|
||||
- name: Get URL for {{url_pkg}}
|
||||
command:
|
||||
cmd: pacman --sync --print-format "%l" {{url_pkg}}
|
||||
register: url_pkg_url
|
||||
|
||||
- name: Get URL for {{file_pkg}}
|
||||
command:
|
||||
cmd: pacman --sync --print-format "%l" {{file_pkg}}
|
||||
register: file_pkg_url
|
||||
- name: Download {{file_pkg}} pkg
|
||||
get_url:
|
||||
url: '{{file_pkg_url.stdout}}'
|
||||
dest: '{{file_pkg_path}}'
|
||||
|
||||
- name: Install packages from mixed sources as dependency (check mode)
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url.stdout}}'
|
||||
- '{{file_pkg_path}}'
|
||||
reason: dependency
|
||||
check_mode: True
|
||||
register: install_1
|
||||
|
||||
- name: Install packages from mixed sources as explicit
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url.stdout}}'
|
||||
- '{{file_pkg_path}}'
|
||||
reason: explicit
|
||||
register: install_2
|
||||
|
||||
- name: Install packages from mixed sources with new packages being installed as dependency - (idempotency)
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url.stdout}}'
|
||||
- '{{file_pkg_path}}'
|
||||
reason: dependency
|
||||
register: install_3
|
||||
|
||||
- name: Install new package with already installed packages from mixed sources as dependency
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url.stdout}}'
|
||||
- '{{file_pkg_path}}'
|
||||
- '{{extra_pkg}}'
|
||||
reason: dependency
|
||||
register: install_4
|
||||
|
||||
- name: Set install reason for all packages to dependency
|
||||
pacman:
|
||||
name:
|
||||
- '{{reg_pkg}}'
|
||||
- '{{url_pkg_url.stdout}}'
|
||||
- '{{file_pkg_path}}'
|
||||
- '{{extra_pkg}}'
|
||||
reason: dependency
|
||||
reason_for: all
|
||||
register: install_5
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- install_1 is changed
|
||||
- install_1.msg == 'Would have installed 3 packages'
|
||||
- install_1.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort()
|
||||
- install_2 is changed
|
||||
- install_2.msg == 'Installed 3 package(s)'
|
||||
- install_2.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort()
|
||||
- install_3 is not changed
|
||||
- install_3.msg == 'package(s) already installed'
|
||||
- install_4 is changed
|
||||
- install_4.msg == 'Installed 1 package(s)'
|
||||
- install_4.packages == [extra_pkg_outfmt]
|
||||
- install_5 is changed
|
||||
- install_5.msg == 'Installed 3 package(s)'
|
||||
- install_5.packages|sort() == [reg_pkg, url_pkg, file_pkg]|sort()
|
||||
@@ -0,0 +1,74 @@
|
||||
---
|
||||
# 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
|
||||
|
||||
- vars:
|
||||
package_name: xinetd
|
||||
config_file: /etc/xinetd.conf
|
||||
block:
|
||||
- name: Make sure that {{ package_name }} is not installed
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: absent
|
||||
- name: Make sure {{config_file}}.pacsave file doesn't exist
|
||||
file:
|
||||
path: '{{config_file}}.pacsave'
|
||||
state: absent
|
||||
|
||||
- name: Install {{ package_name }}
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: present
|
||||
|
||||
- name: Modify {{config_file}}
|
||||
blockinfile:
|
||||
path: '{{config_file}}'
|
||||
block: |
|
||||
# something something
|
||||
# on 2 lines
|
||||
|
||||
- name: Remove {{ package_name }} - generate pacsave
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: absent
|
||||
- name: Make sure {{config_file}}.pacsave exists
|
||||
stat:
|
||||
path: '{{config_file}}.pacsave'
|
||||
register: pacsave_st_1
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- pacsave_st_1.stat.exists
|
||||
|
||||
- name: Delete {{config_file}}.pacsave
|
||||
file:
|
||||
path: '{{config_file}}.pacsave'
|
||||
state: absent
|
||||
|
||||
- name: Install {{ package_name }}
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
state: present
|
||||
|
||||
- name: Modify {{config_file}}
|
||||
blockinfile:
|
||||
path: '{{config_file}}'
|
||||
block: |
|
||||
# something something
|
||||
# on 2 lines
|
||||
|
||||
- name: Remove {{ package_name }} - nosave
|
||||
pacman:
|
||||
name: '{{ package_name }}'
|
||||
remove_nosave: yes
|
||||
state: absent
|
||||
|
||||
- name: Make sure {{config_file}}.pacsave does not exist
|
||||
stat:
|
||||
path: '{{config_file}}.pacsave'
|
||||
register: pacsave_st_2
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- not pacsave_st_2.stat.exists
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
# 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 cache is updated
|
||||
pacman:
|
||||
update_cache: true
|
||||
|
||||
- name: Update package cache again (should not be changed)
|
||||
pacman:
|
||||
update_cache: true
|
||||
register: update_cache_idem
|
||||
|
||||
- name: Update package cache again with force=true (should be changed)
|
||||
pacman:
|
||||
update_cache: true
|
||||
force: true
|
||||
register: update_cache_force
|
||||
|
||||
- name: Check conditions
|
||||
assert:
|
||||
that:
|
||||
- update_cache_idem is not changed
|
||||
- update_cache_idem.cache_updated == false
|
||||
- update_cache_force is changed
|
||||
- update_cache_force.cache_updated == true
|
||||
Reference in New Issue
Block a user