Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/install-ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ fi

# Install community.general collection (idempotent)
# Required for yaml callback plugin, json_query filter, and many common modules
if ansible-galaxy collection list community.general &>/dev/null; then
# Note: ansible-galaxy collection list exits 0 even when not installed,
# so we check the output for the collection name instead of the exit code.
if ansible-galaxy collection list community.general 2>/dev/null | grep -q community.general; then
log_info "community.general collection is already installed, skipping"
else
log_info "Installing community.general Ansible collection"
Expand Down
4 changes: 3 additions & 1 deletion tests/test-ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ check_tool "ansible-lint" "--version"
check_tool "molecule" "--version"

# Verify community.general collection is installed
if ansible-galaxy collection list community.general &>/dev/null; then
# Note: ansible-galaxy collection list exits 0 even when not installed,
# so we check the output for the collection name instead of the exit code.
if ansible-galaxy collection list community.general 2>/dev/null | grep -q community.general; then
log_info "community.general collection — OK"
else
log_error "community.general Ansible collection is not installed"
Expand Down
Loading