mirror of
https://github.com/dredx/prole.git
synced 2026-09-24 16:44:33 +00:00
Repairs and improvements:
- iSCSI: Added cleanup tasks to remove stale mounts and fstab entries. Improved robustness of iSCSI target management and added 'iscsi_absent_mounts' support.
- K3s:
- Updated service start logic to accept 'activating' state, preventing premature failure during slow startups.
- Improved service stop logic to safely handle missing or not-found services.
- Ensured 'prole-installer' ServiceAccount and ClusterRoleBinding exist for K8s administration.
- Added leader election and etcd tuning arguments (forgiving leases) to config.yaml.j2.
- Removed deprecated 'prole-port-forwards' systemd service.
- Installer & Scripts:
- Updated legacy_tk.py to support K3s mode, secret resolution for passwords, and better environment management (including ~/.prole/env.sh for service mode).
- Updated init_ansible.sh to support PROLE_VAULT_PASS_FILE and ANSIBLE_VAULT_PASSWORD_FILE.
- Improved directory and kubeconfig path resolution in prole_cfg.sh to support fallback to ~/.prole.
- Enhanced Grafana password resolution in init_monitoring.sh.
- Added automatic application of iSCSI StorageClass and PersistentVolumes in init_openbao.sh.
- General: Switched conf/prole.cfg to k3s deployment mode and updated vault_k3s.yml token.
New Ansible Tasks and Playbooks:
- infrastructure/playbooks/iscsi_cleanup.yml: Automates logout and removal of stale iSCSI node records.
- infrastructure/playbooks/prole_logs_migrate.yml: Orchestrates /prole/logs migration to iSCSI storage.
- infrastructure/playbooks/tmp_bao_dir.yml: Ensures host-level storage directories for OpenBao.
- infrastructure/playbooks/tmp_mount.yml: Utility to verify and enforce host-level mounts.
- infrastructure/playbooks/k3s_sync.yml: Added tasks to start K3s after sync and update local kubeconfig on the controller.
- Added 'Unmount stale iSCSI mounts' and 'Remove stale iSCSI fstab entries' to the iscsi role.
- Added 'Ensure prole-installer service account exists' to the k3s role.
48 lines
1.3 KiB
Bash
Executable File
48 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# init_ansible.sh
|
|
# Purpose:
|
|
# - Initialize or update the Ansible vault password file (.vault_pass)
|
|
# - Should be run after init_openbao.sh
|
|
|
|
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
# shellcheck disable=SC1090
|
|
source "$SCRIPT_DIR/prole_cfg.sh"
|
|
|
|
if [[ "${1:-}" == "--mode" || "${1:-}" == "-m" ]]; then
|
|
prole_set_mode "${2:-}"
|
|
shift 2
|
|
elif [[ "${1:-}" == --mode=* || "${1:-}" == -m=* ]]; then
|
|
prole_set_mode "${1#*=}"
|
|
shift
|
|
fi
|
|
|
|
PROLE_ROOT=$(cd "$SCRIPT_DIR/.." && pwd)
|
|
VAULT_PASS_FILE="${PROLE_VAULT_PASS_FILE:-${ANSIBLE_VAULT_PASSWORD_FILE:-$PROLE_ROOT/.vault_pass}}"
|
|
|
|
ACTION=${1:-initialize}
|
|
|
|
case "$ACTION" in
|
|
initialize|update)
|
|
# Use PROLE_PASSWD if set, otherwise prompt
|
|
if [[ -n "${PROLE_PASSWD:-}" ]]; then
|
|
echo "Using PROLE_PASSWD for Ansible Vault password."
|
|
echo "$PROLE_PASSWD" > "$VAULT_PASS_FILE"
|
|
else
|
|
echo -n "Enter Ansible Vault password: "
|
|
read -rs vault_pass
|
|
echo
|
|
echo "$vault_pass" > "$VAULT_PASS_FILE"
|
|
fi
|
|
|
|
chmod 600 "$VAULT_PASS_FILE"
|
|
echo "Ansible Vault password file $ACTION""d at $VAULT_PASS_FILE"
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {initialize|update}" >&2
|
|
exit 2
|
|
;;
|
|
esac
|