env-setup - bash implementation
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -4,3 +4,7 @@ vault-password
|
|||||||
# emacs temp/backup files
|
# emacs temp/backup files
|
||||||
*~
|
*~
|
||||||
*#
|
*#
|
||||||
|
|
||||||
|
# External resources
|
||||||
|
/.ansible-src
|
||||||
|
/.password-store
|
||||||
37
env-setup
Executable file
37
env-setup
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This sets up the environment to use a local Ansible source checkout,
|
||||||
|
# allowing a specific version to be used, or even a customised version.
|
||||||
|
#
|
||||||
|
# This is assumed to be symlinked from `.ansible-src/` to the
|
||||||
|
# directory to the one containing this repository. Check it out like
|
||||||
|
# this at a location of your choice:
|
||||||
|
#
|
||||||
|
# cd $WHEREVER
|
||||||
|
# git clone $ANSIBLE_GIT_REPO ansible-src
|
||||||
|
#
|
||||||
|
# Then symlink it into this directory:
|
||||||
|
#
|
||||||
|
# cd $HERE
|
||||||
|
# ln -sfnr $WHEREVER $HERE/.ansible-src
|
||||||
|
#
|
||||||
|
# It also sets the environment so that the untility `pass` will use a
|
||||||
|
# local password-store directory, not ~/.password-store. Likewise,
|
||||||
|
# this is assumed to be in a symlinked directory called
|
||||||
|
# `.password-store/`. Ansible has support for `pass` and can use it to
|
||||||
|
# retrieve sensitive information which needs to be committed to an
|
||||||
|
# encrypted password store.
|
||||||
|
#
|
||||||
|
# See https://www.passwordstore.org/
|
||||||
|
#
|
||||||
|
# To use the environment, run this script, which will spawn a subshell
|
||||||
|
# with the correct environment:
|
||||||
|
#
|
||||||
|
|
||||||
|
SCRIPT_DIR="${BASH_SOURCE[0]%/*}"
|
||||||
|
ANSIBLE_SRC=$(readlink -f "$SCRIPT_DIR/.ansible-src")
|
||||||
|
|
||||||
|
export PATH="$ANSIBLE_SRC/bin:$PATH"
|
||||||
|
export PASSWORD_STORE_DIR=$(readlink -f "$SCRIPT_DIR/.password-store")
|
||||||
|
|
||||||
|
exec '/bin/bash' '--rcfile' "$ANSIBLE_SRC/hacking/env-setup"
|
||||||
Reference in New Issue
Block a user