Play Ansible Playbook
Version updated for https://github.com/arillso/action.playbook to version 0.5.0.
- This action is used across all versions by 158 repositories.
Action Type
This is a Docker action.
Go to the GitHub Marketplace to find the latest changes.
Action Summary
The “Play Ansible Playbook” GitHub Action automates the execution of Ansible playbooks within GitHub Actions workflows, streamlining infrastructure and configuration management tasks. It supports key features like Ansible Galaxy integration, secure SSH authentication, Ansible Vault handling, and flexible configuration options for inventory, variables, and tags. This action simplifies complex deployment processes, enhances automation, and provides robust tools for managing infrastructure as code.
Release notes
Added
known_hostsinput for SSH host key verificationdry_runinput as alias for--check --diffmode- Action outputs for
statusandexit_code - Auto-detection of Galaxy requirements file (
requirements.yml/requirements.yaml) - GitHub Step Summary with Ansible execution results
vault_password_fileinput — auto-creates vault password file from secret- Retry mechanism for playbook execution via
retriesandretry_delayinputs - Optional ansible-lint pre-check via
lintinput output_fileinput to capture Ansible stdout to a file- Support for multiple SSH keys via
additional_private_keysinput - SSH agent support for bastion/proxy host connections — private keys are now loaded into
ssh-agent, making them available toProxyCommandand multi-hop SSH - Passphrase-protected SSH key support via
private_key_passphraseinput usingSSH_ASKPASS - Multiline YAML syntax for
inventory,playbook,extra_vars, andmodule_pathinputs (closes #18) output_callbackinput to configure the Ansible stdout callback plugin- Comprehensive unit test suite (
main_test.go) covering parameter validation, SSH agent lifecycle, passphrase handling, and input normalization - Comprehensive action input tests for all new features
CONTRIBUTING.mdwith development guidelines- Tooling configs:
.gitleaks.toml,.grype.yaml,.trivy.yaml,.checkov.yml,.pre-commit-config.yaml,.secretlintrc.json,.markdownlint.json,.markdown-link-check.json,.jscpd.json,.kics.json
Changed
- Major: Upgraded
go.ansiblefrom v1.x to v2.0.0 - Ansible exit codes are now passed through to the GitHub Action exit code
- SSH agent failure is now a hard error instead of silent fallback
- Pinned Docker image tag in
action.ymlfromlatestto0.4 - Renamed
callback_whitelisttocallbacks_enabled(deprecated alias still supported) - Migrated CI/CD workflows to reusable
arillso/.githubworkflows - Modernized Makefile with structured targets
- Updated Dockerfile builder to Go 1.26
- Stripped binary build (
-ldflags="-s -w") for smaller image size - Extracted CLI flags to package-level
appFlagsvariable for testability
Removed
- Removed unused flags:
module-name,invalidate-cache,requirements,module-default,metadata-export - Removed
parseModuleDefaultshelper function
Updated
arillso/ansibleDocker image to v2.20.3github.com/urfave/cli/v3from v3.6.1 to v3.7.0- GitHub Actions dependencies (v4, v6, v7)
golang:alpineDocker digest