Add SSH key passphrase

This commit is contained in:
Mangiang 2021-11-02 10:16:45 -04:00
parent 8a0cec92de
commit 268411136b
No known key found for this signature in database
GPG Key ID: DAE9B92A692CD55C
2 changed files with 6 additions and 5 deletions

View File

@ -1,2 +1,2 @@
[host]
{{ DEPLOYMENT_USER }}@{{ DEPLOY_HOSTNAME }} ansible_connection=ssh ansible_user={{ DEPLOYMENT_USER }}
{{ DEPLOYMENT_USER }}@{{ DEPLOY_HOSTNAME }} ansible_connection=ssh ansible_user={{ DEPLOYMENT_USER }} ansible_ssh_pass={{ DEPLOYMENT_SSH_KEY_PASSPHRASE }}

View File

@ -23,10 +23,13 @@ steps:
from_secret: spt_items_hostname
DEPLOYMENT_USER:
from_secret: deploy_username
DEPLOYMENT_SSH_KEY_PASSPHRASE:
from_secret: deploy_ssh_key_passphrase
commands:
- sed -i 's/{{ SPT_ITEMS_HOSTNAME }}/'"$SPT_ITEMS_HOSTNAME"'/g' ./items/frontend/.env.example
- mv ./items/frontend/.env.example ./items/frontend/.env
- sed -i 's/{{ DEPLOY_HOSTNAME }}/'"$DEPLOY_HOSTNAME"'/g' ./.ansible-items/inventory
- sed -i 's/{{ DEPLOYMENT_SSH_KEY_PASSPHRASE }}/'"$DEPLOYMENT_SSH_KEY_PASSPHRASE"'/g' ./.ansible-items/inventory
- sed -i 's/{{ DEPLOYMENT_USER }}/'"$DEPLOYMENT_USER"'/g' ./.ansible-items/inventory
- name: build frontend
@ -42,7 +45,7 @@ steps:
- rm ./items/api/public/index.html
- name: check ansible syntax
image: shirito/drone-ansible:1.0.0
image: plugins/ansible:3
settings:
playbook: ./.ansible-items/playbook.yml
inventory: ./.ansible-items/inventory
@ -53,15 +56,13 @@ steps:
- development
- name: apply ansible playbook
image: shirito/drone-ansible:1.0.0
image: plugins/ansible:3
settings:
playbook: ./.ansible-items/playbook.yml
inventory: ./.ansible-items/inventory
galaxy: ./.ansible-items/requirements.yml
private_key:
from_secret: deploy_ssh_key
private-key-passphrase:
from_secret: deploy_ssh_key_password
environment:
DEPLOY_HOSTNAME:
from_secret: deploy_hostname