ssh-key #9
30
.drone.yml
30
.drone.yml
@@ -14,15 +14,27 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- ansible-lint .
|
- ansible-lint .
|
||||||
|
|
||||||
- name: ansible apply
|
- name: setup ssh key
|
||||||
image: plugins/ansible:3
|
image: alpine:latest
|
||||||
settings:
|
commands:
|
||||||
inventory: inventory/hosts.yml
|
- mkdir -p /drone/src/.ssh
|
||||||
playbook: site.yml
|
- echo "$SSH_KEY" > /drone/src/.ssh/id_ed25519
|
||||||
private_key:
|
- chmod 600 /drone/src/.ssh/id_ed25519
|
||||||
from_secret: ansible_private_key
|
environment:
|
||||||
|
SSH_KEY:
|
||||||
|
from_secret: ssh_key
|
||||||
when:
|
when:
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
|
||||||
|
- name: ansible apply
|
||||||
|
image: cytopia/ansible:infra
|
||||||
|
commands:
|
||||||
|
- ansible-playbook -i inventory/hosts site.yml --private-key /drone/src/.ssh/id_ed25519
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
@@ -1 +1,2 @@
|
|||||||
|
---
|
||||||
ansible_user: ansible
|
ansible_user: ansible
|
||||||
|
Reference in New Issue
Block a user