/
/
/
This repo is destined for my server automations and setup.
1#!/bin/sh
2# Vault password client for unattended runs (Semaphore).
3#
4# ansible.cfg points at .vault_password, which is gitignored and therefore
5# missing from any fresh clone. Semaphore sets
6# ANSIBLE_VAULT_PASSWORD_FILE=scripts/vault-password-env.sh (overrides ansible.cfg)
7# ANSIBLE_VAULT_PASSWORD=<the password> (environment secret)
8# and Ansible executes this script to read the password from the environment.
9# Local runs are unaffected: they keep using .vault_password.
10if [ -z "${ANSIBLE_VAULT_PASSWORD:-}" ]; then
11 echo "ANSIBLE_VAULT_PASSWORD is not set" >&2
12 exit 1
13fi
14printf '%s\n' "$ANSIBLE_VAULT_PASSWORD"
15