1
0
Fork 0
mirror of https://github.com/dawidd6/action-ansible-playbook.git synced 2026-01-18 23:05:46 +00:00
⚙️ A GitHub Action for running Ansible playbooks
Find a file
Dawid Dziurla 0fe8953f25
node_modules: update (#129)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
2026-01-09 14:33:47 +01:00
.devcontainer devcontainer: init 2025-06-28 18:45:53 +02:00
.github Add NPM updates workflow configuration 2025-12-25 10:19:21 +01:00
node_modules node_modules: update (#129) 2026-01-09 14:33:47 +01:00
test Change stdout_callback from yaml to debug 2025-12-10 07:54:00 +01:00
action.yml Add check mode and fixes boolean inputs (#111) 2025-02-10 18:11:33 +01:00
LICENSE init 2020-03-21 17:06:40 +01:00
main.js Change inventory file argument from '--inventory-file' to '--inventory' (#121) 2025-10-11 19:22:21 +02:00
package-lock.json build(deps): bump @actions/core from 2.0.1 to 2.0.2 (#128) 2026-01-09 14:31:37 +01:00
package.json build(deps): bump @actions/core from 2.0.1 to 2.0.2 (#128) 2026-01-09 14:31:37 +01:00
post.js Introduce optional support for ansible.cfg (#88) 2024-01-17 10:06:09 +01:00
README.md Change action reference to <REF> in README 2025-12-25 11:15:28 +01:00

Run Ansible playbook GitHub Action

An Action that executes given Ansible playbook on selected hosts.

Should work on any OS, if ansible-playbook command is available in PATH.

Usage

- name: Run playbook
  uses: dawidd6/action-ansible-playbook@<REF>
  with:
    # Required, playbook filepath
    playbook: deploy.yml
    # Optional, directory where playbooks live
    directory: ./
    # Optional, ansible configuration file content (ansible.cfg)
    configuration: |
      [defaults]
      callbacks_enabled = ansible.posix.profile_tasks, ansible.posix.timer
      stdout_callback = yaml
      nocows = false
    # Optional, SSH private key
    key: ${{secrets.SSH_PRIVATE_KEY}}
    # Optional, literal inventory file contents
    inventory: |
      [all]
      example.com

      [group1]
      example.com
    # Optional, SSH known hosts file content
    known_hosts: |
      example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
    # Optional, encrypted vault password
    vault_password: ${{secrets.VAULT_PASSWORD}}
    # Optional, galaxy requirements filepath
    requirements: galaxy-requirements.yml
    # Optional, additional flags to pass to ansible-playbook
    options: |
      --inventory .hosts
      --limit group1
      --extra-vars hello=there
      --verbose