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]
{{ DEPLOY_HOSTNAME }}
[sptarkov:vars]
ansible_user={{ DEPLOY_USER }}
ansible_connection=paramiko_ssh
ansible_ssh_pass=test
ansible_ssh_user=drone
ansible_ssh_private_key_file=/drone/src/private.key
# ansible_control_path=/dev/shm/ansible_control_path
all:
children:
sptarkov:
hosts:
sp-tarkov:
ansible_host: {{ DEPLOY_HOSTNAME }}
ansible_user: {{ DEPLOY_USER }}
ansible_connection: paramiko_ssh
ansible_ssh_pass: {{ DEPLOY_SSH_KEY_PASSPHRASE }}
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
file:
path: "{{ lookup('env', 'SPT_ITEMS_PATH') }}"
owner: "{{ lookup('env', 'DEPLOYMENT_USER') }}"
group: "{{ lookup('env', 'DEPLOYMENT_USER_GROUP') }}"
owner: "{{ lookup('env', 'DEPLOY_USER') }}"
group: "{{ lookup('env', 'DEPLOY_USER_GROUP') }}"
mode: 0774
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_USER }}/'"$DEPLOY_USER"'/g' ./.ansible-items/inventory
# - name: build frontend
# image: node:lts-alpine3.14
# commands:
# - node -v
# - npm -v
# - yarn --version
# - yarn --cwd ./items/frontend install
# - yarn --cwd ./items/frontend build --pure-lockfile
# - rm -rf ./items/api/public/static/*
# - mv ./items/frontend/build/* ./items/api/public
# - rm ./items/api/public/index.html
- name: build frontend
image: node:lts-alpine3.14
commands:
- node -v
- npm -v
- yarn --version
- yarn --cwd ./items/frontend install
- yarn --cwd ./items/frontend build --pure-lockfile
- rm -rf ./items/api/public/static/*
- mv ./items/frontend/build/* ./items/api/public
- rm ./items/api/public/index.html
- name: check ansible syntax
image: plugins/ansible:3
@ -65,23 +65,18 @@ steps:
inventory: ./.ansible-items/inventory
galaxy: ./.ansible-items/requirements.yml
timeout: 60
# verbose: 4
verbose: 2
environment:
DEPLOY_HOSTNAME:
from_secret: deploy_hostname
SPT_ITEMS_HOSTNAME:
from_secret: spt_items_hostname
DEPLOYMENT_USER:
DEPLOY_USER:
from_secret: deploy_username
DEPLOYMENT_USER_GROUP:
DEPLOY_USER_GROUP:
from_secret: deploy_user_group
SPT_ITEMS_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:
branch:
- master