Platform Management Tools¶
This section outlines the command-line tools designed to streamline the lifecycle management of service platforms within the Solti ecosystem. These scripts, manage-platform.sh and platform-exec.sh, leverage dynamic Ansible playbook generation to provide a flexible and powerful way to build, configure, and maintain platform instances.
Core Scripts¶
manage-platform.sh¶
The manage-platform.sh script is the primary tool for high-level platform management. It abstracts the complexity of Ansible by dynamically generating playbooks for common lifecycle actions such as build, destroy, create, and remove.
Key Features:
- Dynamic Playbook Generation: Automatically creates an Ansible playbook in the
tmp/directory tailored to the specified platform and action. - Host Targeting: Allows targeting a specific host from the inventory using the
-hflag, which is mandatory for Proxmox operations. - Platform and Action Validation: Checks if the specified platform and action are supported before execution. The supported platforms and actions are defined within the script.
- Template Discovery: For the
proxmox_templateplatform, it can discover available templates from theroles/proxmox_template/varsdirectory. - "All Distros" Mode: The
--all-distrosflag allows processing all discovered distributions for theproxmox_templateplatform in a single run. - Extra Variables: Supports passing extra variables to the Ansible playbook using the
-eflag. - Interactive Confirmation: Prompts for confirmation before executing the generated playbook, displaying the playbook's content for review.
- Cleanup: Automatically removes the temporary playbook upon successful execution.
Usage:
Supported Platforms:
proxmox_templateproxmox_vmplatform_baselinode_instancek3s_controlk3s_worker
Supported Actions:
builddestroycreateremove
platform-exec.sh¶
For more granular control, the platform-exec.sh script allows for the execution of specific tasks or "entry points" within a platform's Ansible role. This is ideal for debugging, verification, or running partial configurations.
Key Features:
- Task-Specific Execution: Targets and executes a single task file (entry point) from an Ansible role.
- Dynamic Playbook Generation: Creates a temporary Ansible playbook to run the specified task.
- Host Targeting: Allows targeting a specific host with the
-hflag (required for Proxmox operations). - Sudo Prompt: The
-Kflag prompts for a sudo password when the task requires elevated privileges. - Default Entry Point: If no entry is specified, it defaults to the
verifytask for the given platform. - Supported Platforms: Supports the same platforms as
manage-platform.sh. - Extra Variables: Supports passing extra variables to the Ansible playbook using the
-eflag.
Usage:
Common Entry Points (examples for proxmox_template):
verify(default) - Verify platform statedownload_image- Download cloud imageresize_image- Resize disk imagecleanup- Clean up temporary filescreate_vm- Create VMimport_disk- Import diskconfigure_storage- Configure storagesetup_cloudinit- Setup cloud-initconvert_template- Convert to template