2023-03-30 14:01:59 +02:00
|
|
|
---
|
|
|
|
|
kind: pipeline
|
|
|
|
|
type: docker
|
|
|
|
|
name: ansible
|
|
|
|
|
|
|
|
|
|
steps:
|
2023-03-30 14:13:35 +02:00
|
|
|
- name: yaml lint
|
|
|
|
|
image: cytopia/yamllint:alpine
|
|
|
|
|
commands:
|
2023-03-30 14:28:10 +02:00
|
|
|
- yamllint -c .yamllint.yml .
|
2023-03-30 14:13:35 +02:00
|
|
|
|
|
|
|
|
- name: ansible lint
|
|
|
|
|
image: cytopia/ansible-lint:alpine
|
|
|
|
|
commands:
|
2023-03-30 14:32:08 +02:00
|
|
|
- ansible-lint .
|
2023-03-30 14:13:35 +02:00
|
|
|
|
2023-03-31 09:40:58 +02:00
|
|
|
- name: setup ssh key
|
|
|
|
|
image: alpine:latest
|
|
|
|
|
commands:
|
|
|
|
|
- mkdir -p /drone/src/.ssh
|
|
|
|
|
- echo "$SSH_KEY" > /drone/src/.ssh/id_ed25519
|
|
|
|
|
- chmod 600 /drone/src/.ssh/id_ed25519
|
|
|
|
|
environment:
|
|
|
|
|
SSH_KEY:
|
|
|
|
|
from_secret: ssh_key
|
|
|
|
|
|
2023-03-30 14:13:35 +02:00
|
|
|
- name: ansible apply
|
2023-03-30 15:47:41 +02:00
|
|
|
image: cytopia/ansible:alpine
|
|
|
|
|
commands:
|
2023-03-31 09:40:58 +02:00
|
|
|
- ansible-playbook -i inventory/hosts site.yml --private-key /drone/src/.ssh/id_ed25519
|
2023-03-30 15:47:41 +02:00
|
|
|
|