You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected the playbook to complete successfully (even though no packages will be installed since the list is empty).
Actual Results
The playbook fails as follows:
Module failed with exception: list index out of range
A workaround is to add the following:
- name: install snap packagescommunity.general.snap:
name: "{{ snap_packages }}"when: snap_packages.0 is defined
However this isn't necessary for other similar commands like ansible.builtin.apt and worked on older versions of community.general, so this seems like a bug.
Code of Conduct
I agree to follow the Ansible Code of Conduct
The text was updated successfully, but these errors were encountered:
Summary
When attempting to install a list of snap packages, if the list of snap packages is empty, an error is thrown and the playbook execution fails.
Issue Type
Bug Report
Component Name
snap
Ansible Version
Community.general Version
Configuration
OS / Environment
Ubuntu 22.04
Steps to Reproduce
defaults/main.yml:
tasks/main.yml:
Expected Results
I expected the playbook to complete successfully (even though no packages will be installed since the list is empty).
Actual Results
The playbook fails as follows:
Module failed with exception: list index out of range
A workaround is to add the following:
However this isn't necessary for other similar commands like
ansible.builtin.apt
and worked on older versions ofcommunity.general
, so this seems like a bug.Code of Conduct
The text was updated successfully, but these errors were encountered: