Skip to content

retendo/ansible-playbook-docker-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-playbook-docker-action

Actions Status

Github Action to execute Ansible Playbooks using fixed Ansible versions.

Inputs

playbookName

Required The name of the playbook to execute.

inventoryFile

Optional The name of the inventory file to use.

requirementsFile

Optional The name of the requirements file, if you want to install external roles. This will trigger ansible-galaxy install -r <requirementsFile> before your playbook will be called.

galaxyGithubUser

Optional If you use private github repositories in your requirements file you need to set galaxyGithubUser and galaxyGithub token.

galaxyGithubToken

Optional Token to access git source of roles to download. Only needed for private git sources. Github Account needs to be linked to Ansible Galaxy.

rolesPath

Optional Additionally to requirementsFile above you can specify a custom roles path for your roles to be installed in. This variable is useless without requirementsFile. It simply adds --roles-path <rolesPath> to the galaxy command.

keyFile

Optional ssh keyfile to use for connection to hosts. If vaulted use keyFileVaultPass to decrypt.

keyFileVaultPass

Optional Vault Password to decrypt keyfile.

extraVars

Optional A String containing extra variables separated by spaces to inject in the playbook run.

extraFile

Optional File with extra vars to inject in the playbook run. Especially useful when you want to inject environment variables. In such a case extraFile doesn't suffice.

verbosity

Choose out of 4 verbosity log levels. See ansible documentation for details.

Example Usage

uses: actions/ansible-playbook-docker-action@2.8.5
with:
  playbookName: 'simple-playbook.yml'
  inventoryFile: 'my-inventory.yml'
  requirementsFile: ".ansible/requirements.yml"
  galaxyGithubUser: ${{ secrets.GITHUB_USER }}
  galaxyGithubToken: ${{ secrets.Github_PAT }}
  rolesPath: ".ansible/playbooks/roles"
  keyFile: ".ansible/random-ssh-key.pem"
  keyFileVaultPass: ${{ secrets.KEYFILE_VAULT_PASS }}
  extraFile: ".ansible/extra.yml"
  extraVars: "-e my_first_extra=${{ github.actor }} -e my_second_one=${{ github.sha }}"
  verbosity: "vv"

About

Github Action to execute Ansible Playbooks

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 94.2%
  • Dockerfile 5.8%