Skip to main content

Cloud Seeder

A production-ready CLI tool for generating cloud-init configurations and seed ISOs from YAML templates.

Features

  • Generic and Flexible: Not tied to any specific use case
  • YAML-based Configuration: Simple, declarative configuration format
  • Multi-node Support: Define multiple nodes in a single configuration
  • Inheritance Model: Global settings with node-specific overrides
  • ISO Generation: Automatically create cloud-init seed ISOs
  • Network Configuration: Support for both static and DHCP networking
  • Validation: Configuration validation before generation
  • Clean Output Structure: Organized directory structure for outputs

Installation

# Clone the repository
git clone https://github.com/yourusername/cloud-seeder.git
cd cloud-seeder

# Make the CLI executable
chmod +x cloud_seeder_cli.py

# Install dependencies (if needed)
pip install pyyaml

# For ISO generation, install one of:
sudo dnf install genisoimage    # Fedora/CentOS
sudo apt install genisoimage    # Ubuntu/Debian

Usage

Basic Usage

# Generate cloud-init configurations
./cloud_seeder_cli.py config.yaml

# Generate configurations and create ISOs
./cloud_seeder_cli.py config.yaml --iso

# Clean output directory before generating
./cloud_seeder_cli.py config.yaml --clean --iso

# Validate configuration only
./cloud_seeder_cli.py config.yaml --validate-only

Command Line Options

positional arguments:
  config                Configuration file (YAML)

optional arguments:
  -h, --help            show this help message and exit
  --output-dir OUTPUT_DIR, -o OUTPUT_DIR
                        Output directory (default: output)
  --iso, -i             Create seed ISOs
  --clean, -c           Clean output directory before generating
  --log-level {DEBUG,INFO,WARNING,ERROR}, -l {DEBUG,INFO,WARNING,ERROR}
                        Logging level
  --validate-only, -v   Only validate configuration without generating files

Configuration Structure

Global Settings

Global settings apply to all nodes unless overridden:

# System settings
timezone: America/New_York
locale: en_US.UTF-8

# Package management
package_management:
  update: true
  upgrade: false
  reboot_if_required: false

# SSH configuration
ssh:
  password_auth: false
  disable_root: true

# Packages for all nodes
packages:
  - vim-enhanced
  - tmux
  - htop

# Users for all nodes
users:
  - name: admin
    groups: ["wheel"]
    ssh_authorized_keys:
      - ssh-rsa AAAAB3...

Node Configuration

Each node can have its own specific configuration:

nodes:
  web-server:
    hostname: web01
    fqdn: web01.example.com
    
    network:
      ip_address: 10.0.1.10
      gateway: 10.0.1.1
      dns_servers: [10.0.1.1, 8.8.8.8]
    
    packages:
      - nginx
      - certbot
    
    runcmd:
      - systemctl enable nginx
      - systemctl start nginx

Output Structure

output/
├── configs/           # Cloud-init YAML files
│   ├── node1-cloud-init.yaml
│   └── node2-cloud-init.yaml
├── seeds/            # Seed file directories
│   ├── node1/
│   │   ├── meta-data
│   │   ├── user-data
│   │   └── network-config
│   └── node2/
└── images/           # ISO files (if --iso used)
    ├── node1-seed.iso
    └── node2-seed.iso

Examples

Web Server Farm

packages:
  - nginx
  - firewalld

nodes:
  web-01:
    hostname: web01
    network:
      ip_address: 10.0.1.10
      gateway: 10.0.1.1
  
  web-02:
    hostname: web02
    network:
      ip_address: 10.0.1.11
      gateway: 10.0.1.1

Kubernetes Cluster

packages:
  - containerd
  - kubeadm
  - kubelet
  - kubectl

nodes:
  master-01:
    hostname: k8s-master-01
    network:
      ip_address: 10.0.2.10
    runcmd:
      - kubeadm init --pod-network-cidr=10.244.0.0/16
  
  worker-01:
    hostname: k8s-worker-01
    network:
      ip_address: 10.0.2.20

Development Environment

packages:
  - git
  - python3
  - nodejs
  - podman

users:
  - name: developer
    groups: ["wheel", "podman"]
    passwd: dev123

nodes:
  dev-workstation:
    hostname: devbox
    packages:
      - code
      - firefox

Best Practices

  1. Use YAML anchors for repeated configurations
  2. Store sensitive data separately (passwords, keys)
  3. Version control your configuration files
  4. Test configurations in a non-production environment first
  5. Use meaningful node names that reflect their purpose
  6. Document custom configurations with comments

Troubleshooting

ISO Creation Fails

Install one of the ISO creation tools:

sudo dnf install genisoimage    # Fedora/CentOS
sudo apt install genisoimage    # Ubuntu/Debian

Network Configuration Not Applied

Ensure your cloud provider or hypervisor supports cloud-init network configuration.

Logs and Debugging

Enable debug logging:

./cloud_seeder_cli.py config.yaml --log-level DEBUG

Check cloud-init logs on the target system:

sudo journalctl -u cloud-init
sudo cat /var/log/cloud-init.log

License

MIT License - See LICENSE file for details

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Support

  • Create an issue on GitHub
  • Check existing issues for solutions
  • Read cloud-init documentation at https://cloud-init.io# cloud-seeder

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloud_seeder-0.1.0.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloud_seeder-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file cloud_seeder-0.1.0.tar.gz.

File metadata

  • Download URL: cloud_seeder-0.1.0.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cloud_seeder-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed097081342635f6d10bccdc30815ae3f5ce45f4c6c7584ccd9e4afa678911a5
MD5 ce8184a2ae697ced11d61e9c304b4418
BLAKE2b-256 e48047f5d6b86cb359b8f69b5860050f8278e00b435d6468f67e0086ba3115c8

See more details on using hashes here.

File details

Details for the file cloud_seeder-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cloud_seeder-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cloud_seeder-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69a0c899dc76448d61b467f8d91479a087ddfcd4ced1d457c4d77501688865a5
MD5 548079f33b6280303e0894bcb085035c
BLAKE2b-256 f8649678b75d28d4753309d8308324d14317e9bfb4134528bdca5e036d62e7b1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page