feat: Add passphrase capabilities for SSH key #11

Merged
Ghost merged 50 commits from :development into development 2021-11-03 21:21:45 -04:00
3 changed files with 27 additions and 31 deletions
Showing only changes of commit 511263913c - Show all commits

View File

@ -1,10 +1,11 @@
[sptarkov:hosts] all:
{{ DEPLOY_HOSTNAME }} children:
sptarkov:
[sptarkov:vars] hosts:
ansible_user={{ DEPLOY_USER }} sp-tarkov:
ansible_connection=paramiko_ssh ansible_host: {{ DEPLOY_HOSTNAME }}
ansible_ssh_pass=test ansible_user: {{ DEPLOY_USER }}
ansible_ssh_user=drone ansible_connection: paramiko_ssh
ansible_ssh_private_key_file=/drone/src/private.key ansible_ssh_pass: {{ DEPLOY_SSH_KEY_PASSPHRASE }}
# ansible_control_path=/dev/shm/ansible_control_path ansible_ssh_user: {{ DEPLOY_USER }}
ansible_ssh_private_key_file: /drone/src/private.key # Hardcoded because created by the Drone plugin

View File

@ -36,8 +36,8 @@
- name: Reset files permissions - name: Reset files permissions
file: file:
path: "{{ lookup('env', 'SPT_ITEMS_PATH') }}" path: "{{ lookup('env', 'SPT_ITEMS_PATH') }}"
owner: "{{ lookup('env', 'DEPLOYMENT_USER') }}" owner: "{{ lookup('env', 'DEPLOY_USER') }}"
group: "{{ lookup('env', 'DEPLOYMENT_USER_GROUP') }}" group: "{{ lookup('env', 'DEPLOY_USER_GROUP') }}"
mode: 0774 mode: 0774
recurse: yes recurse: yes

View File

@ -35,17 +35,17 @@ steps:
- sed -i 's/{{ DEPLOY_SSH_KEY_PASSPHRASE }}/'"$DEPLOY_SSH_KEY_PASSPHRASE"'/g' ./.ansible-items/inventory - sed -i 's/{{ DEPLOY_SSH_KEY_PASSPHRASE }}/'"$DEPLOY_SSH_KEY_PASSPHRASE"'/g' ./.ansible-items/inventory
- sed -i 's/{{ DEPLOY_USER }}/'"$DEPLOY_USER"'/g' ./.ansible-items/inventory - sed -i 's/{{ DEPLOY_USER }}/'"$DEPLOY_USER"'/g' ./.ansible-items/inventory
# - name: build frontend - name: build frontend
# image: node:lts-alpine3.14 image: node:lts-alpine3.14
# commands: commands:
# - node -v - node -v
# - npm -v - npm -v
# - yarn --version - yarn --version
# - yarn --cwd ./items/frontend install - yarn --cwd ./items/frontend install
# - yarn --cwd ./items/frontend build --pure-lockfile - yarn --cwd ./items/frontend build --pure-lockfile
# - rm -rf ./items/api/public/static/* - rm -rf ./items/api/public/static/*
# - mv ./items/frontend/build/* ./items/api/public - mv ./items/frontend/build/* ./items/api/public
# - rm ./items/api/public/index.html - rm ./items/api/public/index.html
- name: check ansible syntax - name: check ansible syntax
image: plugins/ansible:3 image: plugins/ansible:3
@ -65,23 +65,18 @@ steps:
inventory: ./.ansible-items/inventory inventory: ./.ansible-items/inventory
galaxy: ./.ansible-items/requirements.yml galaxy: ./.ansible-items/requirements.yml
timeout: 60 timeout: 60
# verbose: 4 verbose: 2
environment: environment:
DEPLOY_HOSTNAME: DEPLOY_HOSTNAME:
from_secret: deploy_hostname from_secret: deploy_hostname
SPT_ITEMS_HOSTNAME: SPT_ITEMS_HOSTNAME:
from_secret: spt_items_hostname from_secret: spt_items_hostname
DEPLOYMENT_USER: DEPLOY_USER:
from_secret: deploy_username from_secret: deploy_username
DEPLOYMENT_USER_GROUP: DEPLOY_USER_GROUP:
from_secret: deploy_user_group from_secret: deploy_user_group
SPT_ITEMS_PATH: SPT_ITEMS_PATH:
from_secret: deploy_path from_secret: deploy_path
# PLUGIN_ANSIBLE_DEBUG: true
# ANSIBLE_CONTROL_PATH: /dev/shm/
# PLUGIN_ANSIBLE_CONTROL_PATH: /dev/shm/
# ANSIBLE_SSH_ARGS: '-C -o ControlMaster=auto -o ControlPersist=30m -o ControlPath=/dev/shm/'
# PLUGIN_ANSIBLE_SSH_ARGS: '-C -o ControlMaster=auto -o ControlPersist=30m -o ControlPath=/dev/shm/'
when: when:
branch: branch:
- master - master