diff --git a/.drone.yml b/.drone.yml index f20f31b..d02a7f2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,14 +15,18 @@ steps: - ansible-lint . - name: setup ssh key - image: alpine:latest + image: cytopia/ansible:latest-tools commands: - - mkdir -p /drone/src/.ssh - - echo "$SSH_KEY" > /drone/src/.ssh/id_ed25519 - - chmod 600 /drone/src/.ssh/id_ed25519 + - 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 @@ -32,9 +36,16 @@ steps: - name: ansible apply image: cytopia/ansible:latest-tools commands: - - ansible-playbook -i inventory/hosts.yml site.yml --private-key /drone/src/.ssh/id_ed25519 + - ansible-playbook -i inventory/hosts.yml site.yml + volumes: + - name: ssh_key + path: /root/.ssh when: event: - push branch: - master + +volumes: + - name: ssh_key + temp: {}