128 Commits

Author SHA1 Message Date
be8e50d590 deploy hermes 2026-05-25 20:21:24 -05:00
e309acd67d fix typo 2026-05-24 21:15:08 -05:00
4e7f14ea5a additional service name changes 2026-05-24 21:12:10 -05:00
b79f0505b7 update pbs to timekeeper 2026-05-24 19:46:19 -05:00
045ac85353 update glance configmap 2026-05-24 19:43:13 -05:00
60af4304b6 fix url 2026-05-24 18:35:52 -05:00
96e946ac09 change to https 2026-05-24 18:33:16 -05:00
6584ed9dc4 added glance dashboard 2026-05-24 17:04:49 -05:00
3017c27910 fix port 2026-05-19 23:03:49 -05:00
c25c2a25ad update referencegrant 2026-05-19 22:41:41 -05:00
0476e489d4 more 2026-05-19 22:35:05 -05:00
bf0d7a20a7 update gateway 2026-05-19 22:31:22 -05:00
ed0091cd05 adjust session duration 2026-05-19 22:25:00 -05:00
402f93ab38 add ingnore 2026-05-19 22:16:31 -05:00
8944da8c99 folder rename 2026-05-19 22:06:48 -05:00
d671700466 deploy headlamp 2026-05-19 22:00:34 -05:00
562e102a9b enable metrics 2026-05-19 21:34:46 -05:00
f4c60d7560 add grafana dashboards 2026-05-19 21:12:54 -05:00
0dae8327eb update prometheus scrape 2026-05-18 22:57:07 -05:00
39b7b91f45 update snmp exporter 2026-05-18 22:32:13 -05:00
a7f77514d6 additional monitoring scrapes 2026-05-18 22:28:14 -05:00
b45dcea4c3 update gateway spec 2026-05-18 22:01:18 -05:00
2ed70b4964 Deploy monitoring stack 2026-05-18 21:42:32 -05:00
dbf0b18f07 authentik for argo 2026-05-18 19:43:21 -05:00
1cfc9b5f5d align gateway spec 2026-05-18 19:28:50 -05:00
c8f75bef8a fix referencegrant 2026-05-18 19:25:41 -05:00
fc171b48e9 deploy gateway 2026-05-18 19:11:42 -05:00
5504d0c6f4 add gateway to external dns 2026-05-18 18:15:33 -05:00
025e9a8f1c Added bootstrap folder and gateway controller 2026-05-18 18:07:35 -05:00
06db61c6c0 enable nfs csi 2026-05-18 17:19:39 -05:00
8601ad9cd9 move archive 2026-05-18 15:15:36 -05:00
1f7318f1c3 repo cleanup 2026-05-18 15:13:12 -05:00
cdc78955b1 cilium, argo 2026-05-18 13:20:42 -05:00
6f0c751f63 fix: set enforce:privileged for Cilium compatibility 2026-05-18 10:43:27 -05:00
f1ef759206 fix(cilium): update LB pool API from v2alpha1 to v2 2026-05-18 00:59:17 -05:00
5f5f8cb173 fix argocd 2026-05-18 00:45:47 -05:00
eb93eb7352 fix(argocd): remove conflicting server patch, params-cm handles insecure mode 2026-05-18 00:39:43 -05:00
9cd9a30fbe fix(argocd): switch to ingress-nginx, fix shared resource warning, add insecure mode 2026-05-18 00:34:21 -05:00
5a30521d66 fix(argocd): use env var for insecure mode instead of args 2026-05-18 00:23:03 -05:00
725d403d34 helm fix 2026-05-18 00:08:30 -05:00
9a604042ca update cilium 2026-05-18 00:01:03 -05:00
10406e1705 remove gateway api 2026-05-17 23:48:22 -05:00
4717f63bc3 cilium 2026-05-17 23:46:44 -05:00
2ff74cdc7c cilium TS 2026-05-17 23:39:11 -05:00
87f2d6bf95 fix cilium 2026-05-17 23:32:24 -05:00
88ec796267 ext dns and cert manager 2026-05-17 22:59:45 -05:00
344a29a374 fix directory for 1p 2026-05-17 22:55:32 -05:00
c7fbe8e963 fix(platform): move gateway and namespace into manifests/ directory 2026-05-17 22:48:51 -05:00
03acab784a fix(argocd): use args not command for --insecure flag 2026-05-17 22:24:26 -05:00
3ce3ecac66 feat(platform): vendor gateway-api CRDs v1.2.1 2026-05-17 22:19:04 -05:00
bc24c00c50 final apps 2026-05-17 21:41:28 -05:00
3e9a843e1b cert manager and 1p 2026-05-17 21:37:17 -05:00
5e99408c1f change pattern for external secrets 2026-05-17 21:33:24 -05:00
e4a2c47da2 fix(platform): correct helm valueFiles field name for ArgoCD 3.x 2026-05-17 21:18:47 -05:00
13ebe67a35 update 2026-05-17 21:10:45 -05:00
ca1cdd0634 fix(argocd): restore SSH repo credentials for Gitea 2026-05-17 21:10:10 -05:00
74e53d1364 fix(platform): valuesFile → valuesFiles for ArgoCD 3.x compatibility 2026-05-17 21:04:21 -05:00
e946bd71f0 feat(platform): vendor gateway-api CRDs v1.2.1 2026-05-17 20:45:53 -05:00
905b4619d6 Initial argo deployment 2026-05-17 20:44:31 -05:00
97e9889251 feat(fastpass): Talos cluster provisioning and bootstrap
- Terraform: VM provisioning, Unifi DHCP, Technitium DNS
- talhelper: cluster config for 6-node Talos cluster
- Cilium 1.19.4 CNI with Talos-compatible security context
- docs: city-hall setup guide and bootstrap runbook
2026-05-17 16:08:19 -05:00
9f3ac95d8d gitea and authentik 2026-05-16 16:22:14 -05:00
84523d0054 configure prometheus for ubiquiti and proxmox cluster 2026-05-08 00:25:55 -05:00
f8c6b327f9 Deploy gites 2026-05-07 22:07:53 -05:00
79662aa545 Deployed prometheus/grafana 2026-04-26 23:00:37 -05:00
69b91a2e1d Move nextcloud external access to traefik. 2026-04-18 21:51:28 -05:00
9961fe1ed4 deploy nextcloud 2026-04-18 00:36:40 -05:00
4db6f0b06f added test playbook 2026-03-22 23:47:47 -05:00
307413f3f2 Ansible deployed via boilerplates and playbooks 2026-03-22 18:15:55 -05:00
836ef66cf0 fix dash 2026-03-21 19:48:17 -05:00
4cbaebc98b rename playbook 2026-03-21 19:46:59 -05:00
c1d85b7f89 Remove NetBox Traefik config - deferred until Compose rebuild 2026-03-21 19:10:10 -05:00
c087f32355 redeploy authentic policies as code. 2026-03-21 14:00:37 -05:00
9ad585681f fix ssh handler 2026-03-19 16:53:45 -05:00
40ab77f061 update test file 2026-03-19 16:44:59 -05:00
1d0adb7689 step enrollment 2026-03-19 16:29:09 -05:00
1d6b216b74 remove step-ca from traefik 2026-03-14 22:39:35 -05:00
df0d81ec4d fix directory permissions 2026-03-14 22:32:40 -05:00
ea7d079f27 update step playbook 2026-03-14 22:30:18 -05:00
5022fc90ab update ansible inventory 2026-03-14 22:27:20 -05:00
45c478bede fixed terraform 2026-03-14 22:21:22 -05:00
03b8abbe4d fix terraform 2026-03-14 22:18:28 -05:00
42ea1e2d03 deploy step 2026-03-14 22:15:28 -05:00
b85b237129 rename turnstile to guest-relations 2026-03-14 21:08:35 -05:00
1d6a8c154c updated documentation 2026-03-10 20:41:34 -05:00
6f14d48d5e oidc again 2026-03-10 20:34:00 -05:00
fa9fd9c65f fix oidc 2026-03-10 20:30:07 -05:00
86cf979453 debugging 2026-03-10 20:28:06 -05:00
cc0fd647ab update ansible user for proxmox 2026-03-10 20:21:53 -05:00
591522f643 updated ansible inventory (proxmox) 2026-03-09 22:41:13 -05:00
643fefb4bf ansible for proxmox config 2026-03-09 22:36:42 -05:00
e8810195cd updwated documentation 2026-03-09 16:27:30 -05:00
3d2669497a update traefik config 2026-03-08 20:39:34 -05:00
42f7a2773d updated inventory 2026-03-08 20:34:59 -05:00
35c1bdb3bf ansible for authentik deployment. 2026-03-08 20:30:51 -05:00
9605b9d3bd Added authentic boilerplate 2026-03-08 16:23:11 -05:00
dfa219191d add terraform definition for turnstile 2026-03-08 16:12:16 -05:00
14502df261 update tradfik networking 2026-03-08 15:54:15 -05:00
ea7e05dcc2 fixed docker install 2026-03-08 15:47:18 -05:00
26f7d3214f switched ntp client to chrony 2026-03-08 15:41:09 -05:00
173a36c518 changed hosts 2026-03-08 15:31:23 -05:00
fcb1777336 move roles 2026-03-08 15:28:09 -05:00
f82c13cd09 updated ansible 2026-03-07 23:08:06 -06:00
e9a854faed moved boilerplates 2026-03-07 22:49:59 -06:00
344e8dff69 updated ansible for lightning-lane 2026-03-07 22:47:37 -06:00
36c2e9540c updated tfvars 2026-03-07 22:00:41 -06:00
40dda3241f update vm initialization 2026-03-07 21:56:49 -06:00
db67f71a3c added variables 2026-03-07 21:53:56 -06:00
920ea80261 terraform files in the right folder 2026-03-07 21:46:44 -06:00
ad03943339 added tfvars 2026-03-07 21:25:54 -06:00
a349ce13f8 Added terraform for lightning-lane 2026-03-07 21:18:36 -06:00
7d7129632f updated technical tdp 2026-03-07 17:50:08 -06:00
e3b3401544 VM provisioning idempotency 2026-03-06 23:10:56 -06:00
bba9278895 n8n workflow to create a VM from Netbox 2026-02-28 20:06:41 -06:00
d941557e88 Update terraform to use vm_id from n8n. 2026-02-28 00:00:56 -06:00
4964552483 fix(terraform): set OVMF bios, correct DNS domain, remove VLAN from interface 2026-02-27 19:56:15 -06:00
7e0b0a859b feat(terraform): add Proxmox VM and Unifi DHCP modules (Phase 2) 2026-02-27 19:12:25 -06:00
b33bd5f252 feat(netbox): add custom field, VLAN, and prefix initializers (Phase 1.1-1.4) 2026-02-25 21:43:47 -06:00
63b9a8fd13 docs: rewrite README for mk-labs architecture 2026-02-25 20:55:38 -06:00
6350cb681f chore: update .gitignore for new repo structure (fix terraform/ exclusion) 2026-02-25 20:53:01 -06:00
676fc02c91 feat: create pipeline directory structure (terraform, n8n, netbox, docs) 2026-02-25 20:51:26 -06:00
75e0d99495 refactor: move Packer templates to top-level packer/ directory 2026-02-25 20:51:20 -06:00
b51cd1a868 refactor: move ansible.cfg to ansible/ directory 2026-02-25 20:51:12 -06:00
7187dc8280 refactor: move shared Ansible tasks to ansible/tasks/ 2026-02-25 20:51:02 -06:00
86708542c9 refactor: move Ansible roles to standard ansible/roles/ location 2026-02-25 20:46:33 -06:00
74172c4e5a chore: archive deprecated infra-config content (SNO cluster, duplicate ansible, old playbooks) 2026-02-25 20:45:01 -06:00
8c8835d1d5 chore: archive deprecated Ansible content (OpenShift, Fastpass, FreeIPA, k8s) 2026-02-25 20:44:49 -06:00
286d20f8c1 chore: archive OpenShift/ACM cluster content, hub-bootstrap, and applications 2026-02-25 20:44:37 -06:00
05ba1bbdb3 chore: remove misc files 2026-02-25 20:43:28 -06:00
574 changed files with 14471 additions and 12206 deletions

61
.gitignore vendored
View File

@@ -1,15 +1,9 @@
# macOS system files
# macOS
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
@@ -17,36 +11,53 @@ Icon
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# VS Code
.vscode/
# macOS metadata
*.icloud
# Terraform
terraform/
# IDE
.vscode/
.idea/
.kiro/
# Terraform (track .tf files, ignore state and runtime)
.terraform/
*.tfstate
*.tfstate.backup
# Crash log files
# *.tfvars
!*.tfvars.example
!*.pkrvars.hcl
crash.log
# Ignore override files as they are usually used to override resources locally
*.override.tf
*.override.tf.json
# Ignore CLI configuration files
.terraformrc
.terraformrc.json
terraform.rc
# Ignore secrets
doppler-token.yaml
# Ansible
*.retry
ansible/vault/*.vault
# Packer
packer_cache/
# Secrets
*.pem
*.key
# Environment files with secrets
boilerplates/**/.env
# Local paths
~/
# Misc
doppler-token.yaml
# talhelper generated machine configs — contain secrets, never commit
talos/talhelper/clusterconfig/
# talenv.yaml plaintext — only commit the SOPS-encrypted version
talos/talhelper/talenv.yaml
!talos/talhelper/talenv.sops.yaml

View File

@@ -1,209 +0,0 @@
# Design Document
## Overview
The AppleScript Calendar Sync system is designed as a standalone AppleScript application that synchronizes calendar events between two calendar accounts for the current day only. The system uses macOS Calendar app's AppleScript interface to read events from a source calendar and mirror them to a destination calendar, including removal of events that no longer exist in the source.
## Architecture
The system follows a simple pipeline architecture:
```
[Source Calendar] → [Event Reader] → [Event Processor] → [Destination Calendar]
[Duplicate Detector]
[Cleanup Manager]
```
### Core Components
1. **Calendar Manager**: Handles calendar account and calendar selection/validation
2. **Event Reader**: Retrieves events from source calendar for current day
3. **Event Processor**: Processes and transforms events for destination calendar
4. **Sync Engine**: Coordinates the synchronization process including cleanup
5. **Logger**: Provides user feedback and error reporting
## Components and Interfaces
### Calendar Manager
```applescript
-- Validates and retrieves calendar references
on getCalendar(accountName, calendarName)
on validateCalendarAccess(calendar)
on listAvailableCalendars()
```
**Responsibilities:**
- Validate calendar account and calendar names exist
- Return calendar object references for AppleScript operations
- Handle calendar access permissions and errors
### Event Reader
```applescript
-- Reads events from source calendar for current day
on getEventsForToday(sourceCalendar)
on parseEventProperties(event)
```
**Responsibilities:**
- Query source calendar for events occurring on current date
- Extract event properties (title, start time, end time, description, etc.)
- Handle different event types (all-day, timed, recurring)
### Event Processor
```applescript
-- Processes events for destination calendar
on createEventInDestination(eventData, destinationCalendar)
on updateExistingEvent(existingEvent, newEventData)
on compareEvents(event1, event2)
```
**Responsibilities:**
- Create new events in destination calendar
- Update modified events
- Compare events for duplicate detection
### Sync Engine
```applescript
-- Main synchronization coordinator
on performSync(sourceCalendar, destinationCalendar)
on cleanupRemovedEvents(sourceEvents, destinationEvents, destinationCalendar)
on generateSyncReport(results)
```
**Responsibilities:**
- Coordinate the entire sync process
- Manage event cleanup (removal of events not in source)
- Generate sync reports and statistics
### Logger
```applescript
-- Logging and user feedback
on logMessage(message, level)
on displayProgress(current, total)
on showSyncSummary(summary)
```
**Responsibilities:**
- Display progress information to user
- Log errors and warnings
- Show final sync summary
## Data Models
### Event Data Structure
```applescript
record EventData
title: string
startDate: date
endDate: date
isAllDay: boolean
description: string
location: string
uid: string (for duplicate detection)
end record
```
### Sync Result Structure
```applescript
record SyncResult
eventsCreated: integer
eventsUpdated: integer
eventsRemoved: integer
eventsSkipped: integer
errors: list of strings
end record
```
## Error Handling
### Error Categories
1. **Calendar Access Errors**: Invalid calendar names, permission issues
2. **Event Processing Errors**: Malformed events, property access failures
3. **Sync Operation Errors**: Network issues, calendar service unavailable
### Error Handling Strategy
- Graceful degradation: Continue processing other events when individual events fail
- Detailed error logging with specific error messages
- User-friendly error reporting with suggested solutions
- Rollback capability for critical failures
### Error Recovery
```applescript
on handleCalendarError(errorMessage)
-- Log error details
-- Provide user-friendly error message
-- Suggest corrective actions
end handleCalendarError
```
## Testing Strategy
### Unit Testing Approach
Since AppleScript has limited testing frameworks, testing will focus on:
1. **Manual Testing Scenarios**:
- Test with empty source calendar
- Test with events spanning multiple days
- Test with all-day events
- Test with recurring events
- Test calendar access errors
2. **Integration Testing**:
- Test full sync workflow with real calendar data
- Test cleanup functionality (event removal)
- Test duplicate detection accuracy
- Test error handling with invalid inputs
3. **Edge Case Testing**:
- Very long event titles and descriptions
- Events with special characters
- Overlapping events
- Events created/modified during sync
### Test Data Requirements
- Test calendars with known event sets
- Events with various properties (all-day, timed, recurring)
- Events with special characters and long descriptions
- Calendar accounts with different permission levels
## Implementation Considerations
### AppleScript Calendar Integration
- Use `Calendar` application's AppleScript dictionary
- Handle calendar app launch and focus management
- Manage calendar selection and event creation timing
### Performance Optimization
- Batch event operations where possible
- Minimize calendar app UI interactions
- Cache calendar references to avoid repeated lookups
### User Experience
- Provide clear progress indicators
- Show meaningful error messages
- Allow user to cancel long-running operations
- Display comprehensive sync results
### Security and Privacy
- Request calendar access permissions appropriately
- Handle sensitive calendar data securely
- Provide clear information about what data is accessed
## Configuration Management
### User Configuration
```applescript
-- Configuration properties
property sourceAccountName : "Work Account"
property sourceCalendarName : "Main Calendar"
property destinationAccountName : "Personal Account"
property destinationCalendarName : "Synced Events"
property enableLogging : true
```
### Runtime Configuration
- Allow users to modify calendar names without editing script
- Provide configuration validation before sync starts
- Save user preferences for repeated use

View File

@@ -1,73 +0,0 @@
# Requirements Document
## Introduction
This feature enables automatic synchronization of calendar entries between two different calendar accounts using AppleScript. The system will copy events from a source calendar account to a destination calendar account, maintaining event details while avoiding duplicates and providing configurable sync options.
## Requirements
### Requirement 1
**User Story:** As a user with multiple calendar accounts, I want to sync events from one account to another, so that I can maintain consistent scheduling across different calendar systems.
#### Acceptance Criteria
1. WHEN the sync script is executed THEN the system SHALL read all events from the specified source calendar
2. WHEN events are found in the source calendar THEN the system SHALL copy them to the specified destination calendar
3. WHEN copying events THEN the system SHALL preserve event title, date, time, duration, and description
4. IF an event already exists in the destination calendar THEN the system SHALL skip creating a duplicate
### Requirement 2
**User Story:** As a user, I want to configure which calendars to sync between, so that I can control the data flow between my accounts.
#### Acceptance Criteria
1. WHEN configuring the sync THEN the system SHALL allow selection of source calendar account and specific calendar
2. WHEN configuring the sync THEN the system SHALL allow selection of destination calendar account and specific calendar
3. WHEN invalid calendar names are provided THEN the system SHALL display an error message and exit gracefully
4. WHEN calendar accounts are not accessible THEN the system SHALL provide clear error messaging
### Requirement 3
**User Story:** As a user, I want the sync to focus on today's events only, so that I maintain current day synchronization without overwhelming the destination calendar.
#### Acceptance Criteria
1. WHEN the sync runs THEN the system SHALL only process events occurring on the current day
2. WHEN determining current day THEN the system SHALL use the local system date
3. WHEN events span multiple days THEN the system SHALL include events that start or occur on the current day
4. WHEN no events exist for the current day THEN the system SHALL complete successfully with appropriate messaging
### Requirement 4
**User Story:** As a user, I want the destination calendar to mirror the source calendar for the current day, so that removed events are also cleaned up automatically.
#### Acceptance Criteria
1. WHEN checking for duplicates THEN the system SHALL compare event title, start date, and start time
2. WHEN a matching event is found in the destination THEN the system SHALL skip creating the duplicate
3. WHEN an event exists in the destination but not in the source for the current day THEN the system SHALL remove it from the destination
4. WHEN an event has been modified in the source THEN the system SHALL update the corresponding event in the destination
### Requirement 5
**User Story:** As a user, I want to see progress and results of the sync operation, so that I can verify the synchronization was successful.
#### Acceptance Criteria
1. WHEN the sync starts THEN the system SHALL display the source and destination calendar information
2. WHEN processing events THEN the system SHALL show progress indicators for each event processed
3. WHEN the sync completes THEN the system SHALL display a summary of events copied, skipped, and any errors
4. WHEN errors occur THEN the system SHALL log detailed error information for troubleshooting
### Requirement 6
**User Story:** As a user, I want the sync to handle different event types and properties, so that all my calendar data is accurately transferred.
#### Acceptance Criteria
1. WHEN syncing events THEN the system SHALL handle all-day events correctly
2. WHEN syncing events THEN the system SHALL preserve recurring event patterns when possible
3. WHEN syncing events THEN the system SHALL handle events with attendees and meeting details
4. WHEN event properties cannot be transferred THEN the system SHALL log which properties were skipped

View File

@@ -1,125 +0,0 @@
# Implementation Plan
- [x] 1. Set up project structure and configuration
- Create main AppleScript file with basic structure and configuration properties
- Define configuration properties for source and destination calendars
- Set up logging and error handling framework
- _Requirements: 2.1, 2.2, 5.1_
- [ ] 2. Implement Calendar Manager component
- [ ] 2.1 Create calendar validation and access functions
- Write functions to validate calendar account and calendar names exist
- Implement calendar object retrieval with error handling
- Create function to list available calendars for debugging
- _Requirements: 2.1, 2.2, 2.3, 2.4_
- [ ]* 2.2 Write unit tests for calendar access
- Create test scenarios for invalid calendar names
- Test calendar access permission handling
- _Requirements: 2.3, 2.4_
- [ ] 3. Implement Event Reader component
- [ ] 3.1 Create current day event retrieval function
- Write function to get today's date and create date range
- Implement event query for current day from source calendar
- Handle different event types (all-day, timed events)
- _Requirements: 1.1, 3.1, 3.2, 3.3_
- [ ] 3.2 Implement event property extraction
- Create function to extract event title, dates, description, location
- Handle event property access errors gracefully
- Parse recurring events for current day occurrences
- _Requirements: 1.3, 6.1, 6.2, 6.3_
- [ ]* 3.3 Write tests for event reading functionality
- Test event retrieval with various event types
- Test property extraction accuracy
- _Requirements: 1.1, 1.3_
- [ ] 4. Implement Event Processor component
- [ ] 4.1 Create event comparison and duplicate detection
- Write function to compare events by title, start date, and start time
- Implement duplicate detection logic for existing events
- Handle event matching edge cases
- _Requirements: 4.1, 4.2_
- [ ] 4.2 Implement event creation and update functions
- Create function to add new events to destination calendar
- Implement event update functionality for modified events
- Handle event creation errors and property limitations
- _Requirements: 1.2, 1.3, 4.4, 6.4_
- [ ]* 4.3 Write tests for event processing
- Test duplicate detection accuracy
- Test event creation with various properties
- _Requirements: 4.1, 4.2, 4.4_
- [ ] 5. Implement Sync Engine component
- [ ] 5.1 Create main synchronization workflow
- Implement the main sync function that coordinates all components
- Add progress tracking and user feedback during sync
- Handle sync workflow errors and recovery
- _Requirements: 1.1, 1.2, 5.2, 5.3_
- [ ] 5.2 Implement cleanup functionality for removed events
- Create function to identify events in destination not in source
- Implement event removal from destination calendar
- Add safety checks to prevent accidental deletions
- _Requirements: 4.3_
- [ ] 5.3 Create sync reporting and statistics
- Implement sync result tracking (created, updated, removed, skipped)
- Create summary display function with detailed results
- Add error reporting and logging
- _Requirements: 5.3, 5.4_
- [ ]* 5.4 Write integration tests for sync engine
- Test complete sync workflow with test data
- Test cleanup functionality accuracy
- Test error handling and recovery
- _Requirements: 4.3, 5.3_
- [ ] 6. Implement Logger component
- [ ] 6.1 Create logging and progress display functions
- Implement message logging with different severity levels
- Create progress indicator for sync operations
- Add user-friendly error message formatting
- _Requirements: 5.1, 5.2, 5.4_
- [ ] 6.2 Implement sync summary display
- Create formatted summary of sync results
- Display statistics for events processed
- Show any errors or warnings encountered
- _Requirements: 5.3, 5.4_
- [ ] 7. Integrate all components and create main script
- [ ] 7.1 Wire together all components in main execution flow
- Create main script entry point that calls all components
- Implement proper error handling and user feedback flow
- Add configuration validation before sync starts
- _Requirements: 2.3, 2.4, 5.1_
- [ ] 7.2 Add user interaction and configuration management
- Implement user prompts for calendar selection if needed
- Add configuration validation and error messaging
- Create user-friendly script execution experience
- _Requirements: 2.1, 2.2, 2.3, 2.4_
- [ ]* 7.3 Create comprehensive end-to-end tests
- Test complete sync workflow with real calendar data
- Test all error scenarios and edge cases
- Validate sync accuracy and cleanup functionality
- _Requirements: 1.1, 1.2, 4.3, 5.3_
- [ ] 8. Finalize and optimize the script
- [ ] 8.1 Add performance optimizations and error recovery
- Optimize calendar access and event processing performance
- Add robust error recovery and rollback capabilities
- Implement proper resource cleanup and calendar app management
- _Requirements: 5.4_
- [ ] 8.2 Create user documentation and usage instructions
- Write clear instructions for script configuration and usage
- Document calendar permission requirements
- Create troubleshooting guide for common issues
- _Requirements: 2.3, 2.4, 5.4_

View File

