Commit Graph

170 Commits

Author SHA1 Message Date
chrisfu
fcf0c0ef0d k3s: Fix image pull failures on Retropie by blacklisting CNI interfaces in connman
- Prevent connmand from flapping routes by ignoring veth* and cni0 interfaces

- Ensure wlan0 maintains routing priority over eth0 on Retropie and Pi nodes

- Increase image pull retries and delay to improve resilience against transient network instability
2026-02-16 23:58:21 -08:00
chrisfu
ec8a4e98af k3s: Fix installation hangs, CA mismatches, and arm64 networking
- Implement proactive CA hash verification and automated repair for mismatches

- Ensure agents prioritize discovered server tokens over stale vault values

- Fix K3s service hangs with explicit stop and killall before reinstall

- Add Retropie/Pi networking fixes (WiFi power save, wlan0 priority)

- Pin pre-staged images to stable, architecture-aware versions (arm64)

- Remove obsolete init-port-forwards and prole.cfg sync tasks

- Update k8s manifests and installer core logic with new tests
2026-02-16 23:30:27 -08:00
chrisfu
3d29ab70f2 feat(k3s): enhance k3s install and factory reset reliability. Implement dynamic token discovery, serialized cluster setup with 'serial: 1', readiness checks, and image pre-staging for more robust cluster bootstrapping. 2026-02-16 15:04:04 -08:00
chrisfu
23cf4ac33d Configure K3s for retropie and add Traefik Ingress. Updated K3s templates for node-ip/flannel-iface, configured retropie host vars, enabled Traefik, added Ingress resources for Grafana, Prole, Kong, and Supabase, and set Postgres to LoadBalancer. 2026-02-16 04:28:40 -08:00
chrisfu
cad49cc0a6 Summary of recent repairs and infrastructure updates
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.
2026-02-15 17:51:57 -08:00
chrisfu
d2efb835b0 Refactor project structure and update initialization scripts
- Moved files from 'prole/' subdirectory to root level or appropriate subdirectories (tests, authority, infrastructure) to flatten the project structure.

- Updated 'install.py' and initialization scripts in 'etc/' to reflect the new directory layout.

- Added 'etc/repair_pipeline.sh' for automated pipeline repairs.

- Updated configuration files including 'conf/prole.cfg' and 'env.sh'.

- Integrated ArgoCD manifests in 'k8s/argocd/'.

- Updated 'prole-app' environment and properties.

- Moved and updated test scripts for better organization and reliability.

- Added 'tests/silent_install_test.sh' for automated installation testing.
2026-02-14 13:44:49 -08:00
chrisfu
f2c9012cce Refactor installation and initialization logic, and expand test coverage
- install.py: Major update including configuration variable expansion, improved k3s/k3d handling, and enhanced installation logic.

- etc/ scripts: Significant refactoring of initialization scripts (Kerberos, Port Forwards, Garage Store, etc.).

- Port Forwards: Transitioned from XML to port-mappings.conf for managing kubectl port-forwards.

- Status Reporting: Improved status checking for common services.

- Infrastructure: Updated Ansible inventory and rsyslog role configurations.

- Tests: Added a comprehensive suite of tests for 'etc' initialization scripts in prole/tests/etc/.

- Documentation: Added prole-db-documentation-mcp-architecture.md.

- General: Updated Dockerfiles and various helper scripts.
2026-02-13 21:36:39 -08:00
chrisfu
e228dd9243 checkpoint: installer refinements, k3s drift protection, and infra updates
- Installer: Updated k3s deployment logic and configuration generation.

- k3s Role: Implemented token drift protection to verify Vault secrets against live node tokens.

- DNS: Enhanced samba_reverse_dns role to support multiple reverse zones.

- Service Init: Updated initialization scripts and status reporting.

- Infrastructure: Added prole management role and k3s diagnostic playbook.

- Configuration: Updated prole.cfg and added vaulted group variables.
2026-02-12 02:30:44 -08:00
chrisfu
96f594fd3c Refactor initialization scripts and add new service components
- Consolidated and split initialization scripts in etc/:
    - Removed init_prole-db.sh and init_authority.sh.
    - Added init_kdc.sh for in-cluster MIT Kerberos KDC (prole-authority).
    - Added init_ollama.sh for Ollama AI service integration.
    - Added init_service_layer.sh for high-level service orchestration.
    - Added init_k3s_registry.sh for private registry management.
- Major updates to install.py:
    - Support for new Ollama and KDC configuration.
    - Improved prole.cfg rendering and namespace handling.
    - Updated unattended install flags.
