mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-11-07 17:03:59 +01:00
34 lines
1.0 KiB
YAML
34 lines
1.0 KiB
YAML
---
|
|
# Kestra ansible-playbook Template
|
|
# ---
|
|
#
|
|
# Run an ansible playbook which has been uploaded to the server.
|
|
#
|
|
id: ansible_job
|
|
namespace: # your-namespace
|
|
|
|
tasks:
|
|
- id: ansible
|
|
type: io.kestra.plugin.core.flow.WorkingDirectory
|
|
tasks:
|
|
- id: ansible_task
|
|
namespaceFiles:
|
|
enabled: true
|
|
# --> upload your files to the kestra data directory for the namespace in
|
|
# <docker volume for kestra-data>/<namespace>/_files/
|
|
include:
|
|
- inventory.ini
|
|
- myplaybook.yaml
|
|
# <--
|
|
type: io.kestra.plugin.ansible.cli.AnsibleCLI
|
|
docker:
|
|
image: docker.io/cytopia/ansible:latest-tools
|
|
env:
|
|
"ANSIBLE_HOST_KEY_CHECKING": "false"
|
|
# --> (optional) when using a different remote user
|
|
# "ANSIBLE_REMOTE_USER": "your-remote-user"
|
|
# <--
|
|
commands:
|
|
- apk add sshpass # only required if use ssh passwords.
|
|
- ansible-playbook -i inventory.ini myplaybook.yaml
|