@@ -1,165 +0,0 @@
# Design Document
## Overview
The `fastpass-additional-control-plane` Ansible role will enable the deployment of additional control plane nodes to an existing FastPass Kubernetes cluster. This role follows the established patterns from `fastpass-first-control-plane` but focuses on joining nodes to an already initialized cluster rather than initializing a new one. The role ensures high availability by creating redundant master nodes that can handle API requests, scheduling, and cluster management tasks.
The key difference from the first control plane role is that this role will use `kubeadm join` with control plane flags instead of `kubeadm init`, and it will need to retrieve join tokens and certificate keys from the existing cluster.
## Architecture
### Role Structure
The role will follow the standard Ansible role structure:
```
ansible/playbooks/roles/fastpass-additional-control-plane/
├── defaults/
│ └── main.yml
├── tasks/
│ └── main.yml
├── handlers/
│ └── main.yml (if needed)
└── meta/
└── main.yml (if needed)
```
### Integration Points
- **DNS Management**: Uses the existing `dns-manager` role for consistent DNS record creation
- **Kubeconfig Management**: Uses the existing `kubeconfig-manager` role for local kubeconfig setup
- **Firewall Configuration**: Reuses firewall service definitions from the first control plane role
- **Cluster Integration**: Coordinates with the first control plane node to obtain join credentials
### Dependencies
- The first control plane node must be fully initialized and running
- The `dns-manager` role must be available for DNS record creation
- The `kubeconfig-manager` role must be available for kubeconfig setup
- Required Kubernetes prerequisites must be installed on target nodes
## Components and Interfaces
### Main Task Flow
1. **Pre-flight Checks**: Verify cluster readiness and node prerequisites
2. **DNS Configuration**: Set up DNS records for the new control plane node
3. **Firewall Configuration**: Open required ports for control plane services
4. **Kubelet Configuration**: Create initial kubelet configuration
5. **Join Token Retrieval**: Get join token and certificate key from first control plane
6. **Cluster Join**: Execute kubeadm join with control plane flags
7. **Service Management**: Ensure kubelet is enabled and running
8. **Kubeconfig Setup**: Configure local kubeconfig access
9. **Verification**: Validate successful cluster join
### Key Variables
- `cluster_name`: Name of the Kubernetes cluster
- `ip_address`: IP address of the current control plane node
- `first_control_plane_host`: Hostname/IP of the first control plane node
- `kubernetes_services_control_plane`: List of firewall services to open
- `join_token_ttl`: TTL for join tokens (default: 24h)
- `certificate_key_ttl`: TTL for certificate keys (default: 2h)
### External Role Interfaces
- **dns-manager**: Provides DNS record creation with `host_name` variable
- **kubeconfig-manager**: Handles kubeconfig merging with `cluster_name` variable
- **First Control Plane**: Source for join tokens and certificate keys
## Data Models
### Join Credentials Structure
```yaml
join_credentials:
token: "abcdef.1234567890abcdef"
discovery_token_ca_cert_hash: "sha256:..."
certificate_key: "..."
api_server_endpoint: "cluster-name:6443"
```
### Firewall Services
```yaml
kubernetes_services_control_plane:
- kubernetes_API # Port 6443
- etcd # Ports 2379-2380
- kubelet # Port 10250
- kube-scheduler # Port 10259
- kube-controller-manager # Port 10257
```
### Node Status Tracking
```yaml
node_status:
joined: false
kubelet_running: false
dns_configured: false
kubeconfig_ready: false
```
## Error Handling
### Join Token Management
- **Token Expiration**: Automatically generate new tokens if existing ones are expired
- **Certificate Key Rotation**: Handle certificate key expiration gracefully
- **Network Connectivity**: Retry join operations with exponential backoff
- **API Server Availability**: Wait for API server readiness before attempting join
### Idempotency Checks
- **Already Joined Nodes**: Skip join process if node is already part of the cluster
- **Existing Configuration**: Preserve existing kubelet configuration if valid
- **DNS Records**: Update existing DNS records instead of creating duplicates
- **Service Status**: Only restart services if configuration changes
### Failure Recovery
- **Partial Join Failures**: Clean up partial configurations and retry
- **Network Issues**: Provide clear error messages for connectivity problems
- **Permission Errors**: Validate sudo/root access before attempting operations
- **Resource Constraints**: Check system resources before proceeding
## Testing Strategy
### Unit Testing Approach
- **Task Validation**: Test individual tasks with mock data
- **Variable Validation**: Ensure required variables are properly defined
- **Conditional Logic**: Test all conditional branches in tasks
- **Error Scenarios**: Validate error handling for common failure cases
### Integration Testing
- **Multi-Node Clusters**: Test with 3 and 5 control plane node configurations
- **Network Scenarios**: Test across different network topologies
- **OS Compatibility**: Validate on supported operating systems (Ubuntu/Debian)
- **Version Compatibility**: Test with different Kubernetes versions
### Validation Checks
- **Cluster Health**: Verify all control plane nodes are healthy after join
- **API Availability**: Confirm API server is accessible from all nodes
- **Etcd Cluster**: Validate etcd cluster membership and health
- **Scheduling**: Test pod scheduling across all control plane nodes
- **Failover**: Verify cluster continues operating if one control plane fails
### Test Scenarios
1. **Fresh Join**: Join additional control plane to newly created cluster
2. **Existing Cluster**: Add control plane to cluster with existing workloads
3. **Network Partitions**: Test behavior during temporary network issues
4. **Token Expiration**: Handle expired join tokens gracefully
5. **Retry Operations**: Validate retry logic for transient failures
## Implementation Considerations
### Security
- **Token Security**: Ensure join tokens are handled securely and not logged
- **Certificate Management**: Properly manage and rotate certificate keys
- **Network Security**: Validate firewall rules don't expose unnecessary ports
- **Access Control**: Ensure proper RBAC is maintained after node joins
### Performance
- **Parallel Execution**: Support joining multiple control plane nodes simultaneously
- **Resource Usage**: Monitor CPU and memory usage during join process
- **Network Bandwidth**: Optimize data transfer during cluster join
- **Startup Time**: Minimize time to achieve cluster readiness
### Monitoring and Observability
- **Join Progress**: Provide clear progress indicators during join process
- **Health Checks**: Implement comprehensive health validation
- **Logging**: Ensure adequate logging for troubleshooting
- **Metrics**: Expose relevant metrics for monitoring cluster growth
### Compatibility
- **Kubernetes Versions**: Support current and previous Kubernetes versions
- **Operating Systems**: Maintain compatibility with Ubuntu and Debian
- **Container Runtimes**: Work with containerd runtime configuration
- **Network Plugins**: Compatible with Flannel CNI configuration

View File

@@ -1,77 +0,0 @@
# Requirements Document
## Introduction
This feature involves creating an Ansible role called `fastpass-additional-control-plane` that will deploy additional control plane nodes to an existing FastPass Kubernetes cluster. The role will follow the same pattern as the existing `fastpass-first-control-plane` role but will focus on joining nodes to an already initialized cluster rather than initializing a new cluster. This ensures high availability for the Kubernetes control plane by adding redundant master nodes.
## Requirements
### Requirement 1
**User Story:** As a DevOps engineer, I want to deploy additional control plane nodes to my FastPass Kubernetes cluster, so that I can achieve high availability and fault tolerance for the cluster control plane.
#### Acceptance Criteria
1. WHEN the role is executed on a node THEN the system SHALL join the node to the existing Kubernetes cluster as a control plane node
2. WHEN the role runs THEN the system SHALL configure the necessary firewall rules for control plane services
3. WHEN the role executes THEN the system SHALL ensure the kubelet service is properly configured and running
4. WHEN joining the cluster THEN the system SHALL use the correct join token and certificate key from the first control plane node
5. WHEN the role completes THEN the system SHALL verify the node has successfully joined as a control plane node
### Requirement 2
**User Story:** As a system administrator, I want the additional control plane role to follow the same patterns as the first control plane role, so that the codebase remains consistent and maintainable.
#### Acceptance Criteria
1. WHEN the role is created THEN the system SHALL follow the same directory structure as fastpass-first-control-plane
2. WHEN the role is implemented THEN the system SHALL use similar variable naming conventions and task organization
3. WHEN the role runs THEN the system SHALL include proper error handling and idempotency checks
4. WHEN the role executes THEN the system SHALL use the same firewall service definitions as the first control plane role
5. WHEN the role is documented THEN the system SHALL include proper metadata headers with author, version, and description
### Requirement 3
**User Story:** As a cluster operator, I want the additional control plane nodes to have proper DNS configuration, so that they can be reached by their cluster names and participate in load balancing.
#### Acceptance Criteria
1. WHEN the role runs THEN the system SHALL configure DNS records for the additional control plane nodes
2. WHEN DNS is configured THEN the system SHALL use the dns-manager role for consistency
3. WHEN the role executes THEN the system SHALL ensure the node can resolve the cluster endpoint
4. WHEN DNS setup completes THEN the system SHALL verify connectivity to the cluster API endpoint
### Requirement 4
**User Story:** As a DevOps engineer, I want the role to handle kubeconfig management for additional control plane nodes, so that I can manage the cluster from any control plane node.
#### Acceptance Criteria
1. WHEN the role completes THEN the system SHALL configure kubeconfig for the new control plane node
2. WHEN kubeconfig is set up THEN the system SHALL use the kubeconfig-manager role for consistency
3. WHEN the role runs THEN the system SHALL ensure proper permissions are set on kubeconfig files
4. WHEN kubeconfig is configured THEN the system SHALL verify kubectl access works from the new node
### Requirement 5
**User Story:** As a system administrator, I want the role to be idempotent and handle edge cases, so that I can run it multiple times safely without causing issues.
#### Acceptance Criteria
1. WHEN the role is run multiple times THEN the system SHALL not attempt to rejoin an already joined node
2. WHEN a node is already part of the cluster THEN the system SHALL skip the join process gracefully
3. WHEN the role encounters errors THEN the system SHALL provide clear error messages and fail gracefully
4. WHEN prerequisites are missing THEN the system SHALL report what needs to be configured first
5. WHEN the role runs THEN the system SHALL validate that required variables are defined
### Requirement 6
**User Story:** As a cluster administrator, I want the role to integrate seamlessly with the existing FastPass deployment workflow, so that it can be used in the 4-step deployment process.
#### Acceptance Criteria
1. WHEN the role is created THEN the system SHALL be compatible with the deploy-fastpass-4step.yml playbook
2. WHEN the role runs THEN the system SHALL work with the fastpass_control_plane[1:] host group
3. WHEN integrated THEN the system SHALL not interfere with the first control plane initialization
4. WHEN the role executes THEN the system SHALL depend on the first control plane node being ready
5. WHEN deployment completes THEN the system SHALL allow worker nodes to join the cluster successfully

View File

@@ -1,118 +0,0 @@
# Implementation Plan
- [ ] 1. Create role directory structure and basic configuration
- Create the fastpass-additional-control-plane role directory structure
- Set up defaults/main.yml with required variables and firewall services
- Create meta/main.yml with role metadata and dependencies
- _Requirements: 2.1, 2.2, 2.4_
- [ ] 2. Implement join token and certificate key retrieval
- [ ] 2.1 Create tasks to generate new join tokens from first control plane
- Write Ansible tasks to execute kubeadm token create on first control plane node
- Implement token validation and expiration checking
- Add error handling for token generation failures
- _Requirements: 1.4, 5.4_
- [ ] 2.2 Implement certificate key retrieval and management
- Create tasks to upload and retrieve certificate keys from first control plane
- Add certificate key expiration handling and rotation
- Implement secure handling of certificate keys in variables
- _Requirements: 1.4, 5.1_
- [ ] 2.3 Create discovery token CA certificate hash retrieval
- Write tasks to extract CA certificate hash from first control plane
- Implement validation of certificate hash format
- Add error handling for certificate retrieval failures
- _Requirements: 1.4, 5.4_
- [ ] 3. Implement DNS configuration and firewall setup
- [ ] 3.1 Configure DNS records for additional control plane nodes
- Integrate dns-manager role for consistent DNS record creation
- Pass appropriate host_name variable to dns-manager
- Add DNS propagation wait and validation
- _Requirements: 3.1, 3.2, 3.4_
- [ ] 3.2 Set up firewall rules for control plane services
- Reuse kubernetes_services_control_plane from defaults
- Implement UFW firewall rule creation for Debian/Ubuntu systems
- Add conditional logic for different operating systems
- _Requirements: 1.2, 2.4_
- [ ] 4. Implement kubelet configuration and cluster join
- [ ] 4.1 Create initial kubelet configuration
- Write kubelet config.yaml with systemd cgroup driver
- Set containerd socket endpoint configuration
- Ensure proper file permissions and ownership
- _Requirements: 1.3, 2.3_
- [ ] 4.2 Execute kubeadm join for control plane
- Implement kubeadm join command with control-plane flag
- Use retrieved join token, certificate key, and CA cert hash
- Add proper command argument construction and validation
- Include idempotency checks to prevent duplicate joins
- _Requirements: 1.1, 1.4, 5.1, 5.2_
- [ ] 4.3 Ensure kubelet service management
- Enable and start kubelet systemd service
- Add service status validation and error handling
- Implement service restart logic if needed
- _Requirements: 1.3, 1.5_
- [ ] 5. Implement kubeconfig management and validation
- [ ] 5.1 Configure kubeconfig for additional control plane nodes
- Integrate kubeconfig-manager role for consistent configuration
- Pass cluster_name variable to kubeconfig-manager
- Ensure proper kubeconfig merging with existing configurations
- _Requirements: 4.1, 4.2, 4.3_
- [ ] 5.2 Implement cluster join validation
- Create tasks to verify node successfully joined as control plane
- Add kubectl commands to check node status and roles
- Implement cluster health validation checks
- _Requirements: 1.5, 4.4_
- [ ] 6. Add comprehensive error handling and idempotency
- [ ] 6.1 Implement pre-flight validation checks
- Check if node is already joined to cluster
- Validate required variables are defined
- Verify first control plane node accessibility
- Add system resource and prerequisite checks
- _Requirements: 5.1, 5.2, 5.4, 5.5_
- [ ] 6.2 Add retry logic and failure recovery
- Implement retry mechanisms for transient failures
- Add exponential backoff for network-related operations
- Create cleanup tasks for partial join failures
- _Requirements: 5.3, 5.4_
- [ ] 7. Integration with FastPass deployment workflow
- [ ] 7.1 Ensure compatibility with deploy-fastpass-4step.yml
- Verify role works with fastpass_control_plane[1:] host group
- Test integration with existing playbook structure
- Validate dependency on first control plane completion
- _Requirements: 6.1, 6.2, 6.3, 6.4_
- [ ] 7.2 Add proper task documentation and metadata
- Include role header with author, version, and description
- Add inline comments for complex task logic
- Document required variables and their purposes
- _Requirements: 2.2, 2.5_
- [ ]* 8. Create comprehensive testing and validation
- [ ]* 8.1 Write unit tests for individual tasks
- Create test cases for token retrieval logic
- Test kubeadm join command construction
- Validate error handling scenarios
- _Requirements: 1.1, 1.4, 5.1_
- [ ]* 8.2 Implement integration tests
- Test multi-node control plane deployment
- Validate cluster health after additional nodes join
- Test failover scenarios and cluster resilience
- _Requirements: 1.5, 6.5_
- [ ]* 8.3 Add validation scripts and health checks
- Create scripts to verify cluster state after deployment
- Implement automated health validation
- Add performance and resource usage monitoring
- _Requirements: 1.5, 4.4_

View File

@@ -1,51 +0,0 @@
# Requirements Document
## Introduction
The FastPass Kubernetes cluster deployment currently has critical DNS and load balancing configuration issues that prevent proper high availability setup. While the cluster endpoint `fastpass.local.mk-labs.cloud` is defined in the group variables, the `cluster_vip` variable required by the DNS manager role is missing, and the Traefik load balancer configuration is commented out. This means the cluster endpoint cannot resolve properly and there's no load balancing for the control plane API. This feature will fix these configuration gaps to enable true HA functionality.
## Requirements
### Requirement 1: DNS CNAME Record for Load Balancer
**User Story:** As a DevOps engineer, I want the DNS manager to create a CNAME record for the cluster endpoint pointing to the load balancer, so that the cluster endpoint resolves through the load balancer rather than directly to node IPs.
#### Acceptance Criteria
1. WHEN the dns-manager role is called for a load-balanced cluster THEN the system SHALL create a CNAME record instead of an A record
2. WHEN the CNAME record is created THEN the system SHALL point fastpass.local.mk-labs.cloud to the traefik_server (lightning_lane.local.mk-labs.cloud)
3. WHEN the DNS record type is determined THEN the system SHALL use CNAME for load-balanced endpoints and A records for direct node access
4. WHEN DNS propagation occurs THEN the system SHALL verify that the CNAME resolution works correctly
### Requirement 2: Complete Traefik Integration
**User Story:** As a DevOps engineer, I want the Traefik load balancer to be fully integrated with the FastPass deployment, so that the cluster VIP is properly load balanced across all control plane nodes.
#### Acceptance Criteria
1. WHEN the traefik-manager role is called THEN the system SHALL use the traefik_server variable (lightning_lane) as the target host
2. WHEN Traefik configuration is generated THEN the system SHALL create proper TCP routing for the cluster endpoint to all control plane nodes
3. WHEN the cluster VIP is accessed THEN the system SHALL distribute requests across space-mountain, big-thunder-mountain, and splash-mountain
4. WHEN Traefik configuration is applied THEN the system SHALL reload the Traefik service to activate the new configuration
### Requirement 3: High Availability Validation
**User Story:** As a DevOps engineer, I want to validate that the HA setup is working correctly, so that I can be confident the cluster will survive node failures.
#### Acceptance Criteria
1. WHEN the deployment completes THEN the system SHALL test connectivity to the cluster endpoint
2. WHEN connectivity tests run THEN the system SHALL verify that the endpoint resolves through the CNAME to the load balancer
3. WHEN load balancer tests run THEN the system SHALL verify that requests are being distributed across control plane nodes
4. WHEN a control plane node is stopped THEN the system SHALL continue to serve API requests through the remaining nodes
### Requirement 4: Backward Compatibility
**User Story:** As a DevOps engineer, I want the DNS fixes to be backward compatible with existing deployments, so that current clusters continue to function during the transition.
#### Acceptance Criteria
1. WHEN existing clusters are updated THEN the system SHALL not break existing DNS configurations
2. WHEN new variables are introduced THEN the system SHALL provide sensible defaults for existing deployments
3. WHEN the update is applied THEN the system SHALL preserve existing kubeconfig files and cluster access
4. IF migration issues occur THEN the system SHALL provide rollback procedures and documentation

3
.sops.yaml Normal file
View File

@@ -0,0 +1,3 @@
creation_rules:
- path_regex: talos/talhelper/talenv.yaml
age: age1xkyuv8r8ce6lu3d64jfspz4e50k6pxlaxwmuplzrtnpfnnrnycaq6mfsrn

287
README.md
View File

@@ -1,239 +1,102 @@
# A Homelab based on Red Hat Technologies
# mk-labs
A comprehensive homelab for learning advanced concepts primarily based on Red Hat OpenShift. In addition to providing services, it is an area to incorporate container technologies, and enterprise integration scenarios.
Automated infrastructure provisioning and configuration for a personal homelab, built on GitOps practices with clear tool responsibility boundaries.
This implementation is built on easily accessible consumer based hardware and will focus heavily on GitOps practices and automation will be used wherever possible.
## Architecture
## 🎯 Project Goals
- **Kubernetes cluster for applications**
- **IAM integration testing**
- **GitOps and automation workflows**
## 📋 Documentation (Priority Order)
### Phase 1: Foundation
1. **[Overview & Hardware Allocation](./docs/01-overview.md)** - Complete architecture overview
2. **[Networking Plan](./docs/02-networking.md)** - VLAN strategy and network design
3. **[Core Services Setup](./docs/03-core-services.md)** *(TBD)* - Ansible, DNS, monitoring
4. **[Storage Configuration](./docs/04-storage.md)** *(TBD)* - Synology, democratic-csi
### Phase 2: Proxmox Platform
5. **[Proxmox Installation](./docs/11-vsphere-setup.md)** *(TBD)* - Dell 7050 virtualization
6. **[VM Templates & Automation](./docs/13-vm-automation.md)** *(TBD)* - Template creation
### Phase 3: Infrastructure Services
7. **[Recursive DNS]
8. **[Authoritative DNS]
9. **[Identity Management](./docs/10-acm-setup.md)** *(TBD)*
10. **[Matchbox] (Depreciated?)
### Phase 4: OpenShift Clusters (Depreciated)
8. **[OpenShift SNO + Worker](./docs/09-openshift-sno.md)** *(TBD)* - ACM Hub Cluster
9. **[OpenShift Cluster](./docs/08-openshift-compact.md)** *(TBD)* - 3 Master/3 Worker node (production-like)
10. **[ACM Configuration](./docs/10-acm-setup.md)** *(TBD)* - Multi-cluster management
11. **[HCP Cluster](./docs/10-acm-setup.md)** *(TBD)* - External app cluster
### Phase 5: Kubernetes Container Platform
5. **[Container Registry Setup](./docs/05-container-registry.md)** *(TBD)* - Harbor deployment
6. **[Git Repository Setup](./docs/06-git-repository.md)** *(TBD)* - Gitea/GitLab on Synology
7. **[Artifact Repository](./docs/07-artifact-repository.md)** *(TBD)* - Nexus/Artifactory
### Phase 6: Advanced Services
14. **[Monitoring & Observability](./docs/14-monitoring.md)** *(TBD)* - Prometheus, Grafana, Splunk
15. **[Security & Compliance](./docs/15-security.md)** *(TBD)* - ACS, certificates, auditing
16. **[Backup & DR](./docs/16-backup-dr.md)** *(TBD)* - Backup strategies
## 🚀 Quick Start Deployment
### Prerequisites
- Ubiquiti UDM Pro configured
- Hardware powered and networked
- Initial VLAN setup (see [networking plan](./docs/02-networking.md))
### Ansible Collections
- ansible-galaxy collection install freeipa.ansible_freeipa
### Deployment Scripts
```bash
source ~/venv-ansible/bin/activate
# Phase 1: Foundation
./scripts/01-network-setup.sh
./scripts/02-core-services-deploy.sh
# Phase 2: Container Platform
./deployment/synology/docker-compose.yml # Git repo, Harbor, Nexus
./scripts/03-storage-setup.sh
# Phase 3: OpenShift
./deployment/openshift/compact-cluster/
./deployment/openshift/sno-cluster/
# Phase 4: Proxmox
./deployment/proxmox/
A single operator action — setting a VM record's status to **Staged** in NetBox — triggers a fully automated provisioning pipeline:
```
NetBox (webhook) → n8n (validate & orchestrate) → Terraform (create VM + DHCP)
→ Ansible (OS config + DNS + status update)
```
## 📁 Repository Structure
| Tool | Host | IP | Responsibility |
|------|------|----|---------------|
| NetBox | fire-station | 10.1.71.102 | Source of truth — VM records, IP allocation, VLAN data |
| n8n | tiki-room | 10.1.71.23 | Event orchestration, validation, pipeline sequencing |
| Terraform | city-hall | 10.1.71.35 | Proxmox VM lifecycle, Unifi DHCP reservations |
| Ansible / Semaphore | imagineering | 10.1.71.22 | OS configuration, DNS records, NetBox status updates |
| Proxmox | fantasyland | 10.1.71.13 | Target hypervisor |
All systems on the Server Trusted VLAN (10.1.71.0/24).
## Repository Structure
```
homelab/
├── README.md # This file
├── docs/ # Documentation (numbered by priority)
│ ├── 01-overview.md
│ ├── 02-networking.md
── ...
├── ansible/ # Directory structure for Ansible
├── deployment/ # Deployment
configurations
── synology/ # Docker Compose files for Synology
├── k0s/ # k0s cluster manifests
│ ├── openshift/ # OpenShift installation configs
── proxmox/ # Proxmox automation
├── scripts/ # Automation scripts
└── .gitignore # Excludes sensitive data
├── ansible/
│ ├── inventory/ # NetBox dynamic inventory + static
│ ├── playbooks/ # Runnable playbooks (vm-provision, DNS, OS updates)
│ ├── roles/ # vm-baseline, dns-manager, common, haproxy, n8n, observer, etc.
── tasks/ # Shared includable task files
│ ├── group_vars/ # Group variable definitions
│ ├── host_vars/ # Per-host variable definitions
│ ├── templates/ # Jinja2 templates
── ansible.cfg
├── terraform/
── proxmox/vm/ # bpg/proxmox provider — VM creation from templates
│ ├── unifi/dhcp/ # Unifi provider — DHCP static reservations on UDM Pro
│ └── dns/ # DNS record management
├── packer/
│ ├── ubuntu-24.04/ # Ubuntu 24.04 VM template (small → xlarge-plus sizes)
│ └── fedora-42/ # Fedora 42 VM template
├── n8n/
│ └── workflows/ # Exported n8n workflow JSON (vm-provisioning)
├── netbox/
│ └── initializers/ # Custom fields, VLANs, IP prefixes as code
└── docs/
└── decisions/ # Architecture decision records
```
## 🔧 Technology Stack
## Pipeline Flow
### Infrastructure
- **Networking**: Ubiquiti UDM Pro
- **Storage**: Synology DS1621+, Ubiquiti UNAS Pro
- **Compute**: 3x Minisforum TH60, 2x Minisforum MS01, 7x Dell 7050 SFF
| # | System | Action |
|---|--------|--------|
| 1 | NetBox | Operator sets VM status to Staged → webhook fires |
| 2 | n8n | Validates payload (hostname, IP, VLAN, template, proxmox_node) |
| 3 | n8n → city-hall | SSH + `terraform apply` — creates VM on Proxmox |
| 4 | n8n | Queries Proxmox API for MAC address |
| 5 | n8n → NetBox | Writes MAC to VM interface record |
| 6 | n8n → city-hall | SSH + `terraform apply` — creates DHCP reservation on UDM Pro |
| 7 | n8n → imagineering | Triggers Ansible via Semaphore API |
| 8 | Ansible | OS baseline, SSH hardening, Technitium DNS A record |
| 9 | Ansible → NetBox | Sets VM status to Active |
### Container Platforms
- **k8s**: Core services cluster
- **Proxmox**: VM workloads
### Core Services
- **Container Registry**: Harbor
- **Git Repository**: Gitea/GitLab CE
- **Artifact Repository**: Nexus/Artifactory
- **Monitoring**: Prometheus + Grafana
- **Logging**: Splunk Enterprise
- **DNS**: CoreDNS
- **Load Balancing**: MetalLB + HAProxy
## 🔐 Security Notes
- **No sensitive data** is stored in this repository
- **Secrets management** via external-secrets-operator
- **Certificate management** via cert-manager
- **Network segmentation** via VLANs and firewall rules
## 🤝 Contributing
This is a personal homelab project, but feel free to:
- Submit issues for questions or suggestions
- Fork for your own homelab adaptations
- Share improvements via pull requests
## 📞 Next Steps
1. **Create GitHub repository** for version control
2. **Start with Phase 1** foundation setup
3. **Build deployment automation** as we go
4. **Document lessons learned** for future reference
---
**Status**: 🚧 Planning & Initial Development
**Last Updated**: June 2025
This repo is a mono-repo that is broken up into three sections:
- infra-config
- apps
- cluster
On any failure, NetBox status is set to **Failed**. No auto-retry — operator investigates.
## Hardware
- Dell 7050 SFF (7)
- Minisforum TH60 (3)
- Minisforum MS01 (2)
- Synology 1621+
- 7× Dell 7050 SFF
- 3× Minisforum TH60
- 2× Minisforum MS01
- Synology DS1621+
- Ubiquiti UDM Pro
## Software
## Software Stack
- Proxmox (Virtualization)
- Cloudflare (Domain Hosting, Public DNS)
- Unbound (Recursive DNS)
- FreeIPA (Identity management, Authoritive DNS)
- Matchbox (iPXE)
- Red Hat OpenShift
- OpenShift Agent Based Installer (Install OpenShift)
- [Red Hat Advanced Cluster Management for Kubernetes](https://www.redhat.com/en/technologies/management/advanced-cluster-management)
- [Vault](https://www.hashicorp.com/en/products/vault)
- [OpenShift GitOps (ArgoCD)](https://www.redhat.com/en/technologies/cloud-computing/openshift/gitops)
- [Red Hat Ansible Automation Platform](https://www.redhat.com/en/technologies/management/ansible)
## Prerequisites
- Ansible user created
- Ansible configured
- [Networking](docs/networks.md)
- [Proxmox](docs/proxmox.md) (In my homelab, internal DNS, identity manangement, and ipxe are hosted here.)
- Matchbox
- DNS
- Domain Registration
## Assumptions
There are a dozen different architectures you could use to deploy OpenShift in every which way.
For the sake of this documentation we'll assume the following:
- **Virtualization**: Proxmox
- **Automation**: Terraform, Ansible, n8n, Semaphore
- **DNS**: Technitium (authoritative), Unbound (recursive)
- **IPAM/DCIM**: NetBox
- **Networking**: Ubiquiti UDM Pro
- **Templates**: Packer (Ubuntu 24.04, Fedora 42)
## Getting Started
[Step-by-Step Walkthrough](step-by-step.md)
See [docs/decisions/vm-provisioning-flow.md](docs/decisions/vm-provisioning-flow.md) for the full architecture decision record.
### Hub Cluster
Previous OpenShift/ACM/Fastpass content is preserved in the `archive/pre-mk-labs` branch.
You'll need an OpenShift "Hub Cluster" with access to persistant storage.
A Single Node OpenShift (SNO) instance, installed on bare metal, will act as a Hub cluster and run:
## Security
- Advanced Cluster Management
- Ansible Automation Platform
- Vault
- ~~OpenShift GitOps~~
#### Network Prerequisites
The prerequisites for OpenShift in traditional and HCP patterns are largely the same - it just kind of depends on where your DNS records go to.
| Cluster | Endpoint | VIP | DNS A Record | Notes |
|------------------|-------------|---------------|-----------------------------------|----------------------------------|
| Hub Cluster (SNO) | App Ingress | 192.168.0.10 | *.apps.hub-cluster.example.com | SNO App VIP goes to IP of node |
| Hub Cluster (SNO) | API | 192.168.0.10 | api.hub-cluster.example.com | SNO API goes to IP of node |
These DNS entries should be put in your Authoratitive DNS.
#### ACM & GitOps Configuration
Before you start creating clusters you may want to create some Policies, integrate ACM and ArgoCD, etc. This step is optional in case you're just interested in trying out Hosted Control Planes or copy/paste around a cluster for testing purposes.
Find additional details in the ./02-rhacm-config folder.
#### Creating a Cluster
With everything in its right place, you can now start to declaratively create clusters
./05-clusters/hcp-bmh - HCP to Bare Metal Hosts
### Internal Cluster
Two additional bare metal nodes, to be added to Advanced Cluster Management (ACM) running on the SNO Hub. These will be used to create another HCP cluster.
These servers have a BMC interface with Redfish - if not, then you'll need to manually manage the boot and installation of those servers.
This makes it to where you just need 3 bare metal nodes. You could run one HCP Bare Metal cluster with both of the other nodes, but then you have a shared storage requirement that can't be satisfied by ODF since that needs at least 3 nodes.
### External Cluster
You'll also either need you just need at least 2 bare metal nodes.
No sensitive data is stored in this repository. Secrets are managed via Ansible Vault and environment variables on pipeline hosts.
---
## Credits
**Status**: 🚧 Active Development — VM Provisioning Pipeline
- Ken Moini - As I used his [repo](https://github.com/kenmoini/ztp-for-you-and-me) as the baseline for this project.
- Ryan Etten
- Andrew Potozniak
**Last Updated**: February 2026

View File

@@ -1,309 +0,0 @@
# FastPass Kubernetes Cluster - Complete Deployment Guide
## Overview
This guide provides step-by-step instructions for deploying a complete Kubernetes cluster on Fedora using Ansible automation. The FastPass cluster is designed for high availability with multiple control plane nodes and worker nodes.
## Prerequisites
### System Requirements
- **OS**: Fedora 38+ (64-bit)
- **Memory**: Minimum 2GB RAM per node
- **CPU**: Minimum 2 cores per node
- **Storage**: Minimum 10GB free space
- **Network**: All nodes must be able to communicate
### Software Requirements
- Ansible 2.15+
- Python 3.8+
- SSH access to all nodes with sudo privileges
## Quick Start
### 1. Validate Your Setup
Before deploying, run the validation script:
```bash
cd ansible
./scripts/test-fastpass-deployment.sh
```
This will check:
- ✅ Ansible installation
- ✅ Inventory configuration
- ✅ Playbook files
- ✅ Role files
- ✅ Group variables
- ✅ Playbook syntax
- ✅ Common issues
### 2. Deploy the Cluster
```bash
# Deploy the complete cluster
ansible-playbook -i inventory.yml playbooks/deploy-fastpass-cluster.yml
```
## Deployment Process
The deployment follows this sequence:
### Phase 1: System Preparation
- **Hosts**: All FastPass nodes
- **Tasks**:
- Preflight checks (OS, memory, CPU, disk space)
- Disable swap and configure kernel modules
- Install and configure containerd
- Install Kubernetes packages
### Phase 2: Control Plane Initialization
- **Hosts**: First control plane node (`space-mountain`)
- **Tasks**:
- Initialize the Kubernetes cluster
- Configure API server and etcd
- Install Flannel CNI
- Generate join commands
### Phase 3: Additional Control Plane Nodes
- **Hosts**: Remaining control plane nodes (`big-thunder-mountain`, `splash-mountain`)
- **Tasks**:
- Join additional control plane nodes
- Configure high availability
### Phase 4: Worker Nodes
- **Hosts**: Worker nodes (`haunted-mansion`, `peter-pans-flight`)
- **Tasks**:
- Join worker nodes to the cluster
- Apply node labels and taints
### Phase 5: Validation
- **Hosts**: First control plane node
- **Tasks**:
- Verify all nodes are ready
- Check all pods are running
- Display final cluster status
## Configuration
### Inventory Structure
Ensure your `inventory.yml` has the correct structure:
```yaml
fastpass_control_plane:
hosts:
space-mountain:
big-thunder-mountain:
splash-mountain:
fastpass_workers:
hosts:
haunted-mansion:
peter-pans-flight:
fastpass:
children:
fastpass_control_plane:
fastpass_workers:
```
### Group Variables
Key variables in `group_vars/fastpass/vars`:
```yaml
# Cluster Configuration
cluster_name: "fastpass"
kubernetes_version: "1.33"
pod_network_cidr: "10.244.0.0/16"
service_cidr: "10.96.0.0/12"
# Control Plane Configuration
control_plane_endpoint: "fastpass.local.mk-labs.cloud"
control_plane_port: "6443"
# CNI Configuration
cni_plugin: "flannel"
# Node Labels
node_labels:
zone:
# Control Plane nodes (masters) - no zone labels needed
# space-mountain: (control plane - no zone label)
# big-thunder-mountain: (control plane - no zone label)
# splash-mountain: (control plane - no zone label)
# Worker nodes
haunted-mansion: "backstage" # Internal/backstage workloads
peter-pans-flight: "backstage" # Internal/backstage workloads
# Future node: "on-stage" # External/on-stage workloads (future)
```
## Troubleshooting
### Common Issues
#### 1. Swap Enabled
**Problem**: `running with swap on is not supported`
**Solution**: The playbook automatically disables swap, but if it persists:
```bash
# On the problematic node
sudo swapoff -a
sudo systemctl restart kubelet
```
#### 2. CNI Not Ready
**Problem**: `Network plugin returns error: cni plugin not initialized`
**Solution**: The playbook installs Flannel automatically. If issues persist:
```bash
kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
```
#### 3. Control Plane Endpoint Issues
**Problem**: `unable to add a new control plane instance to a cluster that doesn't have a stable controlPlaneEndpoint`
**Solution**: The playbook uses the first control plane node as the endpoint. For production, consider using a load balancer.
#### 4. Permission Issues
**Problem**: `User "kubernetes-admin" cannot create resource "secrets"`
**Solution**: The playbook uses super-admin.conf for proper permissions.
### Debug Commands
```bash
# Check node status
kubectl get nodes -o wide
# Check pod status
kubectl get pods --all-namespaces
# Check kubelet logs
journalctl -u kubelet -f
# Check API server logs
kubectl logs -n kube-system kube-apiserver-space-mountain
# Check CNI status
kubectl get pods -n kube-flannel
```
## Post-Deployment
### 1. Verify Cluster Health
```bash
# Check all nodes are ready
kubectl get nodes -o wide
# Check all pods are running
kubectl get pods --all-namespaces
# Test cluster connectivity
kubectl cluster-info
```
### 2. Manage Kubeconfig
Use the provided script to manage different cluster configurations:
```bash
# Switch to FastPass cluster
./scripts/manage-kubeconfigs.sh fastpass
# Check status
./scripts/manage-kubeconfigs.sh status
# Test connectivity
./scripts/manage-kubeconfigs.sh test
```
### 3. Deploy Applications
Your cluster is now ready for workloads:
```bash
# Deploy a test application
kubectl run nginx --image=nginx --port=80
# Create a service
kubectl expose pod nginx --port=80 --type=NodePort
# Check the service
kubectl get svc nginx
```
## Maintenance
### Adding New Nodes
1. Add the new node to the inventory
2. Run the preparation role:
```bash
ansible-playbook -i inventory.yml playbooks/deploy_k8s.yml --limit=new-node
```
3. Join the node to the cluster manually or extend the playbook
### Upgrading Kubernetes
1. Update the `kubernetes_version` variable
2. Run the preparation role on all nodes
3. Upgrade control plane nodes first
4. Upgrade worker nodes
### Backup and Recovery
- Backup `/etc/kubernetes/` directory on control plane nodes
- Backup etcd data: `etcdctl snapshot save backup.db`
- Document cluster configuration
## Architecture
```
FastPass Cluster Architecture:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Control Plane │ │ Control Plane │ │ Control Plane │
│ space-mountain │ │big-thunder-mtn │ │ splash-mountain │
│ (Masters) │ │ (Masters) │ │ (Masters) │
│ No Zone Label │ │ No Zone Label │ │ No Zone Label │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
┌───────────────────────┼───────────────────────┐
│ │ │
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Worker Node │ │ Worker Node │ │ Worker Node │
│ haunted-mansion │ │peter-pans-flight│ │ (Future) │
│ (Backstage) │ │ (Backstage) │ │ (On-Stage) │
│ zone=backstage │ │ zone=backstage │ │ zone=on-stage │
└─────────────────┘ └─────────────────┘ └─────────────────┘
```
## Support
For issues specific to this deployment:
1. Check the troubleshooting section
2. Review Ansible logs with `-vvv` verbosity
3. Check system logs on affected nodes
4. Verify network connectivity between nodes
## Files Structure
```
ansible/
├── group_vars/
│ └── fastpass/
│ └── vars # Cluster configuration
├── playbooks/
│ ├── deploy-fastpass-cluster.yml # Main deployment playbook
│ ├── deploy_k8s.yml # Legacy deployment playbook
│ └── roles/
│ ├── kubernetes/ # System preparation
│ ├── fastpass-control-plane/ # Control plane setup
│ ├── fastpass-control-plane-join/ # Additional control plane nodes
│ └── fastpass-workers/ # Worker node setup
├── scripts/
│ ├── test-fastpass-deployment.sh # Validation script
│ └── manage-kubeconfigs.sh # Kubeconfig management
└── inventory.yml # Host inventory
```

