Wrapper around Ansible.
The action checks for a ANSIBLE_GALAXY_FILE
variable and, if exists,
passes its content to ansible-galaxy
to install dependencies
(mazer
and pip
can be used as well; see below). The entrypoint to
the action is the ansible-playbook
command.
workflow "Run Ansible playbook" {
on = "push"
resolves = "run ansible"
}
action "run ansible" {
uses = "popperized/ansible@master"
args = "-i mystuff/hosts.ini mystuff/playbook.yml"
env = {
ANSIBLE_GALAXY_FILE = "mystuff/requirements.yml"
}
secrets = ["ANSIBLE_SSH_KEY_DATA"]
}
TIP: to disable host key checking, the workflow can define the
env
varaible:ANSIBLE_HOST_KEY_CHECKING = "False"
This variable is not used by the action, but it's read by Ansible instead. See the official documentation to obtain a list of environment variables that Ansible can read.
-
ANSIBLE_GALAXY_FILE
. Optional Path to file containing anansible-galaxy
requirements file. Dependencies are installed to$HOME/.ansible
. -
ANSIBLE_MAZER_LOCKFILE
. Optional Path to mazer lockfile to install galaxy content. Dependencies are installed to$HOME/.ansible
. -
ANSIBLE_PIP_FILE
. Optional Path to arequirements.txt
file that is passed topip install -r
.
ANSIBLE_SSH_KEY_DATA
. Required A base64-encoded string containing the private key used to authenticate with hosts referenced in the ansible inventory. Example encoding from a terminal:cat ~/.ssh/id_rsa | base64
MIT. Please see additional information in each subdirectory.