Use vault password secret in CI
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul Brinkmeier 2023-01-27 04:59:29 +01:00
parent 9f40b38886
commit 1b61394afd

View File

@ -19,11 +19,17 @@ steps:
environment: environment:
SSH_KEY: SSH_KEY:
from_secret: ssh_key from_secret: ssh_key
VAULT_PASSWORD:
from_secret: vault_password
commands: commands:
- pip install ansible==6.4.0 > /dev/null 2> /dev/null - pip install ansible==6.4.0 > /dev/null 2> /dev/null
- mkdir "$HOME/.ssh" - mkdir "$HOME/.ssh"
- echo "$SSH_KEY" > "$HOME/.ssh/id" - echo "$SSH_KEY" > "$HOME/.ssh/id"
- chmod 0600 ~/.ssh/id - chmod 0600 ~/.ssh/id
- ssh-keyscan -p 2309 vmd98928.contaboserver.net > "$HOME/.ssh/known_hosts" - ssh-keyscan -p 2309 vmd98928.contaboserver.net > "$HOME/.ssh/known_hosts"
- echo "$VAULT_PASSWORD" > "$HOME/vault_password"
- cd ansible - cd ansible
- ansible-playbook --private-key "$HOME/.ssh/id" --check playbooks/misc-all.yaml - ansible-playbook --private-key "$HOME/.ssh/id" --vault-password-file "$HOME/vault_password" --check playbooks/misc-all.yaml