View File

@@ -1,228 +0,0 @@
# FastPass Kubernetes Cluster - Fedora Deployment Guide
## Overview
This guide covers the deployment of a Kubernetes cluster on Fedora using Ansible automation. The FastPass cluster is designed for high availability with multiple control plane nodes and worker nodes.
## Architecture
```
FastPass Cluster Architecture:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Control Plane │ │ Control Plane │ │ Control Plane │
│ space-mountain │ │big-thunder-mtn │ │ splash-mountain │
│ (Leader) │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
┌───────────────────────┼───────────────────────┐
│ │ │
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Worker Node │ │ Worker Node │ │ Worker Node │
│ haunted-mansion │ │peter-pans-flight│ │ (Future) │
│ (backstage) │ │ (backstage) │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
```
## Prerequisites
### System Requirements
- **OS**: Fedora 38+ (64-bit)
- **Memory**: Minimum 2GB RAM per node
- **CPU**: Minimum 2 cores per node
- **Storage**: Minimum 10GB free space
- **Network**: All nodes must be able to communicate
### Software Requirements
- Ansible 2.15+
- Python 3.8+
- SSH access to all nodes with sudo privileges
## Quick Start
### 1. Prepare Inventory
Ensure your `inventory.yml` has the correct host groups:
```yaml
fastpass_control_plane:
hosts:
space-mountain:
big-thunder-mountain:
splash-mountain:
fastpass_workers:
hosts:
haunted-mansion:
peter-pans-flight:
fastpass:
children:
fastpass_control_plane:
fastpass_workers:
```
### 2. Configure Variables
Edit `group_vars/fastpass/vars` to customize your deployment:
```yaml
# Cluster Configuration
cluster_name: "fastpass"
kubernetes_version: "1.33"
pod_network_cidr: "10.244.0.0/16"
service_cidr: "10.96.0.0/12"
# Node Labels
node_labels:
zone:
space-mountain: "external"
big-thunder-mountain: "external"
splash-mountain: "external"
haunted-mansion: "internal"
peter-pans-flight: "internal"
```
### 3. Deploy the Cluster
```bash
# Deploy the complete cluster
ansible-playbook -i inventory.yml playbooks/deploy-fastpass-cluster.yml
# Or deploy step by step
ansible-playbook -i inventory.yml playbooks/deploy_k8s.yml
```
## Deployment Process
### Phase 1: System Preparation
- Preflight checks (OS, memory, CPU, disk space)
- Disable swap and configure kernel modules
- Install and configure containerd
- Install Kubernetes packages
### Phase 2: Control Plane Setup
- Initialize the first control plane node
- Configure API server and etcd
- Install Calico CNI
- Join additional control plane nodes
### Phase 3: Worker Node Setup
- Join worker nodes to the cluster
- Apply node labels and taints
- Verify cluster health
## Troubleshooting
### Common Issues
#### 1. Repository Errors
**Problem**: Docker CE repository not found
**Solution**: Update the repository URL in `container-runtime.yml`:
```yaml
baseurl: "https://download.docker.com/linux/fedora/{{ ansible_distribution_major_version }}/x86_64/stable"
```
#### 2. kubeadm Init Failures
**Problem**: kubeadm init fails with preflight errors
**Solution**: The playbook includes `--ignore-preflight-errors=all` flag
#### 3. Node Not Ready
**Problem**: Worker nodes stuck in NotReady state
**Solution**: Check CNI installation and network connectivity
### Debug Commands
```bash
# Check node status
kubectl get nodes -o wide
# Check pod status
kubectl get pods --all-namespaces
# Check kubelet logs
journalctl -u kubelet -f
# Check containerd status
systemctl status containerd
```
## Customization
### Network Configuration
Modify the pod and service CIDRs in `group_vars/fastpass/vars`:
```yaml
pod_network_cidr: "10.244.0.0/16"
service_cidr: "10.96.0.0/12"
```
### CNI Selection
The default CNI is Calico. To change, modify the control plane role:
```yaml
cni_plugin: "flannel" # or "weave", "cilium"
```
### Node Labels and Taints
Configure node labels in `group_vars/fastpass/vars`:
```yaml
node_labels:
zone:
space-mountain: "external"
haunted-mansion: "internal"
environment: "production"
cluster: "fastpass"
```
## Maintenance
### Adding New Nodes
1. Add the new node to the inventory
2. Run the preparation role: `ansible-playbook -i inventory.yml playbooks/deploy_k8s.yml --limit=new-node`
3. Join the node to the cluster
### Upgrading Kubernetes
1. Update the `kubernetes_version` variable
2. Run the preparation role on all nodes
3. Upgrade control plane nodes first
4. Upgrade worker nodes
### Backup and Recovery
- Backup `/etc/kubernetes/` directory on control plane nodes
- Backup etcd data: `etcdctl snapshot save backup.db`
- Document cluster configuration
## Security Considerations
- SELinux is set to permissive mode for compatibility
- Firewalld is disabled (configure as needed for your environment)
- Consider enabling RBAC and network policies
- Regularly update Kubernetes and system packages
## Support
For issues specific to this deployment:
1. Check the troubleshooting section
2. Review Ansible logs with `-vvv` verbosity
3. Check system logs on affected nodes
4. Verify network connectivity between nodes
## Files Structure
```
ansible/
├── group_vars/
│ └── fastpass/
│ └── vars # Cluster configuration
├── playbooks/
│ ├── deploy-fastpass-cluster.yml # Main deployment playbook
│ ├── deploy_k8s.yml # Legacy deployment playbook
│ └── roles/
│ ├── kubernetes/ # System preparation
│ ├── fastpass-control-plane/ # Control plane setup
│ └── fastpass-workers/ # Worker node setup
└── inventory.yml # Host inventory
```

View File

@@ -1,233 +0,0 @@
# Kubeconfig Management - Modular & Repeatable
This document explains the modular kubeconfig management system for your homelab's multiple Kubernetes clusters.
## Overview
The kubeconfig management has been refactored into reusable, modular components that can handle multiple clusters seamlessly:
- **FastPass** (Vanilla Kubernetes)
- **Hub Cluster** (OpenShift SNO)
- **Internal Cluster** (OpenShift)
- **Future clusters** (easily extensible)
## Architecture
```
ansible/playbooks/roles/
├── kubeconfig-manager/ # Core reusable role
│ ├── tasks/main.yml # Main entry point
│ ├── tasks/merge-kubeconfig.yml # Merging logic
│ ├── defaults/main.yml # Default variables
│ └── README.md # Role documentation
├── cluster-kubeconfig/ # Generic wrapper role
└── fastpass-first-control-plane/ # Uses kubeconfig-manager
```
## Quick Usage
### 1. Using the Script (Easiest)
```bash
cd ansible
# Setup FastPass cluster kubeconfig
./scripts/setup-kubeconfig.sh fastpass fastpass_control_plane[0]
# Setup Hub cluster kubeconfig
./scripts/setup-kubeconfig.sh hub hub_cluster
# Setup Internal cluster kubeconfig
./scripts/setup-kubeconfig.sh internal internal_cluster[0]
```
### 2. Direct Ansible Usage
```bash
# Single cluster
ansible-playbook -i inventory.yml \
playbooks/examples/multi-cluster-kubeconfig.yml \
--limit fastpass_control_plane[0] \
-e target_cluster_name=fastpass
# Multiple clusters at once
ansible-playbook -i inventory.yml \
playbooks/examples/multi-cluster-kubeconfig.yml
```
### 3. In Your Own Playbooks
```yaml
- name: Setup kubeconfig for any cluster
hosts: my_cluster_nodes[0]
roles:
- role: kubeconfig-manager
vars:
cluster_name: "my-cluster"
kubeconfig_source_path: "/etc/kubernetes/admin.conf"
```
## Features
### ✅ **Modular & Reusable**
- Single role works with any Kubernetes cluster
- Easy to extend for new clusters
- Consistent behavior across all clusters
### ✅ **Safe Operations**
- Automatic backups before merging
- Non-destructive merging
- Preserves existing contexts
### ✅ **Multi-Cluster Ready**
- Unique naming: `cluster-name-admin`
- No conflicts between clusters
- Easy context switching
### ✅ **Homelab Optimized**
- Works with vanilla Kubernetes
- Works with OpenShift
- Handles different kubeconfig paths
## Generated Structure
After running the kubeconfig management:
```bash
~/.kube/
├── config # Merged config with all clusters
├── config-fastpass # Individual cluster configs
├── config-hub
├── config-internal
└── config.backup.1697123456 # Timestamped backups
```
## Context Management
```bash
# List all available contexts
kubectl config get-contexts
# Switch between clusters
kubectl config use-context fastpass-admin
kubectl config use-context hub-admin
kubectl config use-context internal-admin
# Check current context
kubectl config current-context
# Test connectivity
kubectl cluster-info
kubectl get nodes
```
## Integration with Existing Roles
### Before (Monolithic)
```yaml
# fastpass-first-control-plane/tasks/main.yml
- name: 50+ lines of kubeconfig logic
# Lots of repetitive code
```
### After (Modular)
```yaml
# fastpass-first-control-plane/tasks/main.yml
- name: Setup kubeconfig for FastPass cluster
ansible.builtin.include_role:
name: kubeconfig-manager
vars:
cluster_name: "{{ cluster_name }}"
```
## Adding New Clusters
To add a new cluster (e.g., "edge-cluster"):
1. **Add to inventory:**
```yaml
edge_cluster:
hosts:
edge-node-01:
```
2. **Use the script:**
```bash
./scripts/setup-kubeconfig.sh edge edge_cluster[0]
```
3. **Or add to playbook:**
```yaml
- name: Setup kubeconfig for Edge cluster
hosts: edge_cluster[0]
roles:
- role: kubeconfig-manager
vars:
cluster_name: "edge"
```
## Customization
### Different Kubeconfig Paths
```yaml
- role: kubeconfig-manager
vars:
cluster_name: "openshift-cluster"
kubeconfig_source_path: "/etc/kubernetes/static-pod-resources/kube-apiserver-certs/secrets/node-kubeconfigs/localhost.kubeconfig"
```
### Custom Context Names
```yaml
- role: kubeconfig-manager
vars:
cluster_name: "prod"
context_suffix: "system:admin" # Results in "prod-system:admin"
```
## Troubleshooting
### Common Issues
1. **Permission Denied**
```bash
# Fix ownership
sudo chown -R $USER:$USER ~/.kube/
```
2. **Context Not Found**
```bash
# List available contexts
kubectl config get-contexts
# Check if cluster was added
kubectl config view
```
3. **Backup Recovery**
```bash
# Restore from backup
cp ~/.kube/config.backup.1697123456 ~/.kube/config
```
### Debug Mode
```bash
# Run with verbose output
ansible-playbook -vvv playbooks/examples/multi-cluster-kubeconfig.yml
```
## Benefits for Your Homelab
1. **Consistency**: Same process for all clusters
2. **Maintainability**: Single role to update/fix
3. **Scalability**: Easy to add new clusters
4. **Safety**: Automatic backups and safe merging
5. **Flexibility**: Works with different Kubernetes distributions
## Next Steps
1. **Test the modular approach** with your FastPass cluster
2. **Extend to Hub and Internal clusters** using the same pattern
3. **Create cluster-specific variables** in group_vars if needed
4. **Add monitoring/validation** tasks to verify kubeconfig health
This modular approach makes your homelab's multi-cluster management much more maintainable and repeatable!

View File

@@ -209,7 +209,7 @@ private_key_file=~/.ssh/ansible
remote_user=wed
# (pathspec) Colon-separated paths in which Ansible will search for Roles.
;roles_path=/Users/rblundon/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
roles_path=/opt/git/homelab/ansible/playbooks/roles:/Users/rblundon/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
# (string) Set the main callback used to display Ansible output. You can only have one at a time.
# You can have many other callbacks, but just one can be in charge of stdout.

View File

@@ -0,0 +1,4 @@
---
step_ca_url: "https://turnstile.local.mk-labs.cloud:9000"
step_ca_fingerprint: "f63c44e76381e359978bd2dca07c928d04ad44b575f0364fa66b5725c7e7891b"
step_ca_provisioner_name: "admin"

View File

@@ -17,4 +17,16 @@ base_domain: "local.mk-labs.cloud"
terraform_server: "infra01"
# Traefik variables
traefik_server: "lightning-lane"
traefik_server: "lightning-lane"
step_ca_principal_mappings:
- local_user: wed
principals:
- ryan.blundon@protonmail.com
- ryan.blundon
- ryanblundon
- local_user: rblundon
principals:
- ryan.blundon@protonmail.com
- ryan.blundon
- ryanblundon

View File

