Skip to content

Commit

Permalink
feat: ansible playbook with the latest collections
Browse files Browse the repository at this point in the history
Unsupported parameters for (community.general.cargo) module: locked. Supported parameters include: version, name, state, path."}
  • Loading branch information
jeffreytse committed Aug 2, 2024
1 parent 3ddf4bb commit 5c5a92a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: install ansible
run: pip install ansible
- name: run ansible-playbook check
run: cd ansible && ansible-playbook setup.yml --check
run: ./setup.sh --check
2 changes: 2 additions & 0 deletions ansible/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
collections:
- name: community.general
19 changes: 18 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# Exit immediately if a command exits with a non-zero status
set -e

if ! command -v ansible-playbook &> /dev/null; then
echo "Command ansible-playbook could not be found!"
echo
Expand All @@ -9,4 +12,18 @@ if ! command -v ansible-playbook &> /dev/null; then
exit 1
fi

cd ./ansible && ansible-playbook --ask-become-pass setup.yml
ANSIBLE_PLAYBOOK_ARGS=()

if ("$1" == "--help" || "$1" == "-h"); then
echo "Usage: setup.sh [OPTIONS]"
echo
echo "Options:"
echo "--check Run the playbook in check mode (default: false)"
exit 0
elif ("$1" == "--check"); then
CHECK_PLAYBOOK_ARGS+=("--check")
fi

cd ./ansible
ansible-galaxy collection install -r requirements.yml --upgrade
ansible-playbook --ask-become-pass setup.yml ${ANSIBLE_PLAYBOOK_ARGS[@]}

0 comments on commit 5c5a92a

Please sign in to comment.