- Infrastructure and Deployment:
    - Updated K3s Ansible role with private registry support (registries.yaml template).
    - Added prole-authority Dockerfile.
    - Updated OpenBao Kerberos ConfigMap and other K8s manifests.
- Configuration:
    - Updated prole.cfg with new sections for Ollama and Monitoring.
    - Refined environment variable exports in env.sh and prole_cfg.sh.
2026-02-11 13:09:31 -08:00
chrisfu
87e2f5d385 Checkpoint: Refactor common services and monitoring initialization. Updates: etc/init_monitoring.sh (Grafana naming, legacy cleanup), etc/init_common_services.sh (migration/cleanup logic), added etc/init_registry.sh, updated etc/init_cloudnative_pg.sh (manifest filtering), updated configs, and enhanced tests. Fixed: excluded .ansible logs and added to .gitignore. 2026-02-09 18:50:44 -08:00
chrisfu
f47c18fef7 feat(infrastructure): enhance k3s automation and OpenTofu integration
- Infrastructure:
    - Updated k3s Ansible role with mountpoint preflight checks and better permission management.
    - Automated deployment of prole configuration and port-forwarding scripts to cluster hosts.
    - Added systemd service for managing port forwards on k3s nodes.
    - Added prole-installer service account token automation.
- K8s Manifests:
    - Renamed and added Persistent Volumes in iscsi-pvs.yaml (including OpenBao support).
    - Updated StatefulSets for garage and openbao.
    - Migrated prole-db to CloudNativePG-based configuration.
    - Added comprehensive OpenTofu manifests for cluster deployment.
- Configuration:
    - Added cluster-specific configurations (k3d, k3s-hosts).
    - Added PostgreSQL configuration templates.
    - Updated .gitignore to track the conf/ directory.
- Tools:
    - Updated install.py and port-forwarding scripts.
    - Added render_manifest.py for manifest generation.
2026-02-07 22:53:18 -08:00
chrisfu
63e6f18b5b Enhance cgroup management: normalize, clean up backslashes, and optimize cmdline processing logic. Add memory controller check. 2026-02-06 12:19:42 -08:00
chrisfu
58faab34fb Add playbooks and manifests for cgroups and iSCSI storage setup
- Introduced cgroup kernel parameter management for `k3s_hosts` via Ansible playbook.
- Added Kubernetes PersistentVolumes for iSCSI storage with specific node affinity.
- Defined `prole-iscsi` StorageClass for volume provisioning.
2026-02-06 01:19:59 -08:00
chrisfu
6b6e5e2aec nodeSelector and storage updates across k8s manifests
- Added `nodeSelector` for multiple Kubernetes resources to ensure scheduling on `myrddin.prole.org`.
- Modified `storage` requests and set `storageClassName` in `garage-statefulset.yaml`.
- Enhanced `install.py` for dynamic environment configuration and kubeconfig handling.
- Improved cgroup management tasks in Ansible with conflict resolution and parameter updates.
- Simplified vault token update process in playbooks and updated encryption checks.
2026-02-06 01:17:54 -08:00
chrisfu
1e87f4684e Add k3s vault token update steps to k3s_sync.yml
- Introduced tasks to update the k3s vault token within the `k3s_sync.yml` playbook.
- Includes vault password file handling and vault file encryption/decryption processes.
2026-02-05 23:44:05 -08:00
chrisfu
abd97008e7 Refactor k3s_sync.yml to improve sync source host selection logic. 2026-02-05 23:15:30 -08:00
chrisfu
92988d8bd2 Refactor k3s_sync.yml to improve sync source host selection logic. 2026-02-05 23:11:55 -08:00
chrisfu
7dca902d39 Refactor k3s_sync.yml to improve sync source host selection logic. 2026-02-05 23:05:02 -08:00
chrisfu
e7d2b8fe52 Refactor k3s_sync.yml to improve sync source host selection logic. 2026-02-05 22:42:45 -08:00
chrisfu
68948be107 Refactor k3s synchronization playbooks to streamline metadata handling and ensure source inclusion. 2026-02-05 22:37:17 -08:00
chrisfu
5ae0c0bcb9 k3s_sync task 2026-02-05 22:26:17 -08:00
chrisfu
da2f6600ba feat: infrastructure and installer updates for k3s, OpenTofu, and prole-db
- Add k3s start/stop Ansible playbooks and roles.

- Implement OpenTofu initialization scripts and k8s manifests.

- Update ncurses installer with OpenTofu support and improved k3s integration.