@@ -1,170 +1,306 @@
$ANSIBLE_VAULT;1.1;AES256
64393362643437353731353234643535366431613861636131613139636435633465306333656161
3365306632386330373862363637363435633235643336610a663736396537313032336162633334
32626233346233323565383030393130316532653062373730376163326134616239663865363862
3365316365643534610a343932623566356637663136336338386534373532383863363662326438
37393331356632313163643138613330366631643465623633386433663236636334666264383033
34333935633131363364626333313336353733373562326636343633653838616532643737366435
36366330633263613938323566393063373233363538643531636131316335316461656631616362
30343965356363383139366534363664313831363132383337636266316538393139383232386230
65353364313534333632306465393264386466346365303232356263653563653338306131376131
66343764643639396663623330623332333466633737343738386230626463386137373536343430
36636430616132363161303338353033343963643338656639643662636664613965636263366135
64353134376162633162316166316239333963653930363830646165636537653238623537323238
39376338636335336338323935333439306534386539336331613961663261623962383237303632
34326139626366303331363337353432623636626231373731646665623831353865303130663533
37326639626237653361316666616161363531303961613538636663633063396363346337663239
64313333653766383736303161636530316538633033323063323662336335666264646564643465
64396436366131373061326233643562626335376263623031376532313730653363343038356135
30336131646635636638353934636139343662623265336338386535663536393935343132306335
33626632613663353661313061623732643539323637336433666330313463666661623836303462
61383732613139343434363662616539373837633139393764353864613062346237346661633033
61393639326535366266643664653439383238646132306636656130333733316638363830346433
38643430346263663639653762393935356662363533323766343362366532626532633530323630
30643436653130363066373665666434383732663837643839356539366432316539613863623839
35323930383437383535373330326239663966383234663233643337623330353236626464636530
36393735646664366235363831656262383333626265383066393363346165656265363438306135
34633530653837346638636665666162363062663333623263356131646661373234333939333536
30643639333836373439613561346130623239363737626238663436356365633562366465643561
32643039376234323963653733353138643138626430383639313765353035646539653466623539
32366135366266323261333938373837386636626232323661393035613638643335383564663462
31383663663063373935396439653231353962303630346338623938343064643037396562626637
63363363343739626639633934393734396434653262373137373539316536306663336466626639
34646465306439313239323365333761663161313461613766343463666134303036376338366663
64356364653462383534343438343933623766396232336434653765613864376235363735343032
32313133383731333366626534363065333738346230393636393938366633363561346436363338
33393932626333636166313431633339386564616466653165383962656633303161393935366635
65396464326333396433303966316231376432363335643732303438663131653932636564363264
36356663623436643835373538363662643134313030656236326335393334626634663136333137
38363432346663393435366536636335636465343131666562396334636530346235366365396431
64623739373130623436356161666139656330646661396430633264393632663366353037643130
35373839373430643065616630613433646536356563353133633361623235623733313234306435
64356635343361633462376131636362386433373339383365313436333332613333316237323632
33633362376331323930376130393838633333316330363362396131306230643161373636303034
37303738306233363937316332313830396336323639333634666364633566386261373031383563
36633865643634363234613463636437306236376435613034623537356162353235396665636338
31613733363430313532643235343438393137313136653730643364623662336236323464656465
65636431633464613437396561643638346565313937303731633837623930333538383335633938
62666461323033303937653366646432623764653566626333333766656235633662623631636636
35626161653736303261303233643236393038303063386532643563663065303331616637386661
33326637393633616430643665623431616336336666383236326538383535633364613135653131
38383961383264313130383263613763326666663033626338313762376336353866646634323537
39393565643265633437396535643165626165646537373039613061613936356434366238636562
61393639316531316564646334663863383836656261623230646461323566316664653965336136
62353839363664396632306231363031303265343131343739633835353338386335343737326633
36656433616135653663353166636461623337653138613435646663663939323631373063373136
63396331313538636437383635643831643935303932313964336532643366623434316662376632
63666464333736333162373461333563393138366638643039393865613238616531356165346236
65313432383533353738396530356465386263313939393962333637306138653939646638353235
37393733333032623763333632353866633866613162663833346534666237383430663838383965
66663332616164353539323261383364363237383064306132633530326134383561346536346636
32393365316435626464386631663037663934313533663030313466323134336439303362626365
30613764346362326130353333353663316539306437376465306332353464343530663933363562
39646333323631353835336461326233623963353535316633353236353236636462313163633638
35366538366336663534353739353231306164626664383737333565666337636164386539316632
64323966336637626538303830323535373533306362636236303065663161353734653633393064
66353938306238646238313037323163343935643863653632336462363834326634363433383338
35646364353834376439633136313939393064633539643462623562333832303261386331636533
37373837396461373064353565353438633938616162363138323561343662383330346633323133
36626665343636343739353732366133313434623230353732323037633236303237656364323763
30363530306131303630386131623866323861633636313431376161336536373436656334303036
61316639666136313338396233326234386634343863633632626264363336376531363461626564
35336335396561626339616234373265663032353432363832306666353339376338396366383839
62633063326135323539653133626538613331613334353430623232376336633334666433316638
61326563366432333632666436363761376237636434356231613061626633303737626531626236
62373166363432616666616630616565373934356564363266396662323963636434313735626161
61373738623966363032313632376465356235363834633639663733653131636531363563326662
62663365323934363761653536356162336463646566393838346134356536303264323065396534
63346531303764613634646336313530326663373433396436663162343530306131386265303137
32333432383966363735343331646233613631373165346131323632366165346235656330323939
34393030313466666265346163323561353734613434386239333630623762616566616562316265
38633263323339396462336166646431363336616462366463383663313839613638383663303133
32333835623531366236643530623961656631336139313037353962323937666465343430666336
33383464363930663630333164636361326334396163376661666564663538623732663839613237
35623237613761356235383130633733333766333236363537383862306539373665383461386534
32646432363339306433646139393732366464336339346161323736363937383566656663356230
65316562383562366366653466646461613235353061623363386331636139386136306131633232
32326238353861613236373964383131363537653632663532376364336166303662663336623161
37623838616664376561663763393534323931343163376535396662626333383730363232653036
39626266623666346635373630343135333532353866363234396265356631333265663432326235
37346439613363313334633964386632336138316662616661356637363730306164646439643765
62343137663137633031316665363362643165643731326464323962616330383164353861366462
31663965626338636534356461366362333831396464376134613331393664306639386632396236
66633066663831646361333730356361646133383834376230356336613038303665323732663162
37643130313739306638636262656632353431316531336438363636363833626237346363326461
31636262396632666335303566633161333937626330373835613236656130383132663863636364
34383661353966346362386461303062303138626536323163376362326639356336396437333530
66623765313638616430383838396164336565646338636430363262396636663965383531383139
35356663363437383132333566336131666139643639663662633363616133323031353032663438
39393266633639306363313530643239303132303264323063306335346233363233373865653863
65396430346630626566383963356264313630623336316236393730343437656435656664663266
32643639363536396266626435373363303234623230383035326536633631633737653739366563
65653932663539353436366139313635663962663330343461353864323166323733366163653162
66353866376134633534323366656265633930356132316137616235343866653265666161363266
30386638343739353965643466613639303666316432323634383464633431363566333831643134
65363138313439366430613837396337323436636530313664303964353966306565663630323662
33643639623935336235373332633739306539656235323439343331376632373538613534386430
30633832656532623262326662376237393262333764623937343232383861636563633730393765
39663032373132323735633361343933333332623465343863636263363161303165656234313338
65383462626465376162306639626531366161396531643364656539366233306166386234313761
30633666303832636561323236373363373137353032613637353637386238353234646431333661
32313834666237626333626437663562646438363561393364373565313536363535323536363537
35633834616136656261643130656131306264333131326431626439343765393031313964616639
33643933653033336436616635346335383335333334343836343638613264396462633530623866
30303462653130353430663862623261343866383335343239393435633962383864396430313536
66643535303437383232323564326266356636376464623563636139633237313661356330633931
66376631373366613731633863666132626366393532666331343361323764626539666238656262
66356332383235353864303562356638636130343938383530376432663866316238333434616233
32316432333064663764363831343464326334353737346632383565643737366233396139333639
35656435346335323030636363356633633332376138653930613037313537373038353433363532
39346161336261353463656430663033623036396365346638323832313361633866363134396165
65356632366463393435386366643232383162623536653965643235323934633464373061333237
32636564386662626365613235333664323563633466383238343336343063376531396161343530
61306632646133626133343132666534666337336239306137663931623637643164326538646138
63313037336235316164316232636262316331356363356438653235346539643065636537366661
37313437386432316336663366633366666434346135356462623635313531333530653866663863
31646438316435373637303733646564316261336233623035353564363664303437373132353166
33646534663130356330663565656663333765653961663835623235633665623464353862616138
37343531366462616439333539306265626164636233616262616563386566396536386264343137
30396434303231366664656334656635616334633066323062313738363431646335643132626331
33663038316165626365346366363731323639653837616163653561623034393064303563353232
30613939353336396365613662393938663933363662656634663465303134393964623738633765
37633832626631363736383436666263356531366237356261666538303863343033356333656138
64366537363939346535313732643965623332396265386636353364316630333130643833383331
34643563386539383235386130323065353835376564613835313934333636316464636463376537
32363565333038643230656266393761313064616537393830343163643535646436616230626166
36373531646536363664663330353864636533656261353331316364633361633934326436323933
39636631623430313934393033373630656132623734363835353735353935393063356261323764
66346265376339623265376666343865343763393833323564643161613861303065346137653339
34326432383230656638303963373832316438666131623539613464636631653365353331346262
37626130343831636133646135323564306538353439636265313239326235343232633136383663
62306561616564623038393631373862346535366135633836353363323330346430613466393463
39313766613064306566316561303761626135613063326536363761626635646134303732356130
38333266363639636565393737323938663938633662653231366164316262666538356162323665
38383263366133326333636466343835373737613333623464383139343863336234373932393239
36653736393732353466656334613364626339356533343363353731353033363730376565353236
66343332306330303662373363326236393333663565383661643763363662396265313037643432
63343336623663326237326365333565346335346630356439303534363561626362363833313239
62366436313466633534343430306461313266376363336536666162306135363434643266373338
65323866323537636465306636646533316466303735386336663234386538303939343661653562
34353564313738643665636337336536343735336436626438653335376532343137613837356363
31353861363733373232363865323164663532646235623533336536333932363133613830373937
38616137646332303934303839633336313239653064626331383432633935353538636132633134
61393230663536633335393330386363333162636661373938343837323736663539393636366532
35623637623262373332373335303833373239323430393766633939633665643236623139363834
30636135303634643765393433393962303138666630343936653234333730336234356234396566
35346331336639333237323136616337623938666561343861393563393633313261633333333434
38633064633538396566373730636632346234653339303533343431643266373266633836633139
33313234366236626338636331346565336138313136623632343735363132623964353066346233
66363833383432316238353364363963323762666562303030663939303162656261663664616632
66396466643763393130313831313438356635346230646335306237363262366132323133646535
30313338653262636136393133306663653331333830626534356536303532633031356435663734
32383035643637313863653537656665366138333933333364646561353333653661306133646361
32326535393333383033313765383031353233323138386365623132646636383037633537386361
65306166613030353033666438343530333330306532323135306363653764613638383461633964
63666239366638663537643636373432303164623735626634383636643836343436346161393365
62336462636534383766656632653833333832393263316633356235373335643436363333393335
62643838303131643265613861373964653464623766363664383330343138653632396365633533
39383535616630663564326536623537323966616436353439343630363738626131326365656132
32383737303733623830353366383062313134396531303831323336326137396335353763353631
36663336353865303562316233643762643563386665393664623138643836633165
33333438373661633337383161343862383963623736636136653339363064386538386437323135
6436666330363032616365656434356161396530363363610a333864313064633232366133366232
37316636366334346536663337663065303635626638666264666435393933343832653061323237
6663333736386636350a653931626665346234323832393334373563303130626262646565653231
30326263623965356639386438636531306430343239313162383065386135653534636134376333
64616432303732646535643530353963363734663538393539633034326535643539356561656632
36363330346131393262326561356631343631356434666264616134643136646238376336373665
65346361636435316437353235393263313766623438336662353532306463353134366435326364
36613865343264616364333631353238663238313338333232626262313637633662633163366638
61323166393739656536656435336538303439636561363961353832313431666432393463636537
62323939376265353330356334303334303532643136376531343765613738656562386665336132
36346232313432396431666535663362333332613037623531636135376439393936353261653863
65373061316461303866363338376131343736323933383636626338616431656533363833663266
62363935313262393733333566386337633630666332353263666462373164346362313034636239
33656462396238343065613965613232623132343562323364653366313231323531326364376631
65643961303862653030343364326533356336393031636437393465636263626236303633326139
65643432663037333332346261323663613031386563383533336538383133373332343363326530
66643231666636366435623639643166333863376533633537363364396663363732333932663333
62333239613264353233303064333931326236396538323130353061366139623362393734323434
36343537393363343861633131346561353637646336313233376162656561623362653565623339
63386337613461343534643964323932356661383436303966346339386131336133643132376330
38656535353335303966636235643666306336396435636434363733313665366234393032333065
37633231376134636435343233363032666231666134623365653238373836326237373831326262
66303234303164303961316166623062616139353264343864363938313733653563663661633535
37326636346435626362336437666364623264363565653935336438386262376663303230313265
62663665666132313436663330616230383235346333623563313262376530356535613263316436
35313766363763386234333733636464326134633136346532346632623534646365623136343363
30316435613031333036383835656230353430636135343961356363613139353763343233633834
38656431363139396535653565633631393462316334666464333839343035616531643466643531
35613733373331643961353830376266376433363938373563653833343464633465663766333066
34633364313762633034633461623232656537653762623532613332386132333365383062653136
63323234626266336462333534636236653230343530336532653831313339613531343731313237
39653737663665373361326433643364656434393838326339636238303964366336363961653366
36643938633635313432663765316130326238306163346566313062626439626263633033623731
63323532346366653238663931653334613734633963363632643462316130393138363436666532
32373833323330356164626332646232623031326365653765336261323661616137373732356164
63383633353764643233323430333233306337623834353934643864636339646239636430316166
33643030333261323461643031613730343131343830353463313766353035326436306566343161
35643534323763316165343832346433356364343061383036306434386631356537363331303035
34303430393034393763343964613935383739656662643066363633333839396465386231383837
30336331393365346636363732616661633635326364366435366466383639353839343731616365
65326633636263653438343561633632646234316461616666363630333966326230356331373335
31353665626233663433633563623765343431376639316232346666663065656462616438663333
62663662336662346563333935333261626635343764356631356363356362346231306535376466
36393932666662653934626134613065623461303834393231616332363461306534303666353632
35646363333065356631393863396536633838343365343238636332303862306631346639656166
30373735336361653863326331373834663164393863666631623866353338366561326635323132
35306535626564376666623837666435663337613164623966306138353161313239373436346239
36656266323233636233326139326266346464353665323465663666646264613466636132626464
37353762306538643233663338613062353134323832653139663036666337643131613062643936
37633363376365356333353433613839653130323036643737633163336531323032393937333432
39343238396534353330346664346135326333333638666261396463656663323935643337313462
32396137613432623664323134356361323861306230353165663162663732326563626162346630
34626536393962393764393764393234373138656432346332633963393135386238313563353761
34366438353337396264373032336166663937343931633635666166343638386237396333626133
38383766616566336163363931393438366566386565663938356630366430393830653037363738
30666465326266363834653934643434666466326632366463303965303366326364316430366561
32636631663232373163636535366333623261366466623262393631626334626263656534386536
66323833353264623538663232376138346361646362313565333534363535663031643833373064
38313062346339636335633962323933383230623634303431383236626166636535326465316439
38646636336130373763646635386265373065326263616438646565313439613830316135616435
62326430336337643265306261343036653938633634626561333664313035393933646533326661
62626437306432353938356338616462663130646530623636393233373837336138383963323165
35643231613565313434386163643637633130626435376561376235346438303234386637383835
37356238616263646665336435306233396436666664396532373063626162346237376662393639
35373665373638396434353062666430633362653163633639623836346438323632643164653638
62623463343465303236346562386338646536656438633966643430343266313935323630616633
62313531343764343966333439343866613965303036616634363162303434643533366465313562
62393666313838313938356265633531326431333730626632343139666338656465306431636162
66343532346238393464366134656334363964626264623263353537633638346239396539653538
37303339613036306533353132326534306433353364613536316263326363323134333639346236
39376263313431666462383863336638306631663563313364333235333338323364613361633532
38313263353539633662353533646333353262356436353938303036663130306362303935356136
63313234363138383864613664666635613464653765636461383738356135623662313866383036
64626437343465333563346434323762313232643230323336366539326631396463303961666461
61656338643532616337653362636362373837373836666535633762343335623033316264366261
62633137356132306430623537616135613965393737323263343463633839393165646630383331
36616339346534346636396532333836633436323232323364303963313030656330386336633538
34383534313236396461653462306130376462396138303561636331663062303864326238303335
65663832333631613963326639386665643135366632393438666361376334636233336239633837
36383761616364363262306535653065303536363066316431303464373230326436336661396231
66333438376664333731333630383031366237396638326534636532343535303964653436633438
64616263366561653334346138393866353437393037343930623237326231303261383733336232
37646533393439653965386563333232656565663531396663303334313839323361363864396332
61656638303130303433666561646663323139643337326561333832373538306236326538363637
38666534633330653564653066643335623938373331376339393338343533366436333330313165
65366562386366666632653064663637343536313462326562626436356363306134306237613265
32366338643237333739626331393763323934396265383138633035646533353536633866313432
38336137383036373434363530353833653938663035306337643638316463373762613931373038
32373361326136616331663733616133623936663530356566383461336334663937383230386462
38656332613763653339363565613762383735333163633831356364333563363630623666616430
30353237653730613361643233386139303639666137653733353334326530306431376666663664
34633531393261343165663330373961646665396139323762313663376639366464306533623333
62326432623334336166656565656230313063656163636561326632666438633966323930316264
66373866663461616336336264356561373232313737353836646632383438333162383832616662
30636437613163613631623165366631306438643765383263626133653231333361383633363136
36653831623562653838633133646633393038666164346461333531373034356435363336636338
62623464376264363537306166613461396630303039373239656664396564333435303164613235
61346238386233653462616632303337663036626465663361636130333566303337313237626237
65636633316366343064663636383362316665633263633136323563363935346138356635653036
36383835323838366363363335323731333066393334373265653563336533616362633163343661
66326630353537653633316631343332303231373630363635623136386537666434383032323165
33333633643064376239346139633664633330323966366430353135616633633465363030386665
36353164623564343934323063313763316566373830643163616633643937323732333561353832
66623364666335316230346665353631663465633034323265666663653866623037353935393262
61623065656637636666383239343661616233396663333038393963366537326136653863333235
65633137626134383763663366396438366634313465363965343830333966373930333134353339
35396538303537316636333339613731623636646230323662613663306537326566656666323434
65346531623533336535393530373963343864313963666335636334396663393837396665373565
39646138356134313732666633663061646330643438393736653433313238373135656636643337
39396362383363333434376336613933613438653636663334336337653633613433623336623461
32373565306435646438306365343465653863656434663937653938393839333739363639326536
64303534383961333333386237366239386330386533343939613664363439373135333731393739
39363166306636333766333332393265613133356262356666343039666237663664636266626664
65316339323638353333653631363365356562623535666235313234613236326130616261663830
34663063626539363734313562656233656131326265626637353239636638396564313561383761
62663638623135343333316464346236353364616239633566393039633339306334623234616331
34366435663938346335323932633330366639653636336636373562306561656536653363366233
39383064623435356338636335343662343435336564363965646439393964323162363736346637
65323765333364353831396433666561376437333834313334316165386631616332633533666336
37313533623535313934393230353439363231623063663961376537393638636237623134323337
30393032333530316330333736616463633262616631353238323933303766646137386465643366
33356665396437623732373437373537303034353431353031313162323730316566396238653038
30366234663037653736353137376264363934646366353761323364663538346662323934343266
30373662613461663561623466633939396439653663353365346133623933613462623231616562
66643738643661643766323266626266313330633936313964366536323263373666303130623738
32323230356665323439646532343930333936373536626466656566363161646663616266326133
32393137663562613531323832313565346632303131646432363961613331346636653830323136
36323436373964313737313131346131353630636561636639316464323666636336656265343565
65303936353165326137613638366532303265356537343337656165366663383961643134656435
61383565306265333939613561613035616663336361396536343939343761663833346134646365
34323233666439623436323261616432363838616437386138393735383364393164646638373630
33386632346239383037633132636431366264383633333365306338333661303662363533376339
62633663366362303038616666336335346332316366353136323666346531393938666236343163
31663665643839313439663839353431343061386465366331663637373532613266383065393639
62613565626135363133623261333061373738633333623337396631356332643039306638303434
65663762373630323263333239613939346133626534613632396433376234663636363062656537
62386664343462346334663662663865653766373738306438316533643962356136653565373761
62393437326138323065396630653838326138653865643937353431656137393732346361353734
31326634653331353232633061303230393462363065613832303630383237366463363666613864
37643135303034326335326563353064343835323863313134616262386564313235653762376332
36636533646235343138396537623266333566633466393764353731393935306432313266636133
63326362653033613264333139633638643638326532313239646239386332323330306538366362
37646432363535396161336465376363343430333261396536346464356135343462663462613136
36666238633663326230373834303431336566366666666534343537313635366537396262656236
36646639643730393134613662383238623835626230313833653932303832323366343765343434
34363033323836663035363166313630313062663162313165636138373261386636623831666632
33373962626237666130373031633437653966386561363232363332333633303961323864333263
39666230383332376537313137643635623336316336646537333137633564376432356432326639
61383565313233376435636366366531363462306535636131636163636130663732383161616364
37343064333264663533343739356139353365386565383833363165326536306431393764303632
30653865623566363965306636366530303261616663306433393135656366383138356337383365
36323736643035383231663034626564643235646237623632383164633062326132363331353634
61653761346439326665366565383534393635616365353361353863363763383664303166383434
33393732313837373336616564343864633330663566653933356237613538653366663838383132
33303437323438313837616134616466626562313262653866313034383764656566373331343738
30613062303630663365636230396231313065356662376163353632613564363066316239636434
66356535386263353737383838653538316366343935323337386561353533353161636538646363
63643739376366326536333261306263653563353331393133323964653764373932663136316335
36333535626231373864316634613366353535393932373039646161646466363663626561373033
64333133353931303361363466346666376431363336323166356162363537633536336638653838
35323562653138393833383130353232616564393738326638366565616233633634336438303632
30353765623565336330386335306162336662643466663335623836383238316161633339373137
32393165323735643034633464313337386362363331353432363233396538393835383933313637
65656330383732633537646361666439303266653165313233636464313964383639346635376538
64633861623439626331643431326336646135656539313836323135373862316438393237663564
31373135356135356662336265633862343435356530393835376430666566653036373338636332
64663230323361356262356537656262396665663538386664363735646234306231613339636338
34366433326535353965376236643661646339366566663531653864316533356466653864373633
33363330333765373662646634326236313434383433653563383436316635353461386662646165
31626566616163373137326165323066646535663766636265386435633965326165303831323633
39613139623835316165326138386431383530383035653931616334353235636138303761383037
39336163373332346365333935656563343939623335313461363138656239666263366236663464
32303732663937363964346639323236623166373334386239613564643834316536363634326461
64623939363635613863613065656363303734643766306564326437663037623839303734393036
64326363626562363934313930383766383462663766336666663338653765656137393362643366
36326336323638393161353464396637633566383262333234656233653334623131323532376637
62613064626532616631646232386631623839326665346431333232333463373031316237363462
30643731653666643331643839343865646437613135346363646131383262396134376363303335
34303164303236383139326264623462363062313139653465346435336163653863633764613631
33623666316530353163396539323238663935643764643939333966336137353034663164643733
34393132323339626331626532643266336435653636353930393738363134353661653636643263
30313138393263383837333438356463636162383938396137363035646433663932613066386138
37316535373939326131643930353435383232623366393630663463633233393232373730333631
37623837373533383462323431323335316231356436303239313535633837353931613730303363
31613765626466636636613366346166393766373834643337353764666532376335376139316138
38646133643736636363363434306334373933633264366530373534666637393835366266306633
66653966613136653936313732396366323830376236626530306139333030323966383035643733
36353833323539393136303035393866366563323430636336356639623734656135356566373062
34666433316139316664643234623530363732373338623162363636303463346463323131333065
64656566353837336266386233323439623237366364343635306137663038326434366531623062
64613365323339613465326464653965613439653766623762363139366264663765363862323839
63346539323961343532626465363266626234363964313531353662636635623165376130616536
64363361383766636333626366616531343833633033643965626435313130653938316430313532
64363731633139383236326231653434663132313463326563393739393132663765396337643035
32373963393830356362366130376135353935396631393533333430363531636234333832373939
36656233343663623262346337323034653036373432303266353333626434353137353939346665
37633432303162323538343339643635636464353333313063363662663033396630303162333639
31633537373364666234653938633461343738333464653736316331343038393333643936646462
36373232373962653031333730363166393463313232616631383233386533373464366465623335
65393462353638633931353331313233356230303565313030663739626230323766666466326339
35303361383065353333666161306433383139366439633730666364383130316637633464646336
66643065303934663765623233333261313939373236396136366566306438626439393163636430
30656334663361396230303239663338373664346362623934313130343064353435626439356562
35653638613037656133313765313165333066353732363361386234353635626563323932356237
31363333326536353536323931643739333764323637356164663566343563633761333462383735
66383134646139373130386366316532656139336231303931656265636130643130616531366530
62383132643236623835323362383866613765343762333536333365336338373264633130656438
36343331666431326530626137333665623836636136303031333965356366396239396534663263
35343730303534313830623430666566386564653036356635623038303133623231616635396463
65626137633033663631373366373238353766323533643462396562633164633730633135396266
36316362353964306463336237383232306530613539653462326137383938333638353038396132
66343265643162363735663235353161393732326530373735363662633165316265323065396163
31663761303637616566396262346238366631663562323566323364663464373930373831323630
39333165336264336539353634633936396561626363353466303931343436306636356663346438
64373561666638656439353964626436613164643663336336333337393332346132313830316430
37336139333539316639646337383737373530643533336133633135333936343165303764623366
35346432656263396439663635653066303861643938633033393334336336396133626237336432
31393061653839653964613239353336653666366163616163616230396661313233613934326339
36333733663032613633613037343337646237666565316239303231313163383264376636336338
37656532373634383132346163316337336534316465383531316465353861633062336235376631
33333963313730653164313866323461353334653231333762336232366434333631396135333466
36643362653137323934323966303734316334306133656139613763336431323236643264663530
38633730346531396435666530316563386566323737343766653135386537393165356264356534
62323962306332393063313062313230333334353833393362656166353638323366353934656263
38633531306438663134616262323332323338653361356336353962376331323537623734316532
35306434383336633436656437663765626530626535383464356532613536356533646332646135
39613030323432643161366363313262633261366566613931303663636262353466313933303162
66373535353934626135326439653630303437666535396266303532626636613563616633623237
38623938323137393065616136376663363234633735363264356438353534616338393832386337
66663339313062613766666435626364353935643932633233643630323464336135336339376437
30323536373639343738613463613466396335626339343135306666663931656564393664643761
65396336613465313035396134636438636134316236636566333031646666383939383264303437
38656337326233363866336363363161333236326137393465633935626165663136316661316131
66393764313130373766386235663134376239323037373365333730643336656532316434663265
35646664383338326366386536616339393938336539373762643839613763323434363037326330
66353738643735656165396138343262653563353934376237366564636638623630393238373530
39336335303564616232393165653639326166333536343966353933633365326539383632646639
37636238376137646239353731343933346562613630656130653865633834626363656231373162
65333662653962373139633466383834626566336234316161633038653137393266393564376439
62343365666637396639326438326631613664666662653935346230316632396361663038663239
63336335643665353162393330623635663839666162333561376265363330383530653733333239
37373665646562343562313764386534663239636130646564333433313661363338326439363865
63353064613161366461383862623363333637633430376361366566383332636634646630363139
65303139396539323336313666336362626339326666343061303431356361343438313365353431
30303266363664373233303231346166643839343564306363613236316665306437333636343131
61303234666664323138376335623639393939633836353664343232316630393263323233343366
32393736336166323166616139323066613062646139656236343233623630616262343034383631
61653662383537646364363764353335333630353431633534313731633265626263303863326565
37616534303164316162353165396236656565303532326235393237366434323739633662663261
33383635653734303233356438636132343731383439623463633732373833303339353662386435
63316138353766303962616435383138373739383835353662613666356565366237353932393263
34326561613234356537343234303166613534356134643766383332646263623430653632386365
61376165656366366532346465343932313032643163313362373633373066653036346238343938
66626133306163353966386662363039323166353330633239386264306337386361653430633838
66366636616661313939316562373330313564383033643035393738353939613066316138643238
35376336633238636463376234376364386464396461636336313562616361396435323639666433
34653139613962623235613035363634383735326564333332333632656237333238356566646536
62346435303932363231306634643037623935653235613330666666656433396463656231643364
34313235613064646432633935656231643162363530313761303339323830653564303963643532
39326163396461613161363031616336666564326630323465663831653431353566643661656435
35636238633663346139343732353233663930353664623636303134303633356232313063346566
30633762653239356131613539396435396235326431633062616436613266353266636133656531
63346533383764393733396436306136383830313265656539376136343536353737313365333865
61653665393037346231656663363432666332383837393264656231386435323333376633333265
39633563653161663531303330393237316132653339653531316538316534353334383161623833
63656534643833656366623031326132343732663536393636393537383338613462336638626334
39326264623032393661303335356235343736613964636261633038333236623232613633343263
34363865306233346433393664363038303464363834313463636363366333313433333930336634
65396232663031323965343336366339623239386566323362396564333932336134336231646430
34376236636536626264663532323530656634333137363431313339643164333236303337373639
31326131636161386665623838303939616337636666346363616465323263373061633832363839
39343131386333666231643931353330343136363732396465383336303866623733316235646234
65613531613333653231666234353532313738363266353336303564613061393639323933646339
64396334396431313563326136656539613535663334323330326566613264393965623065616634
32313333663535313531343363656230656334346430643365363838656430616366653766333136
32346137656136666432383934313865613535303962333464316465313464333233646162376165
37363265316139643332393761663164346537663064346133323661393030393533396633646134
39383539333364626263323364353764316539323162346434656234393562326133613632633137
34323537393838393534643861356365376461636235386638376661623439303832643231616431
32663264306166366336396130326435346432343732323764346232356439633361663937313233
62636130663238333433396335356331653166366130626632663162653736656238343134353134
39373663633437626661393734363264313137663138643665353633366663366562386337396561
38383464333531306138316266626461326531616364303732343337386464366464633834383439
66303334333234306166396235666164313833333164356561663063326563303934373933313334
32326466343761333666373936373332663939643662363665323534333638316637666665326564
63616134623530333739633265343637626561383831663836626538313539653536373165636133
62396432376332356133336461633664336264616566376664643861363838313766393833343366
31386636343835663062396232646663363935396366343361633462643734373437666331383035
30373963323834343138653063313635643062396130373861643134363062363135623730663335
34373935623239363866393932363966366233643732646461343964383563393064396331353331
31646662323364376639316562666465356438386637393130616330663563633839326661643239
62346633353963336239633738336431326638626232313965336361636430323739653734636436
39316363316137366233616431346639663335393737653562356532363634346237336266333132
31343836326538653164653163653738656238326366313532613433333337383263646439326661
65306135363138646665363463636436303864316432663734393130313932643833356161373139
65376334376136313237393336636630643933373165336432643233306366633663333930396364
31393739333730326434313639376365356432376338386430363133666436643837633533616333
36363464633233343130656163353137663165343064373039363439346631393436393430383361
61353563346531353561303935363531333235313731303237326334363763646131653961613334
33306534663238343433363237393234643236393931343230656438353866313638636633396464
61636561333562383964663261316135373235313234613564333333336438646636303561616634
63363033613238323463646165373361613834353230653138623132303731393436386139663533
38393263306139303231626363353931646163323364666161653861643739353262313561393165
6262

View File

@@ -1,66 +0,0 @@
---
# FastPass Kubernetes Cluster Variables
# Cluster Configuration
cluster_name: "fastpass"
kubernetes_version: "1.33"
pod_network_cidr: "10.244.0.0/16"
service_cidr: "10.96.0.0/12"
# Control Plane Configuration
control_plane_endpoint: "{{ cluster_name}}.{{ base_domain}}"
control_plane_port: "6443"
# CNI Configuration
cni_plugin: "calico"
calico_version: "v3.30.3"
# Node Labels and Taints
node_labels:
zone:
# Control Plane nodes (masters) - no zone labels needed
# space-mountain: (control plane - no zone label)
# big-thunder-mountain: (control plane - no zone label)
# splash-mountain: (control plane - no zone label)
# Worker nodes
haunted-mansion: "backstage" # Internal/backstage workloads
peter-pans-flight: "backstage" # Internal/backstage workloads
# Future node: "on-stage" # External/on-stage workloads (future)
environment: "production"
cluster: "fastpass"
# System Configuration
selinux_mode: "permissive"
firewall_enabled: false
# Container Runtime
container_runtime: "containerd"
containerd_version: "latest"
# Repository Configuration
kubernetes_repo_url: "https://pkgs.k8s.io/core:/stable:/v1.33/rpm/"
containerd_repo_url: "https://download.docker.com/linux/fedora/docker-ce.repo"
# Validation
preflight_checks: true
validate_cluster: true
# Kubeconfig Configuration
kubeconfig_path: "{{ lookup('env', 'HOME') }}/.kube/config"
# Hostname Configuration for Kubernetes
# Override hostnames to remove dots for Kubernetes compatibility
kubernetes_hostnames:
space-mountain: "space-mountain"
big-thunder-mountain: "big-thunder-mountain"
splash-mountain: "splash-mountain"
haunted-mansion: "haunted-mansion"
peter-pans-flight: "peter-pans-flight"
# Generic Kubernetes Prerequisites Configuration
configure_firewall: true
configure_ntp: true
selinux_state: "permissive"
disable_swap: true

