Files
ansible-automations/.drone.yml
Noah Knegt 6218f59948
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Fix the hosts file specified
Signed-off-by: Noah Knegt <git@noahknegt.com>
2023-03-31 10:05:08 +02:00

41 lines
830 B
YAML

---
kind: pipeline
type: docker
name: ansible
steps:
- name: yaml lint
image: cytopia/yamllint:alpine
commands:
- yamllint -c .yamllint.yml .
- name: ansible lint
image: cytopia/ansible-lint:alpine
commands:
- ansible-lint .
- 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
when:
event:
- push
branch:
- master
- name: ansible apply
image: cytopia/ansible:latest-tools
commands:
- ansible-playbook -i inventory/hosts.yml site.yml --private-key /drone/src/.ssh/id_ed25519
when:
event:
- push
branch:
- master