Skip to content

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 -h flag, 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_template platform, it can discover available templates from the roles/proxmox_template/vars directory.
  • "All Distros" Mode: The --all-distros flag allows processing all discovered distributions for the proxmox_template platform in a single run.
  • Extra Variables: Supports passing extra variables to the Ansible playbook using the -e flag.
  • 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:

./manage-platform.sh [-h HOST] <platform> <action> [options]

Supported Platforms:

  • proxmox_template
  • proxmox_vm
  • platform_base
  • linode_instance
  • k3s_control
  • k3s_worker

Supported Actions:

  • build
  • destroy
  • create
  • remove

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 -h flag (required for Proxmox operations).
  • Sudo Prompt: The -K flag prompts for a sudo password when the task requires elevated privileges.
  • Default Entry Point: If no entry is specified, it defaults to the verify task 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 -e flag.

Usage:

./platform-exec.sh [-h HOST] [-K] <platform> [entry] [options]

Common Entry Points (examples for proxmox_template):

  • verify (default) - Verify platform state
  • download_image - Download cloud image
  • resize_image - Resize disk image
  • cleanup - Clean up temporary files
  • create_vm - Create VM
  • import_disk - Import disk
  • configure_storage - Configure storage
  • setup_cloudinit - Setup cloud-init
  • convert_template - Convert to template