View File

@@ -1,3 +0,0 @@
---
#freeipa_user: "admin"
#freeipa_password: "{{ vault_freeipa_password }}"

View File

@@ -1,51 +0,0 @@
# file: group_vars/hub_cluster/vars
# Ansible vars template for OpenShift nodes created via Ansible (configure_openshift_cluster).
# Cluster deployed via Agent Installer and Matchbox (iPXE):
# Name of the OpenShift Cluster
cluster_name: "hub"
# Version of OpenShift to install. All available versions can be found at: https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/
cluster_version: "4.18.21"
# Type of cluster.
# - none (Single Node Cluster)
# - baremetal (Traditional and Compact Cluster)
platform_type: "none"
# Number of nodes to deploy
# - Master: 1; Worker 0 (Single Node Cluster)
# - Master: 3; Worker 0 (Compact Cluster)
# - Master: 3; Worker 1-3 (Traditional Cluster)
master_node_count: 1
worker_node_count: 0
# Subnet that cluster nodes will reside on.
machine_network: "10.1.71.0/24"
# OpenShift API IP Address (Reference host IP address for Single Node Cluster)
api_address: "{{ ip_address }}" # "10.1.71.10"
# OpenShift Apps Wildcard IP Address (Reference host IP address for Single Node Cluster)
app_address: "{{ ip_address }}" # "10.1.71.10"
# These are internal networks to the cluster and should not need to be changed.
cluster_network: "10.128.0.0/14"
cluster_network_host_prefix: 23
service_network: "172.30.0.0/16"
# Static Variables
openshift_installer_file: "openshift-install-linux.tar.gz"
openshift_client_file: "openshift-client-linux.tar.gz"
openshift_installer_download_url: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/{{ cluster_version }}/{{ openshift_installer_file }}"
openshift_client_download_url: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/{{ cluster_version }}/{{ openshift_client_file }}"

View File

@@ -1,51 +0,0 @@
# file: group_vars/internal_cluster/vars
# Ansible vars template for OpenShift nodes created via Ansible (configure_openshift_cluster).
# Cluster deployed via Agent Installer and Matchbox (iPXE):
# Name of the OpenShift Cluster
cluster_name: "openshift"
# Version of OpenShift to install. All available versions can be found at: https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/
cluster_version: "4.18.21"
# Type of cluster.
# - none (Single Node Cluster)
# - baremetal (Traditional and Compact Cluster)
platform_type: "baremetal"
# Number of nodes to deploy
# - Master: 1; Worker 0 (Single Node Cluster)
# - Master: 3; Worker 0 (Compact Cluster)
# - Master: 3; Worker 1-3 (Traditional Cluster)
master_node_count: 3
worker_node_count: 1
# Subnet that cluster nodes will reside on.
machine_network: "10.1.71.0/24"
# OpenShift API IP Address
api_address: "10.1.71.69"
# OpenShift Apps Wildcard IP Address (These will be the same in a Single Node Cluster)
app_address: "10.1.71.60"
# These are internal networks to the cluster and should not need to be changed.
cluster_network: "10.128.0.0/14"
cluster_network_host_prefix: 23
service_network: "172.30.0.0/16"
# Static Variables
openshift_installer_file: "openshift-install-linux.tar.gz"
openshift_client_file: "openshift-client-linux.tar.gz"
openshift_installer_download_url: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/{{ cluster_version }}/{{ openshift_installer_file }}"
openshift_client_download_url: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/{{ cluster_version }}/{{ openshift_client_file }}"

View File

@@ -1,14 +0,0 @@
---
ipaadmin_password: "{{ vault_ipaadmin_password }}"
ipadm_password: "{{ vault_ipadm_password }}"
ipaserver_domain: int.mk-labs.cloud
ipaserver_realm: INT.MK-LABS.CLOUD
ipaserver_setup_firewalld: true
ipaserver_setup_dns: true
ipaserver_forwarders: 1.1.1.1,1.0.0.1
ipaserver_random_serial_numbers: true
#dns_ip_addresses: "{{ ansible_hostname }}"
#dns_reverse_zones:
#domain: int.mk-labs.cloud
forwarders: 1.1.1.1,1.0.0.1
#hostname: "{{ hostname }}"

View File

@@ -1,4 +0,0 @@
---
#freeipa_user: "admin"
ipaadmin_password: "{{ vault_freeipa_password }}"
ipaserver_domain: "int.mk-labs.cloud"

View File

@@ -1,9 +0,0 @@
---
# Variables for Matchbox
assets: "/var/lib/matchbox/assets"
http_endpoint: "http://matchbox.int.mk-labs.cloud:8080"
rpc_endpoint: "matchbox.int.mk-labs.cloud:8081"
# Variables for OpenShift Installer
#openshift_installer_pull_secret: "{{ vault_pull_secret }}"
#openshift_installer_ssh_key: "{{ vault_ssh_key }}"

View File

@@ -1,54 +0,0 @@
# file: group_vars/openshift_cluster_template/vars
# Ansible vars template for OpenShift nodes created via Ansible (configure_openshift_cluster).
# Cluster deployed via Agent Installer and Matchbox (iPXE):
# Role of this node in the cluster.
# - master
# - worker
# Name of the OpenShift Cluster
cluster_name: "openshift"
# Version of OpenShift to install. All available versions can be found at: https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/
cluster_version: "4.18.21"
# Type of cluster.
# - none (Single Node Cluster)
# - baremetal (Traditional and Compact Cluster)
platform_type: "baremetal"
# Number of nodes to deploy
# - Master: 1; Worker 0 (Single Node Cluster)
# - Master: 3; Worker 0 (Compact Cluster)
# - Master: 3; Worker 1-3 (Traditional Cluster)
master_node_count: 3
worker_node_count: 1
# Subnet that cluster nodes will reside on.
machine_network: "10.1.71.0/24"
# OpenShift API IP Address (Comment out for Single Node Cluster)
api_address: "10.1.71.69"
# OpenShift Apps Wildcard IP Address (Comment out for Single Node Cluster)
app_address: "10.1.71.60"
# These are internal networks to the cluster and should not need to be changed.
cluster_network: "10.128.0.0/14"
cluster_network_host_prefix: 23
service_network: "172.30.0.0/16"
# Static Variables
openshift_installer_file: "openshift-install-linux.tar.gz"
openshift_client_file: "openshift-client-linux.tar.gz"
openshift_installer_download_url: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/{{ cluster_version }}/{{ openshift_installer_file }}"
openshift_client_download_url: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/{{ cluster_version }}/{{ openshift_client_file }}"

View File

@@ -1,34 +0,0 @@
# file: group_vars/prometheus_server/vars
# Ansible vars template for Prometheus nodes created via Ansible\.
# Version of Prometheus to install. All available versions can be found at: https://prometheus.io/download/
#prometheus_version: "3.5.0"
#alertmanager_version: "0.28.1"
# prometheus_nodes:
# # - '192.168.1.207' # Worker node IP
# - cinderella-castle # Master node IP
# - 10.1.71.21
# - cinderella-castle.local.mk-labs.cloud
# Static Variables
# prometheus_installer_file: "prometheus-{{ prometheus_version }}.linux-amd64.tar.gz"
# prometheus_installer_download_url: "https://github.com/prometheus/prometheus/releases/download/v{{ prometheus_version }}/{{ prometheus_installer_file }}"
# Grafana Variables
#grafana_port: "3000"
#grafana_url: "{{ inventory_hostname }}.{{ base_domain }}:3000"
# prometheus_targets:
# node:
# - targets:
# - localhost:9100
# labels:
# env: mk-labs
grafana_ini:
security:
admin_user: admin
admin_password: admin

View File

@@ -0,0 +1,19 @@
---
# ansible/group_vars/proxmox/oidc.yml
#
# Proxmox OIDC configuration for Authentik integration.
# Client credentials come from vault.yml.
proxmox_oidc_realm_name: "authentik"
proxmox_oidc_issuer_url: "https://authentik.local.mk-labs.cloud/application/o/proxmox/"
proxmox_oidc_username_claim: "username"
proxmox_oidc_scopes: "openid email profile"
proxmox_oidc_autocreate: true
proxmox_oidc_default_realm: false
proxmox_oidc_comment: "Authentik SSO"
# ACL entries - grant your Authentik user admin access
proxmox_oidc_acl_entries:
- path: "/"
user: "rblundon@authentik"
role: "Administrator"

View File

@@ -0,0 +1,17 @@
$ANSIBLE_VAULT;1.1;AES256
64613361376364346139313833613465663361336634326430393261366630306466363935613139
3634363235343736643230623865386436333734663531310a343965396534336262356234623966
39353332626662636666383935383530613139626439373664323063633063316264383331646533
3366333837613731310a656462633638376432326365343135373863313665346566383933353630
37303565323630633739396433323165326262363863386233343134636236646366633765616432
33633165613239653762343935386637393437386431383961306436373765343736313634333933
30376463646464303066613561613564353938306664373464333966383664383034616439343735
38363966323366343465393530383736393364373361326234356365363163356632393834393464
39393530356235383830323065636535383138353864373237333164323436623737383435313261
64366362626232386438376131633533633162356432613835656465623762633464353936303236
63353633633262633461353963653534663336396134373435303266386162393965343165303335
65313436666334383965373837376664323861376162373834363439653539383231346634633737
30626431373739633930313937643938343165383536373465613535366562313439396533643864
36323032316131333962373732306334373939333363386564653465303261393337333466316130
32326533353165393635393130396164636363623937313566343333386562616662383038613565
35386638383365633362

View File

@@ -1,77 +0,0 @@
---
# Variables for Unbound https://github.com/aruhier/ansible-role-unbound
### Server ###
unbound_chroot: '""'
unbound_num_threads: 2
unbound_interfaces:
- "{{ ip_address }}"
#unbound_do_ip4: "yes"
unbound_do_ip6: "no"
#unbound_do_udp: "yes"
#unbound_do_tcp: "yes"
# list of strings, as the order impact how policies are interpreted
unbound_outgoing_policies: []
unbound_access_control:
- '192.168.1.0/24 allow'
- '192.168.3.0/24 allow'
- '192.168.5.0/24 allow'
- '192.168.10.0/24 allow'
- '10.1.71.0/24 allow'
unbound_access_control_tag: []
unbound_access_control_tag_action: []
unbound_access_control_tag_data: []
unbound_access_control_view: []
unbound_private_addresses:
- '192.168.1.0/24'
- '192.168.3.0/24'
- '192.168.5.0/24'
- '192.168.10.0/24'
- '10.1.71.0/24'
unbound_private_domains:
- 'mk-labs.cloud'
unbound_domains_insecure: []
unbound_do_not_query_addresses: []
unbound_local_zones: []
unbound_local_datas: []
unbound_local_data_ptrs: []
unbound_local_zone_tags: []
unbound_local_zone_overrides: []
unbound_trust_anchors: []
unbound_trusted_keys_files: []
### Remote Control ###
unbound_control_enable: "no"
unbound_control_interface: []
### Stub, forward zones and others ###
unbound_rpz_zones: [] # list of dicts
unbound_stub_zones: [] # list of dicts
unbound_forward_zones:
- name: 'int.mk-labs.cloud'
forward-addr:
- '10.1.71.5'
- name: '.'
forward-addr:
- '1.0.0.1@53#one.one.one.one'
- '1.1.1.1@53#one.one.one.one'
# For stub and forward zones, if a key inside one of the dict is an iterable,
# it will iterate inside it to duplicate the option with all the contained
# values.
# Can be useful in case of multiple forward-addr for a same zone:
# Example:
# unbound_forward_zones:
# - {name: "test.tld", "forward-addr": ["192.0.2.5", "192.0.2.6"]}
unbound_views: [] # list of strings, as options can be multiples

View File

@@ -0,0 +1,25 @@
---
# ------------------------------------------------------------------------------
# FILE: ansible/host_vars/astro_orbiter/vars.yml
# HOST: astro-orbiter (10.1.71.130)
# ROLE: Ollama inference host with AMD RX 5700 GPU passthrough
# ------------------------------------------------------------------------------
ansible_host: 10.1.71.130
ansible_user: wed
ansible_become: true
# LVM root expansion — xlarge template uses sda3 partition, standard VG/LV names
common_expand_root_lvm: true
common_root_pv: /dev/sda3
common_root_vg: ubuntu-vg
common_root_lv: ubuntu-lv
# Ollama — all defaults apply; explicitly documented here for visibility
ollama_rocm_version: "6.2"
ollama_default_model: "qwen3:8b"
ollama_hsa_override_gfx_version: "10.1.0"
ollama_data_disk: /dev/sdb
ollama_data_vg: ollama-vg
ollama_data_lv: ollama-lv
ollama_data_dir: /var/lib/ollama

View File

@@ -1,49 +0,0 @@
---
# file: host_vars/vm_template/vars
# Ansible vars template for hosts created via cloning.
# Supported hypervisors:
# - Proxmox
platform: "proxmox"
# This is the Proxmox node where all the VM templates are stored. (Templates are not global.)
proxmox_clone_node: "fantasyland"
# Templates are named in the following format (all lower case): <OS Distribution>-<OS Version>-<VM Size>
# Current OS offerings are:
# - Fedora (42)
# Current VM sizes are:
# - Small: 2 cores, 2GB memory, 8 GiB virtual disk
# - Medium: 2 cores, 4GB memory, 16 GiB virtual disk
# - Large: 4 cores, 4GB memory, 32 GiB virtual disk
# - Xlarge: 4 cores, 8GB memory, 64 GiB virtual disk
# - Xlarge Plus: 4 cores, 8GB memory, 128 GiB virtual disk
vm_clone_source: "fedora-42-xlarge-plus"
# Proxmox storage target.
vm_storage: "general"
# Proxmox does not yet do dynamic load balancing, the host target sets the target for HA groups
# and backup groups. (ha_group will be factored out in the next functionality update.)
ha_group: "fantasyland"
proxmox_host_target: "fantasyland"
# Currently, only single NIC VMs using IPv4 are supported via cloning. The IP address also
# sets the Proxmox VMID. The VMID is a combination of the 3rd and 4th octet of the IPv4 address.
ip_address: 10.1.71.21
# Software
# Future enhancement will allow specification of additional software to automatically deploy to
# the VM after creation.
#terraform_version: "1.11.3"
# ---
hostname: "{{ inventory_hostname }}.{{ base_domain }}" # Change variable to fqdn

View File

@@ -0,0 +1,12 @@
---
# file: host_vars/guest-relations/vars
# guest-relations — Guest Relations
# VM provisioned by Terraform (pre-pipeline bootstrap)
# ─── Network ─────────────────────────────────────────────────────────────────
ip_address: 10.1.71.40
# ─── Application ─────────────────────────────────────────────────────────────
app_role: identity_provider
app_name: authentik
app_deployment: docker_compose

View File

@@ -1,29 +0,0 @@
---
# file: host_vars/int-master01/vars
# Ansible vars template for OpenShift nodes created via Ansible (configure_openshift_cluster).
# Cluster deployed via Agent Installer and Matchbox (iPXE):
# Role of this node in the cluster.
# - master
# - worker
node_role: "master"
# IP address assigned to this node on the Primary Interface
ip_address: 10.1.71.61
# Ansible Playbook supports booting node via one interface, but installing on a
# different interface. (Disabling the boot interface on install) All these fields
# are necessary. In the case of a single NIC node, interfaces and MAC addresses
# should be the same.
boot_interface: "enp0s31f6"
boot_mac_address: "54:bf:64:60:52:2d"
primary_interface: "enp1s0f0"
install_mac_address: "98:b7:85:20:47:22"
# Static Variables
hostname: "{{ inventory_hostname }}.{{ base_domain }}"

View File

@@ -1,29 +0,0 @@
---
# file: host_vars/int-master02/vars
# Ansible vars template for OpenShift nodes created via Ansible (configure_openshift_cluster).
# Cluster deployed via Agent Installer and Matchbox (iPXE):
# Role of this node in the cluster.
# - master
# - worker
node_role: "master"
# IP address assigned to this node on the Primary Interface
ip_address: 10.1.71.62
# Ansible Playbook supports booting node via one interface, but installing on a
# different interface. (Disabling the boot interface on install) All these fields
# are necessary. In the case of a single NIC node, interfaces and MAC addresses
# should be the same.
boot_interface: "enp0s31f6"
boot_mac_address: "54:bf:64:5f:a2:80"
primary_interface: "enp1s0f0"
install_mac_address: "98:b7:85:20:47:3a"
# ---
hostname: "{{ inventory_hostname }}.{{ base_domain }}"

View File

@@ -1,29 +0,0 @@
---
# file: host_vars/int-master03/vars
# Ansible vars template for OpenShift nodes created via Ansible (configure_openshift_cluster).
# Cluster deployed via Agent Installer and Matchbox (iPXE):
# Role of this node in the cluster.
# - master
# - worker
node_role: "master"
# IP address assigned to this node on the Primary Interface
ip_address: 10.1.71.63
# Ansible Playbook supports booting node via one interface, but installing on a
# different interface. (Disabling the boot interface on install) All these fields
# are necessary. In the case of a single NIC node, interfaces and MAC addresses
# should be the same.
boot_interface: "enp0s31f6"
boot_mac_address: "d8:9e:f3:4c:02:a9"
primary_interface: "enp1s0f0"
install_mac_address: "98:b7:85:1f:89:cf"
# ---
hostname: "{{ inventory_hostname }}.{{ base_domain }}"

View File

@@ -1,29 +0,0 @@
---
# file: host_vars/int-worker02/vars
# Ansible vars template for OpenShift nodes created via Ansible (configure_openshift_cluster).
# Cluster deployed via Agent Installer and Matchbox (iPXE):
# Role of this node in the cluster.
# - master
# - worker
node_role: "worker"
# IP address assigned to this node on the Primary Interface
ip_address: 10.1.71.164
# Ansible Playbook supports booting node via one interface, but installing on a
# different interface. (Disabling the boot interface on install) All these fields
# are necessary. In the case of a single NIC node, interfaces and MAC addresses
# should be the same.
boot_interface: "enp87s0"
boot_mac_address: "36:47:ca:76:13:49"
primary_interface: "enp2s0f0"
install_mac_address: "36:47:ca:76:13:47"
# ---
hostname: "{{ inventory_hostname }}.{{ base_domain }}"

View File

@@ -1,29 +0,0 @@
---
# file: host_vars/int-worker02/vars
# Ansible vars template for OpenShift nodes created via Ansible (configure_openshift_cluster).
# Cluster deployed via Agent Installer and Matchbox (iPXE):
# Role of this node in the cluster.
# - master
# - worker
node_role: "worker"
# IP address assigned to this node on the Primary Interface
ip_address: 10.1.71.65
# Ansible Playbook supports booting node via one interface, but installing on a
# different interface. (Disabling the boot interface on install) All these fields
# are necessary. In the case of a single NIC node, interfaces and MAC addresses
# should be the same.
boot_interface: "enp87s0"
boot_mac_address: "58:47:ca:76:13:49"
primary_interface: "enp2s0f0"
install_mac_address: "58:47:ca:76:13:47"
# ---
hostname: "{{ inventory_hostname }}.{{ base_domain }}"

View File

@@ -1,33 +1,12 @@
---
# file: host_vars/lightning_lane/vars
# Traefik Load Balancer Server
# lightning-lane — Traefik Reverse Proxy / Load Balancer
# VM provisioned by Terraform (pre-pipeline bootstrap)
# Supported hypervisors:
# - Proxmox
# ─── Network ─────────────────────────────────────────────────────────────────
ip_address: 10.1.71.35
platform: "proxmox"
# This is the Proxmox node where all the VM templates are stored. (Templates are not global.)
proxmox_clone_node: "fantasyland"
# VM Configuration
vm_os_distribution: "ubuntu"
vm_os_version: "24.04"
vm_size: "small"
vm_storage: "general"
# Proxmox HA Configuration
ha_group: "pve02"
proxmox_host_target: "pve02"
# Network Configuration
# IP address for the Traefik load balancer
ip_address: 10.1.71.24
#vm_mac_address: 'BC:24:11:50:00:80'
# Software Configuration
# Traefik will be installed and configured on this host
# VM Template Configuration
#vm_clone_source: "{{ vm_os_distribution }}-{{ vm_os_version }}-{{ vm_size }}"
hostname: "{{ inventory_hostname }}.{{ base_domain }}"
# ─── Application ─────────────────────────────────────────────────────────────
app_role: reverse_proxy
app_name: traefik
app_deployment: docker_compose

View File

@@ -1,17 +0,0 @@
---
# file: host_vars/monitor/vars
# VM Definition
platform: "proxmox"
proxmox_clone_node: "pve03"
vm_clone_source: "fedora-42-large"
vm_storage: "pve-general"
ha_group: "pve03"
# Networking
ip_address: 10.1.71.249
# Software
#terraform_version: "1.11.3"
hostname: "{{ inventory_hostname }}.{{ base_domain }}" #change variable to fqdn

View File

@@ -1,31 +0,0 @@
---
# file: host_vars/ocp-hub/vars
# file: host_vars/int-master01/vars
# Ansible vars template for OpenShift nodes created via Ansible (configure_openshift_cluster).
# Cluster deployed via Agent Installer and Matchbox (iPXE):
# Role of this node in the cluster.
# - master
# - worker
node_role: "master"
# IP address assigned to this node on the Primary Interface
ip_address: 10.1.71.10
# Ansible Playbook supports booting node via one interface, but installing on a
# different interface. (Disabling the boot interface on install) All these fields
# are necessary. In the case of a single NIC node, interfaces and MAC addresses
# should be the same.
boot_interface: "enp0s31f6"
boot_mac_address: "50:9A:4C:52:A8:5D"
primary_interface: "enp1s0f0"
install_mac_address: "98:b7:85:1e:c6:f1"
# Static Variables
hostname: "{{ inventory_hostname }}.{{ base_domain }}"

View File

@@ -1,29 +0,0 @@
---
# file: host_vars/openshift_node_template/vars
# Ansible vars template for OpenShift nodes created via Ansible (configure_openshift_cluster).
# Cluster deployed via Agent Installer and Matchbox (iPXE):
# Role of this node in the cluster.
# - master
# - worker
node_role: "master"
# IP address assigned to this node on the Primary Interface
ip_address: 10.1.71.61
# Ansible Playbook supports booting node via one interface, but installing on a
# different interface. (Disabling the boot interface on install) All these fields
# are necessary. In the case of a single NIC node, interfaces and MAC addresses
# should be the same.
boot_interface: "enp0s31f6"
boot_mac_address: "54:bf:64:60:52:2d"
primary_interface: "enp1s0f0"
install_mac_address: "98:b7:85:20:47:22"
# Static Variables
hostname: "{{ inventory_hostname }}.{{ base_domain }}" # Change variable to fqdn

View File

@@ -0,0 +1,27 @@
---
# file: host_vars/turnstile/vars
# turnstile — Smallstep step-ca SSH Certificate Authority
# VM provisioned by Terraform (pre-pipeline bootstrap)
# ─── Network ─────────────────────────────────────────────────────────────────
ip_address: 10.1.71.34
# ─── Application ─────────────────────────────────────────────────────────────
app_role: ssh_certificate_authority
app_name: step-ca
app_deployment: docker_compose
# ─── step-ca Configuration ───────────────────────────────────────────────────
stepca_hostname: turnstile.local.mk-labs.cloud
stepca_dns_names: "turnstile.local.mk-labs.cloud,10.1.71.34"
stepca_ssh_enabled: true
stepca_listen_port: 9000
# ─── OIDC Provisioner (Authentik) ────────────────────────────────────────────
# Client ID and secret stored in vault
stepca_oidc_provisioner_name: authentik
stepca_oidc_configuration_endpoint: "https://authentik.local.mk-labs.cloud/application/o/step-ca/.well-known/openid-configuration"
stepca_oidc_listen_address: ":10000"
stepca_oidc_domains:
- "local.mk-labs.cloud"
- "protonmail.com"

View File

@@ -0,0 +1,17 @@
$ANSIBLE_VAULT;1.1;AES256
30383930323363386234333433636465393263613336646464666365643730386430353864616334
3865343031653162313736656437373666636136653263360a613961646133376262633164393535
31363434633634303035663133316230633538363936303266373931313661346563333832653032
6239376363646530620a303231363333363233623038326165316463383662656565626534396232
62333133623530643932643430663166373930353733363866336533643233373261333130613635
31633337376337663833613634666436383862386431636537373363343333323932363761653366
61353166613162346436396138316561646165303566376366323462663861616364336539313138
30386430373566353761383636626335393463376661356666303861353564313832346333396134
30653861363866336331336164323130623230666237356165613934333239386536373664643065
33643139346562346663313533643433353462363665323166313364373335366665373435643935
65303863663864393238393732303065343364306264396333376233666233346664323334336532
38373164383835663163363137643531303163396236623565666436363261393563343133333161
36663934303633663062346161636333396135336135616136303664636562363862353764343562
39643430396636313139336130656363306562363430346233313530663963366238326334623135
62383632613061316262323038303333323739303137363334626637666663666263613132336433
65346266393733633632

View File

@@ -1,47 +0,0 @@
---
# file: host_vars/unbound01/vars
# Supported hypervisors:
# - Proxmox
platform: "proxmox"
# This is the Proxmox node where all the VM templates are stored. (Templates are not global.)
proxmox_clone_node: "pve03"
# Templates are named in the following format (all lower case): <OS Distribution>-<OS Version>-<VM Size>
# Current OS offerings are:
# - Fedora (42)
# Current VM sizes are:
# - Small: 2 cores, 2GB memory, 8 GiB virtual disk
# - Medium: 2 cores, 4GB memory, 16 GiB virtual disk
# - Large: 4 cores, 4GB memory, 32 GiB virtual disk
# - Xlarge: 4 cores, 8GB memory, 64 GiB virtual disk
vm_clone_source: "fedora-42-small"
# Proxmox storage target.
vm_storage: "pve-general"
# Proxmox does not yet do dynamic load balancing, the host target sets the target for HA groups
# and backup groups. (ha_group will be factored out in the next functionality update.)
ha_group: "pve03"
proxmox_host_target: "pve03"
# Currently, only single NIC VMs using IPv4 are supported via cloning. The IP address also
# sets the Proxmox VMID. The VMID is a combination of the 3rd and 4th octet of the IPv4 address.
ip_address: 10.1.71.251
# Software
# Future enhancement will allow specification of additional software to automatically deploy to
# the VM after creation.
#terraform_version: "1.11.3"
# ---
hostname: "{{ inventory_hostname }}.{{ base_domain }}" # Change variable to fqdn

View File

@@ -1,47 +0,0 @@
---
# file: host_vars/unbound02/vars
# Supported hypervisors:
# - Proxmox
platform: "proxmox"
# This is the Proxmox node where all the VM templates are stored. (Templates are not global.)
proxmox_clone_node: "pve03"
# Templates are named in the following format (all lower case): <OS Distribution>-<OS Version>-<VM Size>
# Current OS offerings are:
# - Fedora (42)
# Current VM sizes are:
# - Small: 2 cores, 2GB memory, 8 GiB virtual disk
# - Medium: 2 cores, 4GB memory, 16 GiB virtual disk
# - Large: 4 cores, 4GB memory, 32 GiB virtual disk
# - Xlarge: 4 cores, 8GB memory, 64 GiB virtual disk
vm_clone_source: "fedora-42-small"
# Proxmox storage target.
vm_storage: "pve-general"
# Proxmox does not yet do dynamic load balancing, the host target sets the target for HA groups
# and backup groups. (ha_group will be factored out in the next functionality update.)
ha_group: "pve03"
proxmox_host_target: "pve03"
# Currently, only single NIC VMs using IPv4 are supported via cloning. The IP address also
# sets the Proxmox VMID. The VMID is a combination of the 3rd and 4th octet of the IPv4 address.
ip_address: 10.1.71.252
# Software
# Future enhancement will allow specification of additional software to automatically deploy to
# the VM after creation.
#terraform_version: "1.11.3"
# ---
hostname: "{{ inventory_hostname }}.{{ base_domain }}" # Change variable to fqdn

