When the code is updated to only install a single package this can be rewritten to the following:
example_packages:
pkg.installed:
- name: package
But when the names argument is kept it will result in the error The 'names' argument in state 'example_packages in SLS 'example' needs to be formed as a list`:
example_packages:
pkg.installed:
- names: package
This can be prevented by checking if the names argument in the pkg.installed modules actually contains a list.
When using the
pkg.installed
module it's possible to installed multiple packages by providing a list, e.g.:When the code is updated to only install a single package this can be rewritten to the following:
But when the
names
argument is kept it will result in the errorThe 'names' argument in state 'example_packages
in SLS 'example' needs to be formed as a list`:This can be prevented by checking if the
names
argument in thepkg.installed
modules actually contains a list.