chore(deps): update peter-evans/create-or-update-comment digest to e8674b0 #95
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Ansible CI Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| inventory: | |
| description: 'Inventory file to validate' | |
| type: choice | |
| required: true | |
| default: 'linode.yml' | |
| options: | |
| - 'linode.yml' | |
| verbosity: | |
| description: 'Verbosity level for logs' | |
| type: choice | |
| required: true | |
| default: '-v' | |
| options: | |
| - '-v' | |
| - '-vv' | |
| - '-vvv' | |
| defaults: | |
| run: | |
| working-directory: './ansible' | |
| jobs: | |
| test: | |
| name: Ansible CI Test | |
| runs-on: ubuntu-latest | |
| env: | |
| LINODE_API_TOKEN: ${{ secrets.LINODE_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Setup UV | |
| run: | | |
| # Install uv if not available | |
| if ! command -v uv >/dev/null 2>&1; then | |
| echo "Installing uv..." | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| fi | |
| # Verify uv is available | |
| if ! command -v uv >/dev/null 2>&1; then | |
| echo "ERROR: uv installation failed" | |
| exit 1 | |
| fi | |
| echo "uv version: $(uv --version)" | |
| - name: Setup Ansible and Dependencies | |
| run: | | |
| # Use uv to install ansible and dependencies (matches local setup) | |
| uv sync | |
| # Activate venv and install ansible collections/roles | |
| source .venv/bin/activate | |
| ansible-galaxy install -r requirements.yml | |
| # Verify ansible is working | |
| ansible --version | |
| - name: Test Basic Ansible Commands | |
| run: | | |
| # Test ansible commands work with installed dependencies | |
| source .venv/bin/activate | |
| ansible --version | |
| ansible-lint --version | |
| ansible-inventory --help >/dev/null | |
| echo "SUCCESS: All ansible commands working with CI setup" | |
| - name: Validate Ansible Inventory | |
| run: | | |
| source .venv/bin/activate | |
| HOST_COUNT=$(ansible-inventory -i inventory/${{ inputs.inventory }} --list 2>/dev/null | jq -r '._meta.hostvars | keys | length') | |
| if [ "$HOST_COUNT" -eq 0 ]; then | |
| echo "ERROR: No hosts found in inventory - would run against localhost" | |
| exit 1 | |
| fi | |
| echo "Inventory validation passed: $HOST_COUNT hosts found" |