View File

@@ -1,15 +1,12 @@
# file: inventory.yml
proxmox:
hosts:
pve0[1:3]:
ntp_servers:
hosts:
sundial:
dns_server:
hosts:
monorail:
main-street-usa:
ansible_host: 10.1.71.11
ansible_user: wed
ansible_become: true
tomorrowland:
fantasyland:
magic_kingdom:
hosts:
@@ -17,47 +14,65 @@ magic_kingdom:
tomorrowland:
fantasyland:
prometheus_server:
dns_server:
hosts:
cinderella-castle:
monorail:
prometheus_nodes:
ntp_servers:
hosts:
cinderella-castle:
sundial:
load_balancers:
hosts:
lightning-lane:
ansible_host: 10.1.71.24
ansible_become: true
# node_explorer:
# hosts:
# cinderella-castle:
# alertmanager:
# hosts:
# cinderella-castle:
step_ca_server:
hosts:
turnstile:
ansible_become: true
# grafana:
# hosts:
# cinderella-castle:
authentik_server:
hosts:
guest-relations:
ansible_become: true
gitea_servers:
hosts:
mad-tea-party:
ansible_user: wed
ansible_become: true
nextcloud_server:
hosts:
the-grid:
ansible_become: true
semaphore_server:
hosts:
imagineering:
ansible_host: 10.1.71.37
ansible_become: true
n8n_server:
hosts:
tiki-room:
ollama_server:
hosts:
astro-orbiter:
ansible_host: 10.1.71.130
ansible_user: wed
ansible_become: true
papermc_server:
# ansible-galaxy role install engonzal.papermc
hosts:
arcade:
semaphore_server:
dev_servers:
hosts:
imagineering:
n8n_server:
hosts:
tiki-room:
traefik_server:
hosts:
lightning_lane:
scrim:
# dhcp_server:
# hosts:
@@ -67,13 +82,13 @@ backup_servers:
hosts:
timekeeper:
# freeipa:
# hosts:
# infra01:
# ipaserver:
# hosts:
# infra01.int.mk-labs.cloud:
talos_control:
hosts:
city-hall:
ansible_become: true
vars:
talosctl_version: "v1.12.4"
talos_cluster_name: "fastpass"
# matchbox_server:
# hosts:
@@ -82,51 +97,3 @@ backup_servers:
terraform_server:
hosts:
infra01:
# hub_cluster:
# hosts:
# ocp-hub:
# internal_cluster:
# hosts:
# int-master01:
# int-master02:
# int-master03:
# # int-worker01:
# int-worker02:
# talos_cluster:
# hosts:
# splash:
# fastpass_control_plane:
# hosts:
# space-mountain:
# big-thunder-mountain:
# splash-mountain:
# fastpass_workers:
# hosts:
# haunted-mansion: # backstage
# peter-pans-flight: # backstage
# fastpass:
# children:
# fastpass_control_plane:
# fastpass_workers:
# sql_servers:
# hosts:
# sql01:
# docker_servers:
# hosts:
# docker01:
# observer:
# hosts:
# prometheus:
# target:
# hosts:
# prometheus:

View File

@@ -0,0 +1,90 @@
---
# ------------------------------------------------------------------------------
# FILE: playbooks/add_service_route.yml
# DESCRIPTION: Ensures all services in the Traefik dynamic config directory
# are routed and have DNS CNAME records on monorail.
#
# 1. Syncs boilerplates/traefik/dynamic/ to lightning-lane
# 2. Scans the directory for service configs
# 3. Creates CNAME records for each service -> lightning-lane
#
# PREREQUISITES:
# - Service dynamic config YAML committed to boilerplates/traefik/dynamic/
# - vault_technitium_api_key defined in group_vars/all/vault
#
# USAGE:
# ansible-playbook -i inventory.yml playbooks/add_service_route.yml
#
# ADDING A NEW SERVICE:
# 1. Create boilerplates/traefik/dynamic/<service>.yml
# 2. Commit and push
# 3. Run this playbook
#
# EXCLUDING FILES:
# Files that are not service routes (e.g., default.yml for middleware
# definitions) should be added to the exclude_configs list below.
# ------------------------------------------------------------------------------
- name: Sync Traefik routes and ensure DNS records
hosts: localhost
connection: local
gather_facts: false
vars:
base_domain: "local.mk-labs.cloud"
dns_server: "monorail"
traefik_host: "10.1.71.35"
traefik_user: "wed"
traefik_dynamic_path: "/opt/docker/traefik/dynamic/"
dynamic_config_dir: "{{ playbook_dir }}/../../boilerplates/traefik/dynamic"
# Files in the dynamic directory that are NOT service routes
# (middleware definitions, TLS options, etc.)
exclude_configs:
- default.yml
tasks:
# ── Step 1: Sync dynamic config to lightning-lane ──
- name: Sync Traefik dynamic configuration to lightning-lane
ansible.builtin.shell: >
rsync -av --delete
{{ dynamic_config_dir }}/
{{ traefik_user }}@{{ traefik_host }}:{{ traefik_dynamic_path }}
register: sync_result
changed_when: "'sending incremental file list' in sync_result.stdout"
# ── Step 2: Discover service configs ──
- name: Find all dynamic config files
ansible.builtin.find:
paths: "{{ dynamic_config_dir }}"
patterns: "*.yml"
register: config_files
- name: Build service list from config filenames
ansible.builtin.set_fact:
service_names: >-
{{ config_files.files
| map(attribute='path')
| map('basename')
| reject('in', exclude_configs)
| map('regex_replace', '\.yml$', '')
| list }}
- name: Display services to route
ansible.builtin.debug:
msg: "Services found: {{ service_names }}"
# ── Step 3: Create DNS CNAME records ──
- name: Create DNS CNAME record for each service
effectivelywild.technitium_dns.technitium_dns_add_record:
api_url: "http://{{ dns_server }}.{{ base_domain }}"
api_token: "{{ vault_technitium_api_key }}"
zone: "{{ base_domain }}"
name: "{{ item }}.{{ base_domain }}"
type: "CNAME"
cname: "lightning-lane.{{ base_domain }}"
ttl: 360
validate_certs: false
loop: "{{ service_names }}"
loop_control:
label: "{{ item }}.{{ base_domain }}"

View File

@@ -1,218 +0,0 @@
---
- name: Configure DNS entries for cluster nodes
hosts: internal_cluster
gather_facts: false
become: true
tasks:
- name: Create DNS entry for each cluster node
ansible.builtin.include_tasks: tasks/create_dns_record.yml
vars:
host_ip_address: "{{ ip_address }}"
- name: Configure DNS entries for OpenShift cluster services
hosts: internal_cluster[0]
gather_facts: false
become: true
tasks:
- name: Create DNS entries for OpenShift cluster services
ansible.builtin.include_tasks: tasks/create_dns_record.yml
vars:
dns_name: "{{ item.name }}"
dns_address: "{{ item.address }}"
loop:
- name: "api.{{ cluster_name }}"
address: "{{ api_address }}"
- name: "api-int.{{ cluster_name }}"
address: "{{ api_address }}"
- name: "*.apps.{{ cluster_name }}"
address: "{{ app_address }}"
loop_control:
label: "{{ item.name }}"
- name: Configure DHCP entries for cluster nodes
hosts: internal_cluster
gather_facts: false
become: true
tasks:
- name: Configure DHCP entry for node
ansible.builtin.include_tasks: tasks/configure_dhcp_entry.yml
vars:
host_mac_address: "{{ install_mac_address }}"
host_ip_address: "{{ ip_address }}"
handlers:
- name: Restart dnsmasq
delegate_to: "{{ dhcp_server }}"
become: true
ansible.builtin.service:
name: dnsmasq
state: restarted
- name: Create OpenShift installer files
hosts: matchbox
gather_facts: true
vars:
cluster_group: "internal_cluster"
download_dir: "/var/cache/openshift-install"
tasks:
- name: Remove previous directory
ansible.builtin.file:
path: ~/homelab/terraform/{{ cluster_group }}
state: absent
- name: Create directory
ansible.builtin.file:
path: ~/homelab/terraform/{{ cluster_group }}
state: directory
mode: '0755'
- name: OpenShift Installer install-config.yaml
ansible.builtin.template:
src: templates/install-config.yaml.j2
dest: ~/homelab/terraform/{{ cluster_group }}/install-config.yaml
mode: '0644'
- name: OpenShift Installer agent-config.yaml
ansible.builtin.template:
src: templates/agent-config.yaml.j2
dest: ~/homelab/terraform/{{ cluster_group }}/agent-config.yaml
mode: '0644'
- name: Create directory for OpenShift Installer files
become: true
ansible.builtin.file:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}"
state: directory
mode: '0755'
owner: root
group: root
- name: Check if OpenShift installer file exists
ansible.builtin.stat:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}/{{ hostvars[groups[cluster_group][0]].openshift_installer_file }}"
register: openshift_installer_file
- name: Download and install OpenShift installer package
when: not openshift_installer_file.stat.exists
block:
- name: Download OpenShift Installer file
become: true
ansible.builtin.get_url:
url: "{{ hostvars[groups[cluster_group][0]].openshift_installer_download_url }}"
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
mode: '0644'
- name: Unarchive installer file
become: true
ansible.builtin.unarchive:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-install-linux.tar.gz
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
remote_src: true
- name: Copy install binary
become: true
ansible.builtin.copy:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-install
dest: /usr/local/bin
remote_src: true
owner: wed
group: wed
mode: '0755'
- name: Check if OpenShift client file exists
ansible.builtin.stat:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}/{{ hostvars[groups[cluster_group][0]].openshift_client_file }}"
register: openshift_client_file
- name: Download and install OpenShift client package
when: not openshift_client_file.stat.exists
block:
- name: Download OpenShift Client file
become: true
ansible.builtin.get_url:
url: "{{ hostvars[groups[cluster_group][0]].openshift_client_download_url }}"
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
mode: '0644'
- name: Unarchive client file
become: true
ansible.builtin.unarchive:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-client-linux.tar.gz
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
remote_src: true
- name: Copy client binary
become: true
ansible.builtin.copy:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/oc
dest: /usr/local/bin
remote_src: true
owner: wed
group: wed
mode: '0755'
- name: Check if OpenShift image exists
ansible.builtin.stat:
path: ~/homelab/terraform/{{ cluster_group }}/boot-artifacts/agent.x86_64-initrd.img
register: openshift_image_exists
- name: OpenShift image creation
ansible.builtin.command: /usr/local/bin/openshift-install agent create pxe-files
args:
chdir: ~/homelab/terraform/{{ cluster_group }}
when: not openshift_image_exists.stat.exists
changed_when: true
- name: Create a directory if it does not exist
become: true
ansible.builtin.file:
path: "{{ hostvars[groups['matchbox_server'][0]].assets }}/{{ hostvars[groups[cluster_group][0]].cluster_name }}"
state: directory
owner: matchbox
group: matchbox
mode: '0755'
- name: Copy file with owner and permissions
become: true
ansible.builtin.copy:
src: "{{ ansible_env['HOME'] }}/homelab/terraform/{{ cluster_group }}/boot-artifacts/"
dest: "{{ hostvars[groups['matchbox_server'][0]].assets }}/{{ hostvars[groups[cluster_group][0]].cluster_name }}/"
remote_src: true
owner: matchbox
group: matchbox
mode: '0644'
- name: Verify directory permissions
become: true
ansible.builtin.file:
path: "{{ hostvars[groups['matchbox_server'][0]].assets }}/{{ hostvars[groups[cluster_group][0]].cluster_name }}"
state: directory
owner: matchbox
group: matchbox
mode: '0755'
- name: Create Terraform matchbox groups file from template
ansible.builtin.template:
src: templates/groups.tf.j2
dest: ~/homelab/terraform/{{ cluster_group }}/groups.tf
mode: '0644'
- name: Create Terraform matchbox profiles file from template
ansible.builtin.template:
src: templates/profiles.tf.j2
dest: ~/homelab/terraform/{{ cluster_group }}/profiles.tf
mode: '0644'
- name: Create Terraform matchbox provider file from template
ansible.builtin.template:
src: templates/provider.tf.j2
dest: ~/homelab/terraform/{{ cluster_group }}/provider.tf
mode: '0644'
- name: Configure Matchbox via Terraform
community.general.terraform:
project_path: ~/homelab/terraform/{{ cluster_group }}
state: present
force_init: true

View File

@@ -1,221 +0,0 @@
---
- name: Configure DNS entries for cluster nodes
hosts: hub_cluster
gather_facts: false
become: true
tasks:
- name: Create DNS entry for each cluster node
ansible.builtin.include_tasks: tasks/create_dns_record.yml
vars:
host_ip_address: "{{ ip_address }}"
- name: Configure DNS entries for OpenShift cluster services
hosts: hub_cluster[0]
gather_facts: false
become: true
tasks:
- name: Create DNS entries for OpenShift cluster services
ansible.builtin.include_tasks: tasks/create_dns_record.yml
vars:
dns_name: "{{ item.name }}"
dns_address: "{{ item.address }}"
loop:
- name: "api.{{ cluster_name }}"
address: "{{ api_address }}"
- name: "api-int.{{ cluster_name }}"
address: "{{ api_address }}"
- name: "*.apps.{{ cluster_name }}"
address: "{{ app_address }}"
loop_control:
label: "{{ item.name }}"
- name: Configure DHCP entries for cluster nodes
hosts: hub_cluster
gather_facts: false
become: true
tasks:
- name: Configure DHCP entry for node
ansible.builtin.include_tasks: tasks/configure_dhcp_entry.yml
vars:
host_mac_address: "{{ install_mac_address }}"
host_ip_address: "{{ ip_address }}"
handlers:
- name: Restart dnsmasq
delegate_to: "{{ dhcp_server }}"
become: true
ansible.builtin.service:
name: dnsmasq
state: restarted
- name: Create OpenShift installer files
hosts: matchbox
gather_facts: true
vars:
cluster_group: "hub_cluster"
download_dir: "/var/cache/openshift-install"
tasks:
- name: Remove previous directory
ansible.builtin.file:
path: ~/homelab/terraform/{{ cluster_group }}
state: absent
- name: Create directory
ansible.builtin.file:
path: ~/homelab/terraform/{{ cluster_group }}
state: directory
mode: '0755'
- name: OpenShift Installer install-config.yaml
ansible.builtin.template:
src: templates/install-config.yaml.j2
dest: ~/homelab/terraform/{{ cluster_group }}/install-config.yaml
mode: '0644'
- name: OpenShift Installer agent-config.yaml
ansible.builtin.template:
src: templates/agent-config.yaml.j2
dest: ~/homelab/terraform/{{ cluster_group }}/agent-config.yaml
mode: '0644'
# - name: Quit
# ansible.builtin.meta: end_play
- name: Create directory for OpenShift Installer files
become: true
ansible.builtin.file:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}"
state: directory
mode: '0755'
owner: root
group: root
- name: Check if OpenShift installer file exists
ansible.builtin.stat:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}/{{ hostvars[groups[cluster_group][0]].openshift_installer_file }}"
register: openshift_installer_file
- name: Download and install OpenShift installer package
when: not openshift_installer_file.stat.exists
block:
- name: Download OpenShift Installer file
become: true
ansible.builtin.get_url:
url: "{{ hostvars[groups[cluster_group][0]].openshift_installer_download_url }}"
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
mode: '0644'
- name: Unarchive installer file
become: true
ansible.builtin.unarchive:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-install-linux.tar.gz
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
remote_src: true
- name: Copy install binary
become: true
ansible.builtin.copy:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-install
dest: /usr/local/bin
remote_src: true
owner: wed
group: wed
mode: '0755'
- name: Check if OpenShift client file exists
ansible.builtin.stat:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}/{{ hostvars[groups[cluster_group][0]].openshift_client_file }}"
register: openshift_client_file
- name: Download and install OpenShift client package
when: not openshift_client_file.stat.exists
block:
- name: Download OpenShift Client file
become: true
ansible.builtin.get_url:
url: "{{ hostvars[groups[cluster_group][0]].openshift_client_download_url }}"
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
mode: '0644'
- name: Unarchive client file
become: true
ansible.builtin.unarchive:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-client-linux.tar.gz
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
remote_src: true
- name: Copy client binary
become: true
ansible.builtin.copy:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/oc
dest: /usr/local/bin
remote_src: true
owner: wed
group: wed
mode: '0755'
- name: Check if OpenShift image exists
ansible.builtin.stat:
path: ~/homelab/terraform/{{ cluster_group }}/boot-artifacts/agent.x86_64-initrd.img
register: openshift_image_exists
- name: OpenShift image creation
ansible.builtin.command: /usr/local/bin/openshift-install agent create pxe-files
args:
chdir: ~/homelab/terraform/{{ cluster_group }}
when: not openshift_image_exists.stat.exists
changed_when: true
- name: Create a directory if it does not exist
become: true
ansible.builtin.file:
path: "{{ hostvars[groups['matchbox_server'][0]].assets }}/{{ hostvars[groups[cluster_group][0]].cluster_name }}"
state: directory
owner: matchbox
group: matchbox
mode: '0755'
- name: Copy file with owner and permissions
become: true
ansible.builtin.copy:
src: "{{ ansible_env['HOME'] }}/homelab/terraform/{{ cluster_group }}/boot-artifacts/"
dest: "{{ hostvars[groups['matchbox_server'][0]].assets }}/{{ hostvars[groups[cluster_group][0]].cluster_name }}/"
remote_src: true
owner: matchbox
group: matchbox
mode: '0644'
- name: Verify directory permissions
become: true
ansible.builtin.file:
path: "{{ hostvars[groups['matchbox_server'][0]].assets }}/{{ hostvars[groups[cluster_group][0]].cluster_name }}"
state: directory
owner: matchbox
group: matchbox
mode: '0755'
- name: Create Terraform matchbox groups file from template
ansible.builtin.template:
src: templates/groups.tf.j2
dest: ~/homelab/terraform/{{ cluster_group }}/groups.tf
mode: '0644'
- name: Create Terraform matchbox profiles file from template
ansible.builtin.template:
src: templates/profiles.tf.j2
dest: ~/homelab/terraform/{{ cluster_group }}/profiles.tf
mode: '0644'
- name: Create Terraform matchbox provider file from template
ansible.builtin.template:
src: templates/provider.tf.j2
dest: ~/homelab/terraform/{{ cluster_group }}/provider.tf
mode: '0644'
- name: Configure Matchbox via Terraform
community.general.terraform:
project_path: ~/homelab/terraform/{{ cluster_group }}
state: present
force_init: true

View File

@@ -1,218 +0,0 @@
---
- name: Configure DNS entries for cluster nodes
hosts: internal_cluster
gather_facts: false
become: true
tasks:
- name: Create DNS entry for each cluster node
ansible.builtin.include_tasks: tasks/create_dns_record.yml
vars:
host_ip_address: "{{ ip_address }}"
- name: Configure DNS entries for OpenShift cluster services
hosts: internal_cluster[0]
gather_facts: false
become: true
tasks:
- name: Create DNS entries for OpenShift cluster services
ansible.builtin.include_tasks: tasks/create_dns_record.yml
vars:
dns_name: "{{ item.name }}"
dns_address: "{{ item.address }}"
loop:
- name: "api.{{ cluster_name }}"
address: "{{ api_address }}"
- name: "api-int.{{ cluster_name }}"
address: "{{ api_address }}"
- name: "*.apps.{{ cluster_name }}"
address: "{{ app_address }}"
loop_control:
label: "{{ item.name }}"
- name: Configure DHCP entries for cluster nodes
hosts: internal_cluster
gather_facts: false
become: true
tasks:
- name: Configure DHCP entry for node
ansible.builtin.include_tasks: tasks/configure_dhcp_entry.yml
vars:
host_mac_address: "{{ install_mac_address }}"
host_ip_address: "{{ ip_address }}"
handlers:
- name: Restart dnsmasq
delegate_to: "{{ dhcp_server }}"
become: true
ansible.builtin.service:
name: dnsmasq
state: restarted
- name: Create OpenShift installer files
hosts: matchbox
gather_facts: true
vars:
cluster_group: "internal_cluster"
download_dir: "/var/cache/openshift-install"
tasks:
- name: Remove previous directory
ansible.builtin.file:
path: ~/homelab/terraform/{{ cluster_group }}
state: absent
- name: Create directory
ansible.builtin.file:
path: ~/homelab/terraform/{{ cluster_group }}
state: directory
mode: '0755'
- name: OpenShift Installer install-config.yaml
ansible.builtin.template:
src: templates/install-config.yaml.j2
dest: ~/homelab/terraform/{{ cluster_group }}/install-config.yaml
mode: '0644'
- name: OpenShift Installer agent-config.yaml
ansible.builtin.template:
src: templates/agent-config.yaml.j2
dest: ~/homelab/terraform/{{ cluster_group }}/agent-config.yaml
mode: '0644'
- name: Create directory for OpenShift Installer files
become: true
ansible.builtin.file:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}"
state: directory
mode: '0755'
owner: root
group: root
- name: Check if OpenShift installer file exists
ansible.builtin.stat:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}/{{ hostvars[groups[cluster_group][0]].openshift_installer_file }}"
register: openshift_installer_file
- name: Download and install OpenShift installer package
when: not openshift_installer_file.stat.exists
block:
- name: Download OpenShift Installer file
become: true
ansible.builtin.get_url:
url: "{{ hostvars[groups[cluster_group][0]].openshift_installer_download_url }}"
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
mode: '0644'
- name: Unarchive installer file
become: true
ansible.builtin.unarchive:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-install-linux.tar.gz
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
remote_src: true
- name: Copy install binary
become: true
ansible.builtin.copy:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-install
dest: /usr/local/bin
remote_src: true
owner: wed
group: wed
mode: '0755'
- name: Check if OpenShift client file exists
ansible.builtin.stat:
path: "{{ download_dir }}/{{ hostvars[groups[cluster_group][0]].cluster_version }}/{{ hostvars[groups[cluster_group][0]].openshift_client_file }}"
register: openshift_client_file
- name: Download and install OpenShift client package
when: not openshift_client_file.stat.exists
block:
- name: Download OpenShift Client file
become: true
ansible.builtin.get_url:
url: "{{ hostvars[groups[cluster_group][0]].openshift_client_download_url }}"
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
mode: '0644'
- name: Unarchive client file
become: true
ansible.builtin.unarchive:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/openshift-client-linux.tar.gz
dest: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}
remote_src: true
- name: Copy client binary
become: true
ansible.builtin.copy:
src: /var/cache/openshift-install/{{ hostvars[groups[cluster_group][0]].cluster_version }}/oc
dest: /usr/local/bin
remote_src: true
owner: wed
group: wed
mode: '0755'
- name: Check if OpenShift image exists
ansible.builtin.stat:
path: ~/homelab/terraform/{{ cluster_group }}/boot-artifacts/agent.x86_64-initrd.img
register: openshift_image_exists
- name: OpenShift image creation
ansible.builtin.command: /usr/local/bin/openshift-install agent create pxe-files
args:
chdir: ~/homelab/terraform/{{ cluster_group }}
when: not openshift_image_exists.stat.exists
changed_when: true
- name: Create a directory if it does not exist
become: true
ansible.builtin.file:
path: "{{ hostvars[groups['matchbox_server'][0]].assets }}/{{ hostvars[groups[cluster_group][0]].cluster_name }}"
state: directory
owner: matchbox
group: matchbox
mode: '0755'
- name: Copy file with owner and permissions
become: true
ansible.builtin.copy:
src: "{{ ansible_env['HOME'] }}/homelab/terraform/{{ cluster_group }}/boot-artifacts/"
dest: "{{ hostvars[groups['matchbox_server'][0]].assets }}/{{ hostvars[groups[cluster_group][0]].cluster_name }}/"
remote_src: true
owner: matchbox
group: matchbox
mode: '0644'
- name: Verify directory permissions
become: true
ansible.builtin.file:
path: "{{ hostvars[groups['matchbox_server'][0]].assets }}/{{ hostvars[groups[cluster_group][0]].cluster_name }}"
state: directory
owner: matchbox
group: matchbox
mode: '0755'
- name: Create Terraform matchbox groups file from template
ansible.builtin.template:
src: templates/groups.tf.j2
dest: ~/homelab/terraform/{{ cluster_group }}/groups.tf
mode: '0644'
- name: Create Terraform matchbox profiles file from template
ansible.builtin.template:
src: templates/profiles.tf.j2
dest: ~/homelab/terraform/{{ cluster_group }}/profiles.tf
mode: '0644'
- name: Create Terraform matchbox provider file from template
ansible.builtin.template:
src: templates/provider.tf.j2
dest: ~/homelab/terraform/{{ cluster_group }}/provider.tf
mode: '0644'
- name: Configure Matchbox via Terraform
community.general.terraform:
project_path: ~/homelab/terraform/{{ cluster_group }}
state: present
force_init: true

View File

@@ -0,0 +1,20 @@
---
# ansible/playbooks/configure_proxmox_oidc.yml
#
# Configures Proxmox OIDC authentication with Authentik.
# Only targets one node since realm config is cluster-wide.
#
# Usage:
# cd ansible
# ansible-playbook -i inventory.yml playbooks/configure_proxmox_oidc.yml
#
# To also set up ACL entries for your user:
# ansible-playbook -i inventory.yml playbooks/configure_proxmox_oidc.yml \
# -e '{"proxmox_oidc_acl_entries": [{"path": "/", "user": "rblundon@authentik", "role": "Administrator"}]}'
- name: Configure Proxmox Authentik OIDC
hosts: main-street-usa
become: true
roles:
- role: proxmox
tags: [proxmox-oidc]

View File

@@ -0,0 +1,6 @@
---
- name: Apply common role
hosts: "{{ target | default('all') }}"
become: true
roles:
- common

View File

@@ -0,0 +1,400 @@
---
# ansible/playbooks/day1_configure_netbox_catalog.yml
#
# Creates the tag taxonomy and custom fields in NetBox for service catalog
# documentation. Run once (idempotent — uses name-based checks).
#
# Usage (from ansible/ directory):
# ansible-playbook playbooks/day1_configure_netbox_catalog.yml
#
# Requires:
# - vault_netbox_token in Ansible Vault
# - netbox reachable at http://fire-station.local.mk-labs.cloud
- name: Configure NetBox service catalog taxonomy
hosts: localhost
gather_facts: false
vars_files:
- "{{ playbook_dir }}/../group_vars/all/vault"
vars:
netbox_url: "http://fire-station.local.mk-labs.cloud"
netbox_token: "{{ vault_netbox_token }}"
netbox_api: "{{ netbox_url }}/api"
headers:
Authorization: "Token {{ netbox_token }}"
Content-Type: "application/json"
Accept: "application/json"
# ── Tag definitions ───────────────────────────────────────────────────
tags:
# Infrastructure type
- name: k8s
slug: k8s
color: "2196f3" # blue
description: "Workload running in the fastpass Kubernetes cluster"
- name: vm
slug: vm
color: "4caf50" # green
description: "Traditional VM or LXC on Proxmox"
# Service tier
- name: platform
slug: platform
color: "9c27b0" # purple
description: "Platform/infrastructure service (not user-facing)"
- name: application
slug: application
color: "ff9800" # orange
description: "User-facing application workload"
# Service categories
- name: monitoring
slug: monitoring
color: "607d8b" # grey
description: "Metrics, logging, alerting"
- name: auth
slug: auth
color: "607d8b"
description: "Authentication and SSO"
- name: gitops
slug: gitops
color: "607d8b"
description: "GitOps and CI/CD"
- name: dashboard
slug: dashboard
color: "607d8b"
description: "Dashboard and portal services"
- name: storage
slug: storage
color: "607d8b"
description: "Storage and file services"
- name: dns
slug: dns
color: "607d8b"
description: "DNS and name resolution"
- name: automation
slug: automation
color: "607d8b"
description: "Automation and orchestration"
- name: networking
slug: networking
color: "607d8b"
description: "Network infrastructure services"
- name: inference
slug: inference
color: "607d8b"
description: "AI/ML inference workloads"
# ── Custom field definitions ──────────────────────────────────────────
# object_types use app_label.model format
custom_fields:
- name: hostnames
label: Hostnames
type: longtext
object_types:
- ipam.ipaddress
- virtualization.virtualmachine
description: "All DNS names that resolve to this service (comma-separated)"
ui_visible: always
ui_editable: yes
- name: namespace
label: Namespace
type: text
object_types:
- ipam.ipaddress
- virtualization.virtualmachine
description: "Kubernetes namespace (blank for VM-based services)"
ui_visible: always
ui_editable: yes
- name: managed_by
label: Managed By
type: select
object_types:
- ipam.ipaddress
- virtualization.virtualmachine
description: "How this service is managed"
choices:
- ArgoCD
- Ansible
- Manual
ui_visible: always
ui_editable: yes
- name: thematic_name
label: Thematic Name
type: text
object_types:
- ipam.ipaddress
- virtualization.virtualmachine
description: "Disney/Magic Kingdom thematic hostname for this service"
ui_visible: always
ui_editable: yes
tasks:
# ── Tags ─────────────────────────────────────────────────────────────
- name: Fetch existing tags
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/tags/?limit=200"
method: GET
headers: "{{ headers }}"
return_content: true
status_code: 200
register: existing_tags_response
- name: Set existing tag slugs fact
ansible.builtin.set_fact:
existing_tag_slugs: "{{ existing_tags_response.json.results | map(attribute='slug') | list }}"
- name: Create tags
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/tags/"
method: POST
headers: "{{ headers }}"
body_format: json
body:
name: "{{ item.name }}"
slug: "{{ item.slug }}"
color: "{{ item.color }}"
description: "{{ item.description }}"
status_code: 201
loop: "{{ tags }}"
when: item.slug not in existing_tag_slugs
register: tag_creation
changed_when: tag_creation.status == 201
# ── Custom Fields ─────────────────────────────────────────────────────
- name: Fetch existing custom fields
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-fields/?limit=200"
method: GET
headers: "{{ headers }}"
return_content: true
status_code: 200
register: existing_cf_response
- name: Set existing custom field names fact
ansible.builtin.set_fact:
existing_cf_names: "{{ existing_cf_response.json.results | map(attribute='name') | list }}"
- name: Create custom field — hostnames
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-fields/"
method: POST
headers: "{{ headers }}"
body_format: json
body:
name: hostnames
label: Hostnames
type: longtext
object_types: "{{ custom_fields[0].object_types }}"
description: "{{ custom_fields[0].description }}"
ui_visible: always
ui_editable: yes
status_code: 201
when: "'hostnames' not in existing_cf_names"
register: cf_hostnames
changed_when: cf_hostnames.status == 201
- name: Create custom field — namespace
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-fields/"
method: POST
headers: "{{ headers }}"
body_format: json
body:
name: namespace
label: Namespace
type: text
object_types: "{{ custom_fields[1].object_types }}"
description: "{{ custom_fields[1].description }}"
ui_visible: always
ui_editable: yes
status_code: 201
when: "'namespace' not in existing_cf_names"
register: cf_namespace
changed_when: cf_namespace.status == 201
- name: Create choice set for managed_by field
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-field-choice-sets/"
method: POST
headers: "{{ headers }}"
body_format: json
body:
name: managed-by-choices
extra_choices:
- - ArgoCD
- ArgoCD
- - Ansible
- Ansible
- - Manual
- Manual
status_code: [201, 400]
register: choice_set
changed_when: choice_set.status == 201
- name: Fetch choice set ID
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-field-choice-sets/?name=managed-by-choices"
method: GET
headers: "{{ headers }}"
return_content: true
status_code: 200
register: choice_set_response
- name: Create custom field — managed_by
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-fields/"
method: POST
headers: "{{ headers }}"
body_format: json
body:
name: managed_by
label: Managed By
type: select
object_types: "{{ custom_fields[2].object_types }}"
description: "{{ custom_fields[2].description }}"
choice_set: "{{ choice_set_response.json.results[0].id }}"
ui_visible: always
ui_editable: yes
status_code: 201
when: "'managed_by' not in existing_cf_names"
register: cf_managed_by
changed_when: cf_managed_by.status == 201
- name: Create custom field — thematic_name
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-fields/"
method: POST
headers: "{{ headers }}"
body_format: json
body:
name: thematic_name
label: Thematic Name
type: text
object_types: "{{ custom_fields[3].object_types }}"
description: "{{ custom_fields[3].description }}"
ui_visible: always
ui_editable: yes
status_code: 201
when: "'thematic_name' not in existing_cf_names"
register: cf_thematic_name
changed_when: cf_thematic_name.status == 201
# ── Provisioning Pipeline Fields ──────────────────────────────────────
# These fields drive the NetBox → n8n → Terraform pipeline.
# proxmox_datastore already exists — PATCH it to add utilidor choice.
# data_disk_enabled and data_disk_size_gb are new POSTs.
- name: Fetch proxmox_datastore field ID
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-fields/?name=proxmox_datastore"
method: GET
headers: "{{ headers }}"
return_content: true
status_code: 200
register: proxmox_datastore_cf_response
- name: Fetch proxmox-datastore-choices choice set ID
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-field-choice-sets/?name=proxmox-datastore-choices"
method: GET
headers: "{{ headers }}"
return_content: true
status_code: 200
register: datastore_choice_set_response
- name: Create proxmox-datastore-choices choice set if missing
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-field-choice-sets/"
method: POST
headers: "{{ headers }}"
body_format: json
body:
name: proxmox-datastore-choices
extra_choices:
- - liberty-tree
- liberty-tree
- - utilidor
- utilidor
status_code: [201, 400]
register: datastore_choice_set_create
changed_when: datastore_choice_set_create.status == 201
when: datastore_choice_set_response.json.count == 0
- name: Re-fetch proxmox-datastore-choices choice set ID after possible creation
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-field-choice-sets/?name=proxmox-datastore-choices"
method: GET
headers: "{{ headers }}"
return_content: true
status_code: 200
register: datastore_choice_set_response
- name: Patch proxmox_datastore field to use choice set with utilidor
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-fields/{{ proxmox_datastore_cf_response.json.results[0].id }}/"
method: PATCH
headers: "{{ headers }}"
body_format: json
body:
choice_set: "{{ datastore_choice_set_response.json.results[0].id }}"
status_code: 200
when: proxmox_datastore_cf_response.json.count > 0
register: cf_datastore_patch
changed_when: cf_datastore_patch.status == 200
- name: Create custom field — data_disk_enabled
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-fields/"
method: POST
headers: "{{ headers }}"
body_format: json
body:
name: data_disk_enabled
label: Data Disk Enabled
type: boolean
object_types:
- virtualization.virtualmachine
description: "When true, Terraform provisions a second disk for application data storage."
default: false
ui_visible: always
ui_editable: yes
status_code: 201
when: "'data_disk_enabled' not in existing_cf_names"
register: cf_data_disk_enabled
changed_when: cf_data_disk_enabled.status == 201
- name: Create custom field — data_disk_size_gb
ansible.builtin.uri:
url: "{{ netbox_api }}/extras/custom-fields/"
method: POST
headers: "{{ headers }}"
body_format: json
body:
name: data_disk_size_gb
label: Data Disk Size (GB)
type: integer
object_types:
- virtualization.virtualmachine
description: "Size in GB for the optional second data disk. Only used when data_disk_enabled is true."
ui_visible: always
ui_editable: yes
status_code: 201
when: "'data_disk_size_gb' not in existing_cf_names"
register: cf_data_disk_size
changed_when: cf_data_disk_size.status == 201
# ── Summary ───────────────────────────────────────────────────────────
- name: Summary
ansible.builtin.debug:
msg:
- "Tags created: {{ tag_creation.results | selectattr('status', 'equalto', 201) | list | length }}"
- "Tags skipped (already exist): {{ tag_creation.results | selectattr('skipped', 'defined') | list | length }}"
- "Custom fields configured: hostnames, namespace, managed_by, thematic_name, proxmox_datastore (patched), data_disk_enabled, data_disk_size_gb"

View File

@@ -0,0 +1,18 @@
---
# ------------------------------------------------------------------------------
# FILE: playbooks/deploy_authentik.yml
# DESCRIPTION: Deploys Authentik identity provider on guest-relations.
# Installs Docker and configures Authentik with PostgreSQL and Redis.
#
# USAGE:
# ansible-playbook -i inventory.yml playbooks/deploy_authentik.yml
# ------------------------------------------------------------------------------
- name: Deploy Authentik identity provider
hosts: authentik_server
become: true
roles:
- common
- docker-host
- authentik

View File

@@ -0,0 +1,23 @@
---
# ------------------------------------------------------------------------------
# FILE: ansible/playbooks/day1_deploy_gitea.yml
# DESCRIPTION: Deploys Gitea + PostgreSQL on mad-tea-party (10.1.71.129)
# Role chain: common → docker-host → gitea
#
# USAGE:
# ansible-playbook -i ansible/inventory.yml ansible/playbooks/day1_deploy_gitea.yml
#
# SECRETS REQUIRED IN VAULT (group_vars/all/vault):
# vault_gitea_db_password
# ------------------------------------------------------------------------------
- name: Deploy Gitea on mad-tea-party
hosts: gitea_servers
become: true
vars:
gitea_db_password: "{{ vault_gitea_db_password }}"
roles:
- role: docker-host
- role: gitea

View File

@@ -0,0 +1,91 @@
---
# ------------------------------------------------------------------------------
# FILE: playbooks/day1_deploy_nextcloud.yml
# DESCRIPTION: Deploys Nextcloud on the-grid
# Runs: docker-host → nextcloud
#
# USAGE:
# ansible-playbook -i inventory.yml playbooks/day1_deploy_nextcloud.yml
# ansible-playbook -i inventory.yml playbooks/day1_deploy_nextcloud.yml --limit the-grid
#
# SECRETS REQUIRED IN VAULT (group_vars/all/vault):
# vault_nextcloud_db_root_password
# vault_nextcloud_db_password
# vault_nextcloud_admin_user
# vault_nextcloud_admin_password
# ------------------------------------------------------------------------------
- name: Deploy Nextcloud on the-grid
hosts: the-grid
become: true
vars:
# NFS prerequisite
nfs_packages:
- nfs-common
# Compose stack location
nextcloud_base_dir: /opt/docker/nextcloud
# Secrets from vault
nextcloud_db_root_password: "{{ vault_nextcloud_db_root_password }}"
nextcloud_db_password: "{{ vault_nextcloud_db_password }}"
nextcloud_admin_user: "{{ vault_nextcloud_admin_user }}"
nextcloud_admin_password: "{{ vault_nextcloud_admin_password }}"
pre_tasks:
- name: Install NFS client
ansible.builtin.apt:
name: "{{ nfs_packages }}"
state: present
update_cache: true
roles:
- role: docker-host
tasks:
- name: Create Nextcloud directory
ansible.builtin.file:
path: "{{ nextcloud_base_dir }}"
state: directory
owner: "{{ ansible_user }}"
group: docker
mode: "0775"
- name: Deploy Compose file
ansible.builtin.copy:
src: "{{ playbook_dir }}/../../boilerplates/nextcloud/compose.yml"
dest: "{{ nextcloud_base_dir }}/compose.yml"
owner: "{{ ansible_user }}"
group: docker
mode: "0644"
- name: Deploy .env from vault
ansible.builtin.copy:
content: |
# Managed by Ansible — do not edit manually
MYSQL_ROOT_PASSWORD={{ nextcloud_db_root_password }}
MYSQL_PASSWORD={{ nextcloud_db_password }}
NEXTCLOUD_ADMIN_USER={{ nextcloud_admin_user }}
NEXTCLOUD_ADMIN_PASSWORD={{ nextcloud_admin_password }}
dest: "{{ nextcloud_base_dir }}/.env"
owner: "{{ ansible_user }}"
group: docker
mode: "0600"
- name: Start Nextcloud stack
community.docker.docker_compose_v2:
project_src: "{{ nextcloud_base_dir }}"
state: present
- name: Wait for Nextcloud to become ready
ansible.builtin.uri:
url: "http://the-grid.local.mk-labs.cloud/status.php"
status_code: 200
return_content: true
register: nextcloud_status
until: >
nextcloud_status.status == 200 and
(nextcloud_status.content | from_json).installed == true
retries: 20
delay: 15

View File

@@ -0,0 +1,35 @@
---
# ------------------------------------------------------------------------------
# FILE: ansible/playbooks/day1_deploy_ollama.yml
# DESCRIPTION: Deploys Ollama with ROCm GPU acceleration on astro-orbiter.
# Assumes day0_baseline.yml has already run (common role complete).
# PCIe passthrough for the RX 5700 must be configured in Proxmox
# and the GPU must be visible to the VM before running this playbook.
#
# Pre-flight check:
# ssh wed@astro-orbiter 'lspci | grep -i amd'
# Should show the RX 5700 before proceeding.
#
# Usage (from ansible/ directory):
# ansible-playbook playbooks/day1_deploy_ollama.yml
# ------------------------------------------------------------------------------
- name: Deploy Ollama with ROCm on astro-orbiter
hosts: astro-orbiter
become: true
pre_tasks:
- name: Verify AMD GPU is visible to the VM
command: lspci
register: lspci_output
changed_when: false
- name: Fail if no AMD GPU detected
fail:
msg: >
No AMD GPU detected via lspci. Verify PCIe passthrough is configured
in Proxmox and the RX 5700 is visible to the VM before proceeding.
when: "'AMD' not in lspci_output.stdout and 'Radeon' not in lspci_output.stdout"
roles:
- ollama

View File

@@ -0,0 +1,22 @@
---
# ------------------------------------------------------------------------------
# FILE: playbooks/day1_deploy_semaphore.yml
# DESCRIPTION: Deploys Semaphore on imagineering
# Runs: common → docker-host → semaphore
#
# USAGE:
# ansible-playbook -i inventory.yml playbooks/day1_deploy_semaphore.yml
#
# SECRETS REQUIRED IN VAULT (group_vars/all/vault):
# vault_semaphore_database_password
# vault_semaphore_admin_password
# vault_semaphore_access_key_encryption
# ------------------------------------------------------------------------------
- name: Deploy Semaphore
hosts: semaphore_server
become: true
roles:
- docker-host
- semaphore

View File

@@ -0,0 +1,18 @@
---
# ------------------------------------------------------------------------------
# FILE: playbooks/deploy_traefik.yml
# DESCRIPTION: Deploys Traefik reverse proxy on lightning-lane.
# Installs Docker and configures Traefik with Cloudflare DNS-01
# certificate resolution for *.local.mk-labs.cloud
#
# USAGE:
# ansible-playbook -i inventory.yml playbooks/deploy_traefik.yml
# ------------------------------------------------------------------------------
- name: Deploy Traefik reverse proxy
hosts: load_balancers
become: true
roles:
- docker-host
- traefik

View File

@@ -0,0 +1,7 @@
---
- name: Apply common role
hosts: "{{ target | default('all') }}"
become: true
roles:
- common
- docker-host

View File

@@ -0,0 +1,80 @@
---
# ------------------------------------------------------------------------------
# FILE: ansible/playbooks/day2_install_node_exporter.yml
# DESCRIPTION: Install and configure Prometheus Node Exporter on Linux hosts.
#
# Targets two groups with different firewall managers:
# - proxmox_nodes : Proxmox hypervisors (Debian, firewalld not present,
# uses iptables/no firewall — just open the port via UFW
# if present, otherwise skip)
# - monitored_vms : Ubuntu VMs managed by UFW
#
# After installing on new hosts, re-runs day1_deploy_monitoring.yml to refresh
# the Prometheus scrape config is NOT needed — targets are already statically
# defined in prometheus.yaml.j2 for the Proxmox nodes. For new VMs, add the
# IP to the prometheus.yaml.j2 proxmox-vms job and re-run day1_deploy_monitoring.yml.
#
# Usage:
# ansible-playbook -i inventory.yml playbooks/day2_install_node_exporter.yml
# ansible-playbook -i inventory.yml playbooks/day2_install_node_exporter.yml --limit proxmox_nodes
# ansible-playbook -i inventory.yml playbooks/day2_install_node_exporter.yml --limit monitored_vms
# ------------------------------------------------------------------------------
# ── Play 1: Proxmox hypervisors ───────────────────────────────────────────────
# Proxmox runs Debian. The prometheus.prometheus.node_exporter role installs
# a binary + systemd service without touching apt, which is what we want on
# hypervisors (keep the package footprint clean).
# Note: Proxmox does not run UFW. Port 9100 is open by default on VLAN 71.
- name: Install Node Exporter on Proxmox hypervisors
hosts: proxmox_nodes
become: true
vars:
node_exporter_version: "1.9.1"
node_exporter_web_listen_address: "0.0.0.0:9100"
node_exporter_enabled_collectors:
- systemd
- processes
- filesystem
- meminfo
- cpu
- diskstats
- netdev
- loadavg
- uname
roles:
- role: prometheus.prometheus.node_exporter
# ── Play 2: Ubuntu VMs ────────────────────────────────────────────────────────
# Standard Ubuntu hosts with UFW. Same role, adds UFW allow rule for 9100.
- name: Install Node Exporter on monitored VMs
hosts: monitored_vms
become: true
vars:
node_exporter_version: "1.9.1"
node_exporter_web_listen_address: "0.0.0.0:9100"
node_exporter_enabled_collectors:
- systemd
- processes
- filesystem
- meminfo
- cpu
- diskstats
- netdev
- loadavg
- uname
pre_tasks:
- name: Open Node Exporter port in UFW
community.general.ufw:
rule: allow
port: "9100"
proto: tcp
comment: "Prometheus Node Exporter"
roles:
- role: prometheus.prometheus.node_exporter

View File

@@ -1,30 +0,0 @@
---
# - name: Step 1 - Install Prerequisites
# hosts: fastpass
# become: true
# gather_facts: true
# roles:
# - role: kubernetes-prerequisites
# - name: Step 2 - Deploy First Control Plane Node
# hosts: fastpass_control_plane[0]
# become: true
# gather_facts: false
# roles:
# - role: fastpass-first-control-plane
- name: Step 3 - Deploy Additional Control Plane Nodes
hosts: fastpass_control_plane[1:]
become: true
gather_facts: true # false
roles:
- role: fastpass-additional-control-plane
vars:
cluster_name: "fastpass"
# - name: Step 4 - Deploy Worker Nodes
# hosts: fastpass_workers
# become: true
# gather_facts: false
# roles:
# - role: fastpass-workers

View File

@@ -1,157 +0,0 @@
---
# FastPass Kubernetes Cluster Deployment
# This playbook deploys a complete Kubernetes cluster on Fedora
- name: 1. Preflight checks and system preparation
hosts: fastpass
become: true
gather_facts: true
roles:
- role: kubernetes
- name: 2. Initialize first control plane node
hosts: fastpass_control_plane[0]
become: true
gather_facts: false
roles:
- role: fastpass-control-plane
- name: 3. Install Calico CNI
hosts: fastpass_control_plane[0]
become: false
gather_facts: false
environment:
KUBECONFIG: "{{ kubeconfig_path }}"
tasks:
- name: Check if Calico is already installed
ansible.builtin.shell: kubectl get pods -n kube-system -l k8s-app=calico-node --no-headers | wc -l
delegate_to: localhost
register: calico_check
ignore_errors: true
- name: Display Calico check result
ansible.builtin.debug:
msg: "Calico pods found: {{ calico_check.stdout | trim }}"
delegate_to: localhost
- name: Install Calico CNI
ansible.builtin.command: kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/{{ calico_version | default('v3.28.0') }}/manifests/calico.yaml
delegate_to: localhost
when: calico_check.stdout | trim == "0"
register: calico_install_result
ignore_errors: true
- name: Display Calico installation result
ansible.builtin.debug:
msg: "Calico install stdout: {{ calico_install_result.stdout }}"
delegate_to: localhost
when: calico_check.stdout | trim == "0"
- name: Wait for Calico node pods to be ready
ansible.builtin.command: kubectl wait --for=condition=ready pod -l k8s-app=calico-node -n kube-system --timeout=300s
delegate_to: localhost
when: calico_check.stdout | trim == "0"
- name: 4. Wait for first control plane to be fully ready
hosts: fastpass_control_plane[0]
become: false
gather_facts: false
environment:
KUBECONFIG: "{{ kubeconfig_path }}"
tasks:
- name: Wait for API server to be ready on first node
ansible.builtin.wait_for:
host: "{{ inventory_hostname }}"
port: "{{ control_plane_port | default('6443') }}"
timeout: 300
delegate_to: localhost
- name: Wait for first control plane node to be ready
ansible.builtin.command: kubectl --kubeconfig={{ kubeconfig_path }} wait --for=condition=ready node {{ inventory_hostname }} --timeout=300s
delegate_to: localhost
- name: Verify control plane status
ansible.builtin.command: kubectl --kubeconfig={{ kubeconfig_path }} get nodes -o wide
delegate_to: localhost
register: node_status
- name: Display cluster status
ansible.builtin.debug:
msg: "{{ node_status.stdout_lines }}"
- name: 5. Join additional control plane nodes
hosts: fastpass_control_plane[1:]
become: true
gather_facts: false
roles:
- role: fastpass-control-plane-join
- name: 6. Wait for all control plane nodes to be ready
hosts: fastpass_control_plane[0]
become: false
gather_facts: false
environment:
KUBECONFIG: "{{ kubeconfig_path }}"
tasks:
- name: Wait for all control plane nodes to be ready
ansible.builtin.command: kubectl --kubeconfig={{ kubeconfig_path }} wait --for=condition=ready node --selector=node-role.kubernetes.io/control-plane --timeout=600s
delegate_to: localhost
- name: Display all control plane nodes
ansible.builtin.command: kubectl --kubeconfig={{ kubeconfig_path }} get nodes --selector=node-role.kubernetes.io/control-plane -o wide
delegate_to: localhost
register: control_plane_status
- name: Show control plane status
ansible.builtin.debug:
msg: "{{ control_plane_status.stdout_lines }}"
- name: 7. Join worker nodes
hosts: fastpass_workers
become: true
gather_facts: false
roles:
- role: fastpass-workers
- name: 8. Final cluster validation
hosts: fastpass_control_plane[0]
become: false
gather_facts: false
environment:
KUBECONFIG: "{{ kubeconfig_path }}"
tasks:
- name: Wait for all nodes to be ready
ansible.builtin.command: kubectl --kubeconfig={{ kubeconfig_path }} wait --for=condition=ready node --all --timeout=300s
delegate_to: localhost
- name: Verify all pods are running
ansible.builtin.command: kubectl --kubeconfig={{ kubeconfig_path }} get pods --all-namespaces
delegate_to: localhost
register: pod_status
- name: Display final cluster status
ansible.builtin.debug:
msg: |
========================================
FastPass Kubernetes Cluster Status
========================================
{{ pod_status.stdout }}
========================================
- name: Show final node status
ansible.builtin.command: kubectl --kubeconfig={{ kubeconfig_path }} get nodes -o wide
delegate_to: localhost
register: final_node_status
- name: Display final node status
ansible.builtin.debug:
msg: "{{ final_node_status.stdout_lines }}"
- name: Test DNS-based control plane endpoint
ansible.builtin.command: kubectl --kubeconfig={{ kubeconfig_path }} cluster-info
delegate_to: localhost
register: cluster_info
- name: Display cluster info
ansible.builtin.debug:
msg: "{{ cluster_info.stdout_lines }}"

View File

@@ -1,177 +0,0 @@
---
# ansible/playbooks/deploy-haproxy-cloudflare.yml
- name: Deploy HAProxy with Cloudflare DNS certificates
hosts: lightning-lane
become: true
vars:
# Certbot Cloudflare configuration
haproxy_certbot_enable: true
haproxy_certbot_challenge_method: "dns-cloudflare"
haproxy_certbot_email: "ryan@mk-labs.cloud"
haproxy_certbot_staging: false # Set to true for testing
haproxy_certbot_cloudflare_api_token: "{{ vault_cloudflare_api_token }}"
# Request wildcard certificate
haproxy_certbot_domains:
- domain: "*.local.mk-labs.cloud"
include_base: true # Also include local.mk-labs.cloud
# HAProxy Stats
haproxy_stats_password: "{{ vault_haproxy_stats_password }}"
# Frontend configuration
haproxy_frontends:
- name: https_front
bind: "*:443 ssl crt {{ haproxy_ssl_cert_dir }}/live crt {{ haproxy_ssl_default_crt }} alpn h2,http/1.1"
mode: http
options:
- "http-server-close"
- "forwardfor"
acls:
- "netbox hdr(host) -i fire-station.local.mk-labs.cloud"
- "wordpress hdr(host) -i be-our-guest.local.mk-labs.cloud"
- "plane hdr(host) -i people-mover.local.mk-labs.cloud"
- "minecraft hdr(host) -i arcade.local.mk-labs.cloud"
use_backends:
- "netbox_back if netbox"
- "wordpress_back if wordpress"
- "plane_back if plane"
- "minecraft_back if minecraft"
# Backend configuration
haproxy_backends:
- name: netbox_back
mode: http
balance: roundrobin
options:
- "httpchk GET /api/"
servers:
- name: fire-station
address: 10.1.71.102:8000
check: true
- name: wordpress_back
mode: http
balance: roundrobin
servers:
- name: be-our-guest
address: 10.1.71.101:80
check: true
- name: plane_back
mode: http
balance: roundrobin
servers:
- name: people-mover
address: 10.1.71.112:8080
check: true
- name: minecraft_back
mode: http
balance: roundrobin
servers:
- name: arcade
address: 10.1.71.111:25565
check: true
# TCP services
haproxy_tcp_services:
- name: postgres
frontend_port: 5432
backend_port: 5432
balance: leastconn
timeout_client: 1h
timeout_server: 1h
servers:
- name: netbox-db
address: 10.1.71.102
check: true
- name: ssh_jump
frontend_port: 2222
backend_port: 22
balance: source
servers:
- name: main-street-usa
address: 10.1.71.11
check: true
- name: tomorrowland
address: 10.1.71.12
check: true
- name: fantasyland
address: 10.1.71.13
check: true
- name: minecraft_java
frontend_port: 25565
backend_port: 25565
balance: roundrobin
servers:
- name: arcade
address: 10.1.71.111
check: true
# Firewall configuration
haproxy_firewall_allowed_ports:
- 80/tcp
- 443/tcp
- 2222/tcp
- 5432/tcp
- 8404/tcp
- 25565/tcp
pre_tasks:
- name: Ensure required groups exist
ansible.builtin.group:
name: "{{ item }}"
state: present
loop:
- haproxy
roles:
- haproxy
post_tasks:
- name: Wait for HAProxy to be ready
ansible.builtin.wait_for:
host: "{{ ansible_default_ipv4.address }}"
port: 443
timeout: 60
- name: Display deployment summary
ansible.builtin.debug:
msg: |
╔════════════════════════════════════════════════════════════╗
║ HAProxy Deployment Complete - lightning-lane ║
╚════════════════════════════════════════════════════════════╝
Stats Interface: http://{{ ansible_default_ipv4.address }}:8404/stats
Username: {{ haproxy_stats_username }}
HTTPS Services:
{% for frontend in haproxy_frontends %}
{% if frontend.acls is defined %}
{% for acl in frontend.acls %}
- {{ acl.split()[1] | regex_replace('hdr\\(host\\)', '') | regex_replace('-i', '') | trim }}
{% endfor %}
{% endif %}
{% endfor %}
TCP Services:
{% for tcp in haproxy_tcp_services %}
- {{ tcp.name }}: {{ ansible_default_ipv4.address }}:{{ tcp.frontend_port }}
{% endfor %}
Certificates:
{% for domain in haproxy_certbot_domains %}
- {{ domain.domain }}{% if domain.include_base | default(false) %} + base domain{% endif %}
{% endfor %}
Next steps:
1. Verify certificate: certbot certificates
2. Test renewal: certbot renew --dry-run
3. Check HAProxy stats interface
4. Test HTTPS endpoints

