All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Noah Knegt <git@noahknegt.com>
52 lines
1.0 KiB
YAML
52 lines
1.0 KiB
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: cytopia/ansible:latest-infra
|
|
commands:
|
|
- mkdir -p /root/.ssh
|
|
- echo "$SSH_KEY" > /root/.ssh/id_ed25519
|
|
- chmod 600 /root/.ssh/id_ed25519
|
|
- ssh-keyscan -p 4422 vps.noahknegt.com > /root/.ssh/known_hosts
|
|
environment:
|
|
SSH_KEY:
|
|
from_secret: ssh_key
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/.ssh
|
|
when:
|
|
event:
|
|
- push
|
|
branch:
|
|
- master
|
|
|
|
- name: ansible apply
|
|
image: cytopia/ansible:latest-infra
|
|
commands:
|
|
- ansible-playbook -i inventory/hosts.yml site.yml --private-key /root/.ssh/id_ed25519
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/.ssh
|
|
when:
|
|
event:
|
|
- push
|
|
branch:
|
|
- master
|
|
|
|
volumes:
|
|
- name: ssh_key
|
|
temp: {}
|