-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: bring paths into sourceable script, always cd to appease ansible
- Loading branch information
Showing
4 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# Sourceable script to set common vars for the various scripts. | ||
# This sets a bunch of environment variables related to known paths | ||
# and puts us into the ansible directory for the duration of the | ||
# encapsulating script. | ||
set -e | ||
|
||
THIS_SCRIPT="$(realpath "${BASH_SOURCE[0]}")" | ||
THIS_DIR="$(dirname "${THIS_SCRIPT}")" | ||
|
||
ANSIBLE_ROOT="$(realpath "${THIS_DIR}/..")" | ||
export ANSIBLE_ROOT | ||
INVENTORY_PATH="${ANSIBLE_ROOT}/inventory/plcs.yaml" | ||
export INVENTORY_PATH | ||
SSH_CONFIG="${ANSIBLE_ROOT}/ssh_config" | ||
export SSH_CONFIG | ||
|
||
cd "${ANSIBLE_ROOT}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters