Basis aus 2nd-brain für LPIC-Prüfungsvorbereitung übernommen
Regeln, Standards, Kontextstruktur und Werkzeuge übernommen; 2nd-brain- Inhalte (Stacks, Ansible-Inventar, Architektur, Knowledge) entfernt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
7f6b8ebe07
70 files changed
+2816
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
#-------------------------------------------------------------------------------
|
||||
## @file .env.sh
|
||||
## @brief Ansible-Kontext für dieses Repo setzen (Pfade + Secret-Store)
|
||||
## @author <AUTOR – aus ai/context/responsible.md>
|
||||
## @owner <VERANTWORTLICH – aus ai/context/responsible.md>
|
||||
## @version 1.0.0 (07.10.2026)
|
||||
## @usage source ansible/.env.sh (bash und zsh, aus beliebigem Verzeichnis)
|
||||
#-------------------------------------------------------------------------------
|
||||
# Pfad dieser Datei – bash: BASH_SOURCE, zsh: %x
|
||||
_ANS_SRC="${BASH_SOURCE[0]:-${(%):-%x}}"
|
||||
_ANS_DIR="$(cd "$(dirname "$_ANS_SRC")" && pwd -P)"
|
||||
|
||||
# --- Ansible-Pfade (fremden Kontext zurücksetzen) ---
|
||||
unset ANSIBLE_CONFIG ANSIBLE_INVENTORY ANSIBLE_ROLES_PATH ANSIBLE_VAULT_PASSWORD_FILE
|
||||
export ANSIBLE_BASE_PATH="$_ANS_DIR"
|
||||
export ANSIBLE_CONFIG="$ANSIBLE_BASE_PATH/ansible.cfg"
|
||||
export ANSIBLE_INVENTORY="$ANSIBLE_BASE_PATH/inv"
|
||||
export ANSIBLE_ROLES_PATH="$ANSIBLE_BASE_PATH/roles"
|
||||
export ANS_PLAYDIR="$ANSIBLE_BASE_PATH/playbooks"
|
||||
export ANS_FILES="$ANSIBLE_BASE_PATH/files"
|
||||
export ANS_DEFAULT_HOSTS="<STANDARDHOST>" # nur Doku – Default steht im Play
|
||||
|
||||
# --- Secret-Store (HashiCorp Vault, bevorzugt) – Token aus ~/.vault-token ---
|
||||
export VAULT_ADDR="<VAULT_ADDR>"
|
||||
export ANSIBLE_HASHI_VAULT_ADDR="$VAULT_ADDR"
|
||||
export ANSIBLE_HASHI_VAULT_AUTH_METHOD="token"
|
||||
export ANS_VAULT_KV_MOUNT="secret"
|
||||
export ANS_VAULT_KV_PATH="<projekt>"
|
||||
|
||||
# --- Ansible Vault (nur Fallback, Passwortdatei außerhalb des Repos) ---
|
||||
[ -f "$HOME/.ans-secret-<projekt>" ] && export ANSIBLE_VAULT_PASSWORD_FILE="$HOME/.ans-secret-<projekt>"
|
||||
|
||||
unset _ANS_DIR _ANS_SRC
|
||||
echo "Ansible-Kontext aktiv: ANSIBLE_BASE_PATH=$ANSIBLE_BASE_PATH"
|
||||
Reference in new issue
Block a user