- Add mode support (--mode) to etc/ initialization scripts.

- Update prole-db with recovery, barman objectstore, and SSH OpenBao support.

- Refine k8s manifests for OpenBao and prole-db.
2026-02-05 21:27:18 -08:00
chrisfu
a9c1c18891 samba family passwords never expire 2026-01-30 00:03:29 -08:00
chrisfu
519235558a add ansible role samba_dns. master group_vars/all/dns.yml\nfixed role iscsi 2026-01-29 16:58:30 -08:00
chrisfu
706fbbd28b ansible correct retropie fstab 2026-01-29 00:50:45 -08:00
chrisfu
d7b6a72ece Refactor cgroups task for cleaner syntax using a ternary filter 2026-01-28 15:27:12 -08:00
chrisfu
826f28ccdb Add cgroups prerequisite role for k3s 2026-01-28 15:17:26 -08:00
chrisfu
b1dde37f8c Add serial execution and integrate cgroup role in k3s reset playbook 2026-01-28 15:03:10 -08:00
chrisfu
d7c4778b51 Add preflight checks for cgroup kernel params in k3s setup
- Ensure cgroup kernel parameters are present before k3s installation.
- Introduce playbook changes to integrate cgroup prerequisites role.
2026-01-28 14:38:36 -08:00
chrisfu
2e4d785de3 Refactor k3s version installation logic to use a ternary filter for cleaner syntax in main.yml. 2026-01-28 13:43:46 -08:00
chrisfu
887c485c32 Add playbooks for k3s reset and deletion with vault token removal. Include k3s cleanup tasks role. 2026-01-28 13:34:37 -08:00
chrisfu
23624eb692 ansibles roles k3s, local_user 2026-01-28 13:05:28 -08:00
chrisfu
b4cea8c6f5 add samba_ad_dc role 2026-01-28 12:41:06 -08:00
chrisfu
987a7acda1 correct myrddin prole-db mount point 2026-01-28 12:17:35 -08:00
chrisfu
453ccfd015 Add k3s kubeconfig user configuration and iSCSI target defaults 2026-01-27 21:46:56 -08:00
chrisfu
c7a651552a Samba Active Directory family user setup script 2026-01-27 16:51:35 -08:00
chrisfu
89c1e1ebef ansible add /prole/home 2026-01-27 00:43:17 -08:00
chrisfu
5803e319d5 add missing vals 2026-01-26 20:46:44 -08:00
chrisfu
37156086aa ansible stable 2026-01-26 18:56:17 -08:00
chrisfu
79515fb0ec fix LUN PROLE-PI-2 iqn 2026-01-26 16:55:56 -08:00
chrisfu
862f21fe1d reusability 2026-01-26 00:08:29 -08:00
chrisfu
035d63090c Fix Ansible YAML parsing errors and standardize host_vars. Removed invalid '---' document separators from host_vars files, merged redundant myrddin config, and renamed host_vars to use .yml extension. Verified with successful ansible-playbook --syntax-check. 2026-01-25 23:36:25 -08:00
chrisfu
ff1150fa9e add iscsi mount guardrails. get k3s server token script 2026-01-25 22:18:10 -08:00
chrisfu
613d9bfbc6 ansible add myrddin.prole.org host_vars 2026-01-25 21:27:53 -08:00
chrisfu
20d408ff36 add iscsi role and vault 2026-01-25 15:31:33 -08:00
chrisfu
5cb2dbdc57 fix k3s role 2026-01-25 06:00:38 -08:00
chrisfu
7c25d731ce /var/log/pihole SAN mounted 2026-01-25 05:33:40 -08:00
chrisfu
b250d17a93 added iscsi role, ensure /var/lib/rancher storage is mounted before k3s 2026-01-25 01:26:07 -08:00
chrisfu
05f1058204 Refactor rsyslog template path and introduce noswap role:
- Modified `10-server.conf.j2` to use `%HOSTNAME%/%programname%.log` for log file paths.
- Added `noswap` role with tasks for swap management: disabling swap, removing swap entries, managing dphys-swapfile, and zramswap services.
- Included handlers for reloading systemd after changes.
2026-01-24 01:32:01 -08:00
chrisfu
63384fa309 fix missing file 2026-01-24 00:54:24 -08:00
chrisfu
c0b15f2609 Update Ansible configuration to enable run_logger callback plugin
- Added `callback_plugins` and `callbacks_enabled` configurations in `ansible.cfg` and `infrastructure/ansible.cfg` to activate the `run_logger`.
2026-01-24 00:41:34 -08:00
chrisfu
829d8d14fd k3s should not initialize and start yet, install, ensure stopped. k3s storage next before init 2026-01-24 00:35:11 -08:00
chrisfu
59cc9f7edf Update K3s and Samba DNS configurations
- Change K3s service to be stopped and disabled by default.
- Adjust PTR records in the inventory to ensure correct FQDN mappings.
- Refactor Samba DNS task to use include_tasks for PTR records.
2026-01-23 20:33:17 -08:00
chrisfu
dfed907938 Fix k3s_node_ip detection on hosts without wired IP: Added fallback to default IPv4 address if none of the specified wired interfaces have an IP address. 2026-01-21 20:39:10 -08:00
chrisfu
a604e8f6eb Fix samba_reverse_dns role by ensuring ad_dc vault variables are loaded: Restructured group_vars/ad_dc into a directory to allow multiple variable files to be loaded by Ansible. 2026-01-21 20:09:13 -08:00
chrisfu
6b24abf839 Configure Ansible to run from project root and improve vault integration: Added root ansible.cfg, updated infrastructure/ansible.cfg, added etc/init_ansible.sh, and updated ad_dc.yml for vault integration. 2026-01-21 19:10:52 -08:00
chrisfu
9d96a94bec ansible: replace no_swap role with swap role and enhance K3s setup
- Removed the `no_swap` role and replaced it with the new `swap` role for managing swap configurations.
- Updated the K3s role to dynamically detect the first available wired interface IP and validate it.
- Enhanced K3s installation by adding support for disabling SELinux RPM.
- Adjusted inventory and `site.yml` to align with the updated roles.
- Added `.vault_pass` to `.gitignore`.
- Updated Ansible configuration with result format compatibility for different versions.
2026-01-21 16:19:17 -08:00
chrisfu
1a30f44106 ansible: replace no_swap role with swap role and enhance K3s setup
- Removed the `no_swap` role and replaced it with the new `swap` role for managing swap configurations.
- Updated the K3s role to dynamically detect the first available wired interface IP and validate it.
- Enhanced K3s installation by adding support for disabling SELinux RPM.
- Adjusted inventory and `site.yml` to align with the updated roles.
- Added `.vault_pass` to `.gitignore`.
- Updated Ansible configuration with result format compatibility for different versions.
2026-01-21 16:19:14 -08:00
chrisfu
e69b5f2008 ansible: replace no_swap role with swap role and enhance K3s setup
- Removed the `no_swap` role and replaced it with the new `swap` role for managing swap configurations.
- Updated the K3s role to dynamically detect the first available wired interface IP and validate it.
- Enhanced K3s installation by adding support for disabling SELinux RPM.
- Adjusted inventory and `site.yml` to align with the updated roles.
- Added `.vault_pass` to `.gitignore`.
- Updated Ansible configuration with result format compatibility for different versions.
2026-01-21 16:16:14 -08:00
chrisfu
bee7c09d89 infrastructure: rsyslogd use fqdn directory names 2026-01-21 16:00:53 -08:00
chrisfu
1a69097699 fix hostname typo 2026-01-21 10:38:39 -08:00
chrisfu
f4d96211d8 ansible: add K3s role files 2026-01-21 10:27:27 -08:00
chrisfu
772a36294e ansible: configure K3s cluster and update inventory
- Added `k3s_hosts` group to the inventory and associated host entries.
- Updated `site.yml` to include roles for disabling swap and setting up the K3s cluster.
2026-01-21 10:23:05 -08:00
chrisfu
a6cc1173e9 ansible: update inventory and configure rsyslog for Linux hosts
- Add `Linux_Hosts` group in inventory with child nodes.
- Update `site.yml` to apply `rsyslog` role to `Linux_Hosts` with privilege escalation.
2026-01-20 22:16:32 -08:00
chrisfu
5b76fc9b6e pihole ansible management fixes 2026-01-19 01:41:45 -08:00
chrisfu
9cfac76b4c ansible managed rsyslog 2026-01-18 22:49:49 -08:00
chrisfu
d55459b83f ansible managed piholes 2026-01-18 22:01:23 -08:00
chrisfu
031bd51a80 Configure Pi-hole DNS forwarding and Samba AD reverse DNS zone 2026-01-18 20:38:24 -08:00
chrisfu
d9418b8b43 ansible roles: pihole_dnx samaba_reverse_dns 2026-01-18 20:12:59 -08:00
chrisfu
c4156f58d0 ansible starts here 2026-01-18 20:02:41 -08:00