View File

@@ -1,17 +0,0 @@
# ------------------------------------------------------------------------------
# FILE: deploy_k8s.yml
# ------------------------------------------------------------------------------
- name: 1. Prepare all nodes for Kubernetes
hosts: fastpass
roles:
- role: kubernetes
- name: 2. Initialize and configure the control plane
hosts: fastpass_control_plane
roles:
- role: fastpass-control-plane
- name: 3. Join worker nodes to the cluster
hosts: fastpass_workers
roles:
- role: fastpass-workers

View File

@@ -1,22 +0,0 @@
---
# - name: Install additional packages
# hosts: papermc_server
# become: true
# tasks:
# - name: Install python-apt packages
# ansible.builtin.package:
# name: "libapt-pkg"
# state: latest
# update_cache: true
- name: 1. Deploy Paper Minecraft server
hosts: papermc_server
roles:
vars:
user:
home_dir: /opt/minecraft
name: wed
roles:
- role: apigban.papermc_role
become: yes

View File

@@ -0,0 +1,29 @@
---
# ------------------------------------------------------------------------------
# FILE: playbooks/deploy_step_ca.yml
# DESCRIPTION: Deploys Smallstep step-ca SSH Certificate Authority on turnstile.
# Installs Docker and configures step-ca with SSH certificate support.
#
# PREREQUISITES:
# - VM provisioned via Terraform
# - DNS record for turnstile.local.mk-labs.cloud on monorail
# - Authentik OIDC application created (for post-init provisioner setup)
#
# USAGE:
# ansible-playbook -i inventory.yml playbooks/deploy_step_ca.yml
#
# POST-DEPLOY:
# 1. Note the CA fingerprint from the init output
# 2. Add the OIDC provisioner (see docs/guides/step-ca-setup.md)
# 3. Deploy Traefik route via update_traefik_routes.yml
# 4. Bootstrap client workstations with: step ca bootstrap
# ------------------------------------------------------------------------------
- name: Deploy step-ca SSH Certificate Authority
hosts: step_ca_server
become: true
roles:
- common
- docker-host
- step-ca

View File

@@ -0,0 +1,7 @@
---
- name: Enroll host as step-ca SSH client
hosts: "{{ target | default('all') }}"
become: true
tasks:
- name: Include step-ca client enrollment
ansible.builtin.include_tasks: roles/common/tasks/step_ca_client.yml

View File

@@ -1,41 +0,0 @@
---
# Example playbook showing how to use the modular kubeconfig management
# across multiple clusters in your homelab
- name: Setup kubeconfig for FastPass cluster
hosts: fastpass_control_plane[0]
gather_facts: true
roles:
- role: kubeconfig-manager
vars:
cluster_name: "fastpass"
- name: Setup kubeconfig for Hub cluster
hosts: hub_cluster
gather_facts: true
roles:
- role: kubeconfig-manager
vars:
cluster_name: "hub"
- name: Setup kubeconfig for Internal cluster
hosts: internal_cluster[0]
gather_facts: true
roles:
- role: kubeconfig-manager
vars:
cluster_name: "internal"
# Alternative approach using the generic cluster-kubeconfig role
- name: Setup kubeconfig for any cluster
hosts: "{{ target_cluster_hosts }}"
gather_facts: true
roles:
- role: cluster-kubeconfig
vars:
cluster_name: "{{ target_cluster_name }}"
# Usage examples:
# ansible-playbook -i inventory.yml examples/multi-cluster-kubeconfig.yml
# ansible-playbook -i inventory.yml examples/multi-cluster-kubeconfig.yml --limit fastpass_control_plane[0]
# ansible-playbook -i inventory.yml examples/multi-cluster-kubeconfig.yml -e target_cluster_hosts=hub_cluster -e target_cluster_name=hub

View File

@@ -1,60 +0,0 @@
---
# Example: Setup network infrastructure for FastPass cluster
# This demonstrates the modular approach for DNS and load balancer setup
- name: Setup FastPass Cluster Network Infrastructure
hosts: fastpass_control_plane[0]
gather_facts: true
vars:
cluster_name: "fastpass"
cluster_endpoint: "{{ control_plane_endpoint }}"
cluster_vip: "{{ ansible_default_ipv4.address }}"
control_plane_nodes: "{{ groups['fastpass_control_plane'] }}"
tasks:
- name: Display cluster configuration
ansible.builtin.debug:
msg: |
Setting up network for FastPass cluster:
- Cluster Name: {{ cluster_name }}
- Endpoint: {{ cluster_endpoint }}
- VIP: {{ cluster_vip }}
- Control Plane Nodes: {{ control_plane_nodes | join(', ') }}
- name: Setup cluster network infrastructure
ansible.builtin.include_role:
name: cluster-network-setup
vars:
cluster_name: "{{ cluster_name }}"
cluster_endpoint: "{{ cluster_endpoint }}"
cluster_vip: "{{ cluster_vip }}"
control_plane_nodes: "{{ control_plane_nodes }}"
# Alternative approach using task file directly
- name: Alternative - Use Technitium DNS task directly
hosts: localhost
gather_facts: false
vars:
cluster_endpoint: "{{ hostvars[groups['fastpass_control_plane'][0]]['control_plane_endpoint'] }}"
cluster_vip: "{{ hostvars[groups['fastpass_control_plane'][0]]['ansible_default_ipv4']['address'] }}"
tasks:
- name: Create DNS entry using task file
ansible.builtin.include_tasks: ../tasks/add_technitium_dns_entry.yml
vars:
dns_record_name: "{{ cluster_endpoint.split('.')[0] }}"
dns_zone: "{{ base_domain }}"
dns_ip_address: "{{ cluster_vip }}"
dns_record_type: "A"
dns_ttl: 360
dns_create_ptr: true
dns_debug: true
when: use_task_approach | default(false)
# Usage examples:
#
# Use modular approach (recommended):
# ansible-playbook -i inventory.yml playbooks/examples/setup-fastpass-network.yml
#
# Use task file approach:
# ansible-playbook -i inventory.yml playbooks/examples/setup-fastpass-network.yml -e use_task_approach=true

View File

@@ -1,10 +0,0 @@
---
- name: Playbook to configure IPA server
hosts: ipaserver
become: true
vars_files:
- idm-vault.yml
roles:
- role: freeipa.ansible_freeipa.ipaserver
state: present

View File

@@ -0,0 +1,15 @@
---
# ------------------------------------------------------------------------------
# FILE: playbooks/install_talosctl.yml
# DESCRIPTION: Install talosctl on city-hall for managing the fastpass cluster.
# USAGE:
# cd ansible
# ansible-playbook -i inventory.yml playbooks/install_talosctl.yml
# ------------------------------------------------------------------------------
- name: Install talosctl
hosts: talos_control
become: true
roles:
- talosctl

View File

@@ -1,115 +0,0 @@
---
- name: Reset FastPass Kubernetes Cluster
hosts: fastpass
become: true
gather_facts: false
tasks:
- name: Stop and disable kubelet service
ansible.builtin.systemd:
name: kubelet
state: stopped
enabled: false
ignore_errors: true
- name: Stop and disable containerd service
ansible.builtin.systemd:
name: containerd
state: stopped
enabled: false
ignore_errors: true
- name: Remove Kubernetes packages
ansible.builtin.dnf:
name:
- kubelet
- kubeadm
- kubectl
- kubernetes-cni
- containernetworking-plugins
state: absent
ignore_errors: true
- name: Remove containerd
ansible.builtin.dnf:
name: containerd
state: absent
ignore_errors: true
- name: Remove Docker repository
ansible.builtin.file:
path: /etc/yum.repos.d/docker-ce.repo
state: absent
ignore_errors: true
- name: Remove Kubernetes repository
ansible.builtin.file:
path: /etc/yum.repos.d/kubernetes.repo
state: absent
ignore_errors: true
- name: Remove Kubernetes directories
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- /etc/kubernetes
- /var/lib/kubelet
- /var/lib/etcd
- /etc/cni/net.d
- /opt/cni/bin
- /var/lib/containerd
- /etc/containerd
ignore_errors: true
- name: Remove CNI plugins
ansible.builtin.file:
path: /opt/cni
state: absent
ignore_errors: true
- name: Remove iptables rules
ansible.builtin.shell: |
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
ignore_errors: true
- name: Remove firewall Kubernetes service
ansible.builtin.file:
path: /etc/firewalld/services/kubernetes.xml
state: absent
ignore_errors: true
- name: Remove firewall rules for Kubernetes
ansible.builtin.shell: |
firewall-cmd --permanent --remove-service=kubernetes || true
firewall-cmd --reload || true
ignore_errors: true
- name: Reset network interfaces
ansible.builtin.shell: |
ip link delete cni0 || true
ip link delete flannel.1 || true
ip link delete cali* || true
ignore_errors: true
- name: Clean up systemd drop-in files
ansible.builtin.file:
path: /usr/lib/systemd/system/kubelet.service.d
state: absent
ignore_errors: true
- name: Reset hostname to original
ansible.builtin.hostname:
name: "{{ inventory_hostname }}"
- name: Clean package cache
ansible.builtin.dnf:
clean: all
ignore_errors: true
- name: Reboot system
ansible.builtin.reboot:
reboot_timeout: 300

View File

@@ -0,0 +1,11 @@
---
# ------------------------------------------------------------------------------
# FILE: roles/authentik/defaults/main.yml
# ------------------------------------------------------------------------------
authentik_base_dir: /opt/docker/authentik
# All secrets MUST be set in vault
authentik_secret_key: ""
authentik_admin_password: ""
authentik_database_password: ""

View File

@@ -0,0 +1,8 @@
# ------------------------------------------------------------------------------
# FILE: roles/authentik/handlers/main.yml
# ------------------------------------------------------------------------------
- name: restart authentik
community.docker.docker_compose_v2:
project_src: "{{ authentik_base_dir }}"
state: restarted

View File

@@ -0,0 +1,51 @@
---
# ──────────────────────────────────────────────────────────────────────────────
# FILE: roles/authentik/tasks/main.yml
# DESCRIPTION: Deploys Authentik from boilerplate-generated files in the repo.
# The compose.yaml lives in boilerplates/authentik/.
# The .env file is templated to inject secrets from Ansible vault.
# Custom blueprints are synced from boilerplates/authentik/blueprints/.
# ──────────────────────────────────────────────────────────────────────────────
- name: Create Authentik directory structure
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ ansible_user }}"
group: docker
mode: '0775'
loop:
- "{{ authentik_base_dir }}"
- "{{ authentik_base_dir }}/blueprints"
- name: Copy compose.yaml from boilerplate
ansible.builtin.copy:
src: "{{ playbook_dir }}/../../boilerplates/authentik/compose.yaml"
dest: "{{ authentik_base_dir }}/compose.yaml"
owner: "{{ ansible_user }}"
group: docker
mode: '0644'
notify: restart authentik
- name: Sync custom blueprints
ansible.builtin.copy:
src: "{{ playbook_dir }}/../../boilerplates/authentik/blueprints/"
dest: "{{ authentik_base_dir }}/blueprints/"
owner: "{{ ansible_user }}"
group: docker
mode: '0644'
notify: restart authentik
- name: Deploy .env with secrets from vault
ansible.builtin.template:
src: env.j2
dest: "{{ authentik_base_dir }}/.env"
owner: "{{ ansible_user }}"
group: docker
mode: '0600'
notify: restart authentik
- name: Start Authentik
community.docker.docker_compose_v2:
project_src: "{{ authentik_base_dir }}"
state: present

View File

@@ -0,0 +1,13 @@
# Managed by Ansible — do not edit manually
AUTHENTIK_SECRET_KEY={{ authentik_secret_key }}
DATABASE_PASSWORD={{ authentik_database_password }}
AUTHENTIK_ADMIN_PASSWORD={{ authentik_admin_password }}
# OIDC client credentials for blueprints
# These are substituted into blueprint YAML via ${VAR} syntax
PROXMOX_OIDC_CLIENT_ID={{ vault_proxmox_oidc_client_id }}
PROXMOX_OIDC_CLIENT_SECRET={{ vault_proxmox_oidc_client_secret }}
STEPCA_OIDC_CLIENT_ID={{ vault_stepca_oidc_client_id }}
STEPCA_OIDC_CLIENT_SECRET={{ vault_stepca_oidc_client_secret }}
GITEA_OIDC_CLIENT_ID={{ vault_gitea_oidc_client_id }}
GITEA_OIDC_CLIENT_SECRET={{ vault_gitea_oidc_client_secret }}

View File

@@ -1,12 +0,0 @@
---
# role: cluster-kubeconfig
# description: Generic role for any Kubernetes cluster kubeconfig management
# author: mk-labs
# version: 1.0.0
- name: Setup kubeconfig for {{ cluster_name }} cluster
ansible.builtin.include_role:
name: kubeconfig-manager
vars:
cluster_name: "{{ cluster_name }}"
kubeconfig_source_path: "{{ kubeconfig_source_path | default('/etc/kubernetes/admin.conf') }}"

View File

@@ -1,48 +0,0 @@
---
# role: cluster-network-setup
# description: Combined DNS and Load Balancer setup for Kubernetes clusters
# author: mk-labs
# version: 1.0.0
- name: Setup DNS entry for cluster
ansible.builtin.include_role:
name: dns-manager
vars:
cluster_endpoint: "{{ cluster_endpoint }}"
cluster_vip: "{{ cluster_vip }}"
- name: Setup Traefik load balancer for cluster
ansible.builtin.include_role:
name: traefik-manager
vars:
cluster_name: "{{ cluster_name }}"
cluster_endpoint: "{{ cluster_endpoint }}"
control_plane_nodes: "{{ control_plane_nodes }}"
when: traefik_enabled | default(true)
- name: Wait for DNS propagation
ansible.builtin.wait_for:
timeout: 30
delegate_to: localhost
- name: Test cluster endpoint connectivity
ansible.builtin.wait_for:
host: "{{ cluster_endpoint }}"
port: "{{ cluster_api_port | default(6443) }}"
timeout: 60
delegate_to: localhost
register: connectivity_test
failed_when: false
- name: Display network setup results
ansible.builtin.debug:
msg: |
🌐 Network Setup Complete for {{ cluster_name }}:
DNS Entry: {{ cluster_endpoint }} → {{ cluster_vip }}
Load Balancer: {{ 'Configured' if traefik_enabled | default(true) else 'Skipped' }}
Connectivity: {{ 'Success' if connectivity_test.failed == false else 'Failed - Check firewall/network' }}
Next steps:
1. Verify: kubectl --kubeconfig ~/.kube/config-{{ cluster_name }} cluster-info
2. Switch context: kubectl config use-context {{ cluster_name }}-admin

View File

@@ -0,0 +1,34 @@
---
# ------------------------------------------------------------------------------
# FILE: roles/common/defaults/main.yml
# ------------------------------------------------------------------------------
common_timezone: America/Chicago
common_ntp_server: "sundial.local.mk-labs.cloud"
common_packages:
- curl
- wget
- vim
- htop
- git
- jq
- unzip
- ca-certificates
- gnupg
- lsb-release
- net-tools
- dnsutils
- lvm2
# ------------------------------------------------------------------------------
# LVM root volume expansion
# Override common_root_pv/vg/lv per host if the template uses different names.
# Ubuntu 24.04 cloud templates use ubuntu-vg/ubuntu-lv by default.
# ------------------------------------------------------------------------------
common_expand_root_lvm: true
common_root_pv: /dev/sda3 # Ubuntu cloud-init partition layout
common_root_vg: ubuntu-vg
common_root_lv: ubuntu-lv

View File

@@ -1,4 +0,0 @@
[Resolve]
DNS=127.0.0.1
DNSSEC=yes
DNSStubListener=no

View File

@@ -0,0 +1,9 @@
---
# ------------------------------------------------------------------------------
# FILE: roles/common/handlers/main.yml
# ------------------------------------------------------------------------------
- name: restart chrony
systemd:
name: chrony
state: restarted

View File

@@ -0,0 +1,22 @@
---
# ------------------------------------------------------------------------------
# FILE: roles/common/defaults/main.yml
# ------------------------------------------------------------------------------
common_timezone: America/Chicago
common_ntp_server: sundial.local.mk-labs.cloud
common_packages:
- curl
- wget
- vim
- htop
- git
- jq
- unzip
- ca-certificates
- gnupg
- lsb-release
- net-tools
- dnsutils

View File

@@ -0,0 +1,77 @@
---
# ------------------------------------------------------------------------------
# FILE: roles/common/tasks/main.yml
# DESCRIPTION: Baseline configuration applied to all managed Ubuntu hosts.
# Handles hostname, timezone, core packages, NTP, ansible user,
# and optional LVM root volume expansion.
# ------------------------------------------------------------------------------
- name: Set hostname
hostname:
name: "{{ inventory_hostname | replace('_', '-') }}"
- name: Set timezone
timezone:
name: "{{ common_timezone }}"
- name: Update apt cache
apt:
update_cache: yes
cache_valid_time: 3600
- name: Install base utility packages
apt:
name: "{{ common_packages }}"
state: present
- name: Install chrony
apt:
name: chrony
state: present
- name: Configure chrony to use sundial
template:
src: chrony.conf.j2
dest: /etc/chrony/chrony.conf
mode: '0644'
notify: restart chrony
- name: Ensure chrony is enabled and running
systemd:
name: chrony
state: started
enabled: yes
- name: Ensure ansible user has passwordless sudo
lineinfile:
path: /etc/sudoers.d/{{ ansible_user }}
line: "{{ ansible_user }} ALL=(ALL) NOPASSWD:ALL"
create: yes
mode: '0440'
validate: 'visudo -cf %s'
# ------------------------------------------------------------------------------
# LVM root volume expansion
# Extends the root PV to the full disk size and grows the LV + filesystem.
# This codifies what was previously done manually after provisioning.
# Runs only when common_expand_root_lvm is true (default: true).
# Safe to re-run — pvresize and lvextend are idempotent when already at max.
# ------------------------------------------------------------------------------
- name: Expand root PV to full disk size
command: pvresize {{ common_root_pv }}
register: pvresize_result
changed_when: "'changed' in pvresize_result.stdout or pvresize_result.rc == 0"
when: common_expand_root_lvm | bool
- name: Extend root LV to 100% of free VG space
lvol:
vg: "{{ common_root_vg }}"
lv: "{{ common_root_lv }}"
size: +100%FREE
resizefs: yes
when:
- common_expand_root_lvm | bool
ignore_errors: yes
# ignore_errors because lvextend returns non-zero when already at max size.
# resizefs: yes handles the resize2fs call inline — no separate task needed.

View File

@@ -0,0 +1,136 @@
# ------------------------------------------------------------------------------
# FILE: roles/common/tasks/step_ca_client.yml
# DESCRIPTION: Enroll host as a step-ca SSH client. Installs the step CLI,
# bootstraps trust with the CA, configures sshd to accept
# CA-signed user certificates, signs a host certificate, and
# sets up automated renewal via systemd timer.
# ------------------------------------------------------------------------------
- name: Install step CLI
apt:
deb: "https://dl.smallstep.com/cli/docs-ca-install/latest/step-cli_amd64.deb"
state: present
- name: Bootstrap step-ca trust
command: >
step ca bootstrap
--ca-url {{ step_ca_url }}
--fingerprint {{ step_ca_fingerprint }}
--install
args:
creates: /root/.step/certs/root_ca.crt
- name: Get SSH user CA public key
command: step ssh config --roots
register: ssh_user_ca_key
changed_when: false
- name: Write SSH user CA public key
copy:
content: "{{ ssh_user_ca_key.stdout }}"
dest: /etc/ssh/ssh_user_key.pub
mode: '0644'
notify: restart sshd
- name: Configure sshd to trust CA-signed user certificates
lineinfile:
path: /etc/ssh/sshd_config
line: "TrustedUserCAKeys /etc/ssh/ssh_user_key.pub"
regexp: "^#?TrustedUserCAKeys"
state: present
notify: restart sshd
# --- Host certificate signing ---
- name: Write provisioner password to temp file on controller
copy:
content: "{{ stepca_ca_password }}"
dest: /tmp/step_provisioner_pw
mode: '0600'
delegate_to: localhost
run_once: true
no_log: true
- name: Generate one-time host token
command: >
step ca token {{ inventory_hostname }}.local.mk-labs.cloud
--ssh --host
--provisioner {{ step_ca_provisioner_name }}
--password-file /tmp/step_provisioner_pw
delegate_to: localhost
register: host_token
changed_when: false
- name: Sign host certificate
command: >
step ssh certificate {{ inventory_hostname }}.local.mk-labs.cloud
/etc/ssh/ssh_host_ecdsa_key.pub
--host --sign
--token {{ host_token.stdout }}
--no-password --insecure
args:
creates: /etc/ssh/ssh_host_ecdsa_key-cert.pub
notify: restart sshd
- name: Configure sshd to present host certificate
blockinfile:
path: /etc/ssh/sshd_config
marker: "# {mark} STEP-CA HOST CERTIFICATE"
block: |
HostCertificate /etc/ssh/ssh_host_ecdsa_key-cert.pub
HostKey /etc/ssh/ssh_host_ecdsa_key
notify: restart sshd
- name: Clean up provisioner password from controller
file:
path: /tmp/step_provisioner_pw
state: absent
delegate_to: localhost
run_once: true
no_log: true
# --- Automated renewal via systemd ---
- name: Create host cert renewal script
copy:
content: |
#!/bin/bash
step ssh renew --force /etc/ssh/ssh_host_ecdsa_key-cert.pub /etc/ssh/ssh_host_ecdsa_key
systemctl restart sshd
dest: /usr/local/bin/step-renew-host-cert.sh
mode: '0755'
- name: Create systemd timer for host cert renewal
copy:
content: |
[Unit]
Description=Renew step-ca SSH host certificate
[Timer]
OnCalendar=weekly
Persistent=true
RandomizedDelaySec=3600
[Install]
WantedBy=timers.target
dest: /etc/systemd/system/step-renew-host-cert.timer
mode: '0644'
- name: Create systemd service for host cert renewal
copy:
content: |
[Unit]
Description=Renew step-ca SSH host certificate
[Service]
Type=oneshot
ExecStart=/usr/local/bin/step-renew-host-cert.sh
dest: /etc/systemd/system/step-renew-host-cert.service
mode: '0644'
- name: Enable and start renewal timer
systemd:
name: step-renew-host-cert.timer
state: started
enabled: yes
daemon_reload: yes

View File

@@ -0,0 +1,5 @@
# Managed by Ansible — do not edit manually
server {{ common_ntp_server }} iburst
driftfile /var/lib/chrony/chrony.drift
makestep 1.0 3
rtcsync

View File

@@ -1,38 +0,0 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

View File

@@ -1,3 +0,0 @@
#SPDX-License-Identifier: MIT-0
---
# defaults file for containerd

View File

@@ -1,3 +0,0 @@
#SPDX-License-Identifier: MIT-0
---
# handlers file for containerd

View File

@@ -1,35 +0,0 @@
#SPDX-License-Identifier: MIT-0
galaxy_info:
author: your name
description: your role description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View File

@@ -1,74 +0,0 @@
---
# tasks file for containerd
- name: Install containerd dependencies
become: true
ansible.builtin.package:
name: "{{ item }}"
state: present
loop:
"{{ containerd_dependencies }}"
- name: Install via apt
become: true
when: ansible_os_family == "Debian"
block:
- name: Add repo using key from URL (apt)
ansible.builtin.deb822_repository:
name: docker
types: deb
uris: https://download.docker.com/linux/ubuntu
suites: "{{ ansible_distribution_release }}"
components: stable
architectures: amd64
signed_by: https://download.docker.com/linux/ubuntu/gpg
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
- name: Install via dnf
become: true
when: ansible_os_family == "RedHat"
block:
- name: Add repo using key from URL (dnf)
ansible.builtin.yum_repository:
name: docker
description: "Docker repository"
baseurl: https://download.docker.com/linux/ubuntu
gpgcheck: true
gpgkey: https://download.docker.com/linux/ubuntu/gpg
- name: Update dnf cache
ansible.builtin.dnf:
update_cache: true
- name: Install containerd
become: true
ansible.builtin.package:
name: containerd.io
state: present
- name: Create containerd config directory
ansible.builtin.file:
path: /etc/containerd
state: directory
owner: root
group: root
mode: '0755'
- name: Check if containerd config file exists
ansible.builtin.stat:
path: /etc/containerd/config.toml
register: containerd_config_file
- name: Generate default containerd config and enable SystemdCgroup
when: containerd_config_file.stat.exists == false
ansible.builtin.shell: |
containerd config default > /etc/containerd/config.toml
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
- name: Restart and enable containerd service
ansible.builtin.systemd:
name: containerd
state: restarted
enabled: true

View File

@@ -1,3 +0,0 @@
#SPDX-License-Identifier: MIT-0
localhost

View File

@@ -1,6 +0,0 @@
#SPDX-License-Identifier: MIT-0
---
- hosts: localhost
remote_user: root
roles:
- containerd

View File

@@ -1,3 +0,0 @@
#SPDX-License-Identifier: MIT-0
---
# vars file for containerd

View File

@@ -0,0 +1,8 @@
# ------------------------------------------------------------------------------
# FILE: roles/docker-host/handlers/main.yml
# ------------------------------------------------------------------------------
- name: restart docker
systemd:
name: docker
state: restarted

View File

@@ -0,0 +1,88 @@
# ------------------------------------------------------------------------------
# FILE: roles/docker-host/tasks/main.yml
# DESCRIPTION: Prepares an Ubuntu VM to run Docker Compose workloads.
# Installs Docker CE, configures the daemon, and ensures
# the ansible user (wed) can manage containers.
# ------------------------------------------------------------------------------
- name: Install prerequisite packages
apt:
name:
- ca-certificates
- curl
- gnupg
- lsb-release
state: present
update_cache: yes
- name: Create keyrings directory
file:
path: /etc/apt/keyrings
state: directory
mode: '0755'
- name: Add Docker GPG key
get_url:
url: https://download.docker.com/linux/ubuntu/gpg
dest: /etc/apt/keyrings/docker.asc
mode: '0644'
- name: Add Docker repository
apt_repository:
repo: >-
deb [arch={{ ansible_architecture | replace('x86_64', 'amd64') }}
signed-by=/etc/apt/keyrings/docker.asc]
https://download.docker.com/linux/ubuntu
{{ ansible_distribution_release }} stable
state: present
filename: docker
- name: Install Docker CE and Compose plugin
apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose-plugin
state: present
update_cache: yes
- name: Ensure Docker service is started and enabled
systemd:
name: docker
state: started
enabled: yes
- name: Add ansible user to docker group
user:
name: "{{ ansible_user }}"
groups: docker
append: yes
- name: Configure Docker daemon
copy:
dest: /etc/docker/daemon.json
content: |
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
},
"default-address-pools": [
{
"base": "172.17.0.0/16",
"size": 24
}
]
}
mode: '0644'
notify: restart docker
- name: Create Docker Compose project directory
file:
path: /opt/docker
state: directory
owner: "{{ ansible_user }}"
group: docker
mode: '0775'

View File

@@ -1,38 +0,0 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

View File

@@ -1,22 +0,0 @@
---
# FastPass Additional Control Plane Role Defaults
# Kubernetes services for control plane
kubernetes_services_control_plane:
- kubernetes_API
- etcd
- kubelet
- kube-scheduler
- kube-controller-manager
# Join token configuration
join_token_ttl: "24h"
certificate_key_ttl: "2h"
# Default cluster configuration
pod_network_cidr: "10.244.0.0/16"
service_cidr: "10.96.0.0/12"
# Kubelet configuration
kubelet_cgroup_driver: "systemd"
container_runtime_endpoint: "unix:///run/containerd/containerd.sock"

Some files were not shown because too many files have changed in this diff Show More