Skip to content

Commit

Permalink
Feat/hah backup job (#147)
Browse files Browse the repository at this point in the history
feat: add job for hashi-at-home consul and nomad secrets
fix: add secrets for CONSUL and VAULT to env with template
feat: add backup job for H@H services
chore: change execution cron to 15 past every 6th hour
chore: remove typo
refactor(backup): run inside virtualenv
---------
Signed-off-by: Bruce Becker <brucellino@protonmail.ch>
  • Loading branch information
brucellino authored Jul 28, 2024
1 parent 9cb4a89 commit ff8b5e3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions hah-snapshot.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ job "hah-state-backup" {
PATH=${HOME}/.local/bin:${PATH}
source ${NOMAD_SECRETS_DIR}/env
echo Nomad addr: ${NOMAD_ADDR}
ecoh
# Generate Consul Snapshot
curl -v \
-X GET \
Expand All @@ -46,8 +45,13 @@ curl -X GET \
https://api.github.com/repos/brucellino/personal-automation/contents/playbooks/backup-state.yml \
| jq -r .content \
| base64 -d > playbook.yml
pip install --user ansible boto3 botocore
ansible-playbook -c local -i localhost, playbook.yml
virtualenv local/execute
source local/execute/bin/activate
pip install ansible boto3 botocore
which ansible
which ansible-playbook
which python
INTERPRETER_PYTHON=local/execute/bin/python3 ansible-playbook -c local -i localhost, playbook.yml
EOH
destination = "local/start.sh"
perms = "777"
Expand Down

0 comments on commit ff8b5e3

Please sign in to comment.