mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-28 01:16:41 +00:00
pkgng: test install multiple packages
Multiple packages should install with a single invocation of the `pkg` utility.
This commit is contained in:
@@ -170,6 +170,36 @@
|
||||
- pkgng_example4.changed
|
||||
- not pkgng_example4_idempotent.changed
|
||||
|
||||
##
|
||||
## pkgng - example - Install multiple packages in one command
|
||||
##
|
||||
- name: Remove test package (checkmode)
|
||||
pkgng:
|
||||
name: '{{ pkgng_test_pkg_name }}'
|
||||
state: absent
|
||||
check_mode: yes
|
||||
register: pkgng_example5_prepare
|
||||
|
||||
- name: Install three packages
|
||||
pkgng:
|
||||
name: '{{ pkgng_test_pkg_name }} fish busybox'
|
||||
register: pkgng_example5
|
||||
|
||||
- name: Remove three packages
|
||||
pkgng:
|
||||
name: '{{ pkgng_test_pkg_name }} fish busybox'
|
||||
state: absent
|
||||
register: pkgng_example5_cleanup
|
||||
|
||||
- name: Ensure pkgng installs multiple packages with one command
|
||||
assert:
|
||||
that:
|
||||
- not pkgng_example5_prepare.changed
|
||||
- pkgng_example5.changed
|
||||
- "'Number of packages to be installed: 3' is in(pkgng_example5.stdout_lines)"
|
||||
- "(pkgng_example5.stdout | regex_findall('^Number of packages to be', multiline=True) | count) == 1"
|
||||
- pkgng_example5_cleanup.changed
|
||||
|
||||
##
|
||||
## pkgng - example - Install single package in jail
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user