We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If one uses a code snippet like:
- name: install the latest version of Apache and MariaDB package: name: - httpd - mariadb-server state: latest
he would get an error:
Incorrect type. Expected "string".
While the package module documentation doesn't explicitly mention this, it is clear from the Examples section that one could also use a list for the name parameter.
package
name
The text was updated successfully, but these errors were encountered:
I have the same issue. When one have a task in a role with the content:
- name: Install required packages yum: name: - yum-utils - device-mapper-persistent-data - lvm2 state: present
Validation error is: Incorrect type. Expected "string". Though a playbook, using the role, does play without any issues.
Sorry, something went wrong.
The same problem is with the yum and apt modules.
yum
apt
In the specific package modules it is mentioned: https://docs.ansible.com/ansible/2.9/modules/yum_module.html#parameter-name
To operate on several packages this can accept a comma separated string of packages or (as of 2.0) a list of packages.
https://docs.ansible.com/ansible/2.9/modules/apt_module.html#parameter-name
A list of package names [...]
In Notes for both yum and apt
When used with a loop: each package will be processed individually, it is much more efficient to pass the list directly to the name option.
Change type of name field for package modules to list
96c5955
Fixes VSChina#260
Successfully merging a pull request may close this issue.
Environment
Summary
If one uses a code snippet like:
he would get an error:
While the
package
module documentation doesn't explicitly mention this, it is clear from the Examples section that one could also use a list for thename
parameter.The text was updated successfully, but these errors were encountered: