|
|
@@ -1,42 +0,0 @@
|
|
|
----
|
|
|
-# Kestra ansible-playbook Template
|
|
|
-# ---
|
|
|
-#
|
|
|
-# Run an ansible playbook defined inline the kestra flow.
|
|
|
-#
|
|
|
-
|
|
|
-id: ansible_job # <- Replace with your task id...
|
|
|
-namespace: your-namespace # <- Replace with your namespace...
|
|
|
-
|
|
|
-tasks:
|
|
|
- - id: ansible # <- Replace with your task id...
|
|
|
- type: io.kestra.plugin.core.flow.WorkingDirectory
|
|
|
- tasks:
|
|
|
- - id: local_files # <- Replace with your task id...
|
|
|
- type: io.kestra.plugin.core.storage.LocalFiles
|
|
|
- inputs:
|
|
|
- inventory.ini: | # <- Replace with your inventory file content...
|
|
|
- srv-demo-1.home.clcreative.de
|
|
|
- myplaybook.yaml: | # <- Replace with your playbook file content...
|
|
|
- ---
|
|
|
- - hosts: srv-demo-1.home.clcreative.de
|
|
|
- tasks:
|
|
|
- - name: upgrade apt packages
|
|
|
- become: true
|
|
|
- ansible.builtin.apt:
|
|
|
- upgrade: true
|
|
|
- update_cache: true
|
|
|
- # <--
|
|
|
- id_rsa: "{{ secret('SSH_KEY') }}" # <- Replace with your secret key...
|
|
|
- - id: ansible_task # <- Replace with your task id...
|
|
|
- type: io.kestra.plugin.ansible.cli.AnsibleCLI
|
|
|
- docker:
|
|
|
- image: docker.io/cytopia/ansible:latest-tools
|
|
|
- user: "1000" # required to set ssh key permissions
|
|
|
- env:
|
|
|
- "ANSIBLE_HOST_KEY_CHECKING": "false"
|
|
|
- # --> (optional) when using a different remote user
|
|
|
- # "ANSIBLE_REMOTE_USER": "your-remote-user"
|
|
|
- # <--
|
|
|
- commands:
|
|
|
- - ansible-playbook -i inventory.ini --key-file id_rsa myplaybook.yaml # <- Replace with your inventory and playbook files...
|