Simple Online Automated Provision

Related tags

Miscellaneous SOAP
Overview

Simple Online Automated Provisioning

Simply put, SOAP automates PXE network booting and OS installation.

With SOAP, you can submit the network information (IP & MAC address etc.), select a boot template on an online form and then the Dnsmasq server (for DHCP & TFTP) will be configured automatically.

Architecture & Requirements

  • PHP 8.0 (apcu & amqp extension required)
  • MariaDB/MySQL (only for the web server)
  • NGINX (or other web server integrates with PHP)
  • Dnsmasq (can be deployed separately)
  • RabbitMQ (for communication between web and Dnsmasq server)

Installation

We prepared an installation script for Debian stable and Ubuntu LTS.

You be asked for the server's IP address, and web domain.

# Use --full for single server: install both web and Dnsmasq
sudo ./install.sh --full

# Separate web and Dnsmasq servers
# Use --web-only for the web server
sudo ./install.sh --web-only

# After it finished, a command for Dnsmasq server installation
# will be generated, like this:
sudo ./install.sh --dnsmasq-only --dnsmasq-server ... --mq-server ... --mq-user ... --mq-pass ... --mq-vhost ...

MariaDB and RabbitMQ credentials will be printed out after the installation.

The script only configures HTTP access, you have to upload the certificate and configure HTTPS in /etc/nginx/conf.d/soap-web.conf. Please refer to the comments in the config file.

Other information for script installations

  • Web user for PHP and NGINX: www-data
  • SOAP application dir: /srv/soap
  • Dnsmasq DHCP hosts config dir: /srv/dnsmasq/dhcp/hosts
  • Dnsmasq DHCP options config dir: /srv/dnsmasq/dhcp/opts

Boot Template

Boot template consists of an iPXE script and an install config (which is "preseed" for Debian and "Kickstart" for the Red Hat family).

The template is rendered by Twig, whose documentation can be found here.

You can get the variable with {{ name }} syntax. Here's a list of variables you can use in the template.

  • preseed_url: install config URL (HTTP access)
  • host.macAddress
  • host.ipAddress
  • host.prefix CIDR prefix
  • host.netmask IPv4 netmask
  • host.gateway
  • host.hostname
  • host.dns array of DNS servers. You can join it into string e.g. with space {{ host.dns|join(' ') }}
  • host.rootPassword Plaintext root password

API reference

All JSON. Base URL is /api/v1

List Boot Templates: GET /api/v1/bootTemplate

Response:

{
   "unique_id": "template_name"
}
Create Host: POST /api/v1/host

Request

  • string macAddress, required
  • string ipAddress, required
  • int prefix, CIDR subnet prefix, default 24
  • string gateway, required
  • array dns, default ['185.222.222.222', '45.11.45.11'],
  • string ipxeScript, custom iPXE script (Twig template), optional
  • string preseed, custom install config (Twig template), optional
  • string bootTemplate, unique ID of boot template, optional
  • int expiresAfter, one of 1, 3600, 86400, 604800, 2592000, which means single use, 1 hour, 1 day...
  • string rootPassword, auto-generated if not provided

Response

  • string id, unique ID
  • string rootPassword, auto-generated password
Get Host Detail: GET /api/v1/host/<id>
Update Host Detail: POST /api/v1/host/<id>

Request and response are same as creation.

However, IP and MAC address can't be updated once created. Instead, delete it and create a new one.

Delete Host: POST /api/v1/host/<id>

Host will NOT be deleted instantly. The database record will be deleted once the Dnsmasq config files for it are deleted.

CLI Commands

  • Create User: bin/console app:create-user <username> <password>
  • Insert/update boot templates from boot_templates dir: bin/console app:import-boot-templates
  • Clear finished operation logs: bin/console app:clear-operations

Env Vars

Configuration variables is stored in .env file. Copy the .env.dist to .env.local and edit it.

For production use, run composer dump-env prod to compile .env files.

  • APP_ENV: prod for production, dev for development which enables debug bar
  • APP_SECRET: any long random string
  • TRUSTED_PROXIES: IP address or CIDR range. Trust x-forwarded-for for the origin.
  • APP_DHCP_SERVER: DHCP server IP address to display on the form.
  • DATABASE_URL: Database URI. Version has to be set even for the Dnsmasq server (which does not access any DB): mysql://localhost/?serverVersion=mariadb-10.6.4
  • MESSENGER_TRANSPORT_DSN: AMQP URI
  • DNSMASQ_DHCP_HOSTS_DIR: required for Dnsmasq server
  • DNSMASQ_DHCP_OPTIONS_DIR: required for Dnsmasq server

Configuration tips

Dnsmasq reload command

By default it's sudo systemctl reload dnsmasq.

sudoers is auto configured by the installation script (please refer to install_dnsmasq function).

It's configurable in:

config/service.yaml
services > process_command.dnsmasq_reload > arguments > $command

APCu cache

By default it's enabled in prod environment. It's configurable in:

config/packages/prod/cache.yaml
framework > cache > app

Comment out the line to use filesystem cache.

You might also like...
Online Food Delivery Website created using HTML, CSS, PHP and MySQL which delivers food at your doorstep on Cash-On-Delivery.

Food-Delivery-Website Online Food Delivery Website created using HTML, CSS, PHP and MySQL which delivers food at your doorstep on Cash-On-Delivery. Th

A XOOPS module for handling events, including online registrations.
A XOOPS module for handling events, including online registrations.

wgEvents A XOOPS module for handling events, including online registrations. Support If you like the wgEvents module and thanks to the long process fo

An online system to keep digitized form of employee personal files (staff personal files)

An online system to keep digitized form of employee personal files (staff personal files).

Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics (functional) API that doesn't cause vendor lock-in.

Metrics Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics API that doesn't cau

Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers

Magento 2 SMTP Extension - Gmail, G Suite, Amazon SES, Office 365, Mailgun, SendGrid, Mandrill and other SMTP servers. For Magento 2.0.x, 2.1.x, 2.2.x

Simple PHP Pages - A simple puristic PHP Website Boilerplate
Simple PHP Pages - A simple puristic PHP Website Boilerplate

Simple PHP Pages - A simple puristic PHP Website Boilerplate 🚀 Hey! This project provides simple and basic concepts for PHP pages. It includes ideas

Sslurp is a simple library which aims to make properly dealing with SSL in PHP suck less.

Sslurp v1.0 by Evan Coury Introduction Dealing with SSL properly in PHP is a pain in the ass and completely insecure by default. Sslurp aims to make i

Currency is a simple PHP library for current and historical currency exchange rates & crypto exchange rates. based on the free API exchangerate.host

Currency Currency is a simple PHP library for current and historical currency exchange rates & crypto exchange rates. based on the free API exchangera

Simple IT Documentation Solution for MSPs

SimpleMSPDoc RC 1.0 I wasn't happy with what other IT documention software had. I felt they over complicated things and required so much clicky clicky

Owner
xTom
xTom GmbH
xTom
Phalcon Mooc an example API + Front End with automated tests

NovaMooc - a Phalcon project A Mooc project developed with Phalcon, a PHP framework. Key Features • How To Use • Contributing • Credits • License Key

Les Enovateurs 19 Dec 4, 2022
This module aims to validate if the pilot made his flights online on the IVAO and VATSIM networks

SMPirepValidator This module aims to validate if the pilot made his flights online on the IVAO and VATSIM networks SMPirepValidator v.1.0 for phpVMS (

SmartModules for phpVMS 1 Dec 13, 2021
Authoring Tool and Language Workbench for Online Courses

Authoring Tool and Language Workbench for Online Courses

sellquiz 1 Feb 2, 2022
Maps Railroad Online Savegames to a SVG map

RailroadOnlineMapper @ian76g#6577 Environments DEV - https://zwackelmann.online/ QA - https://ohnezahn.online/ PROD - https://minizwerg.online/ Gettin

Sebastian Köhler 5 Jan 3, 2023
Online Food Ordering system with admin, owner, rider panel

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

sumit paul 1 Jun 17, 2022
A platform to create an online marketplace

About MarketplaceKit MarketplaceKit is a platform for building different types of online marketplaces. MarketplaceKit attempts to reduce the developme

MarketplaceKit Team 667 Nov 30, 2022
An open-source Laravel 8 online store, client area, and billing software specially made for Pterodactyl panel

PteroBilling An open-source Laravel 8 online store, client area, and billing software specially made for Pterodactyl panel           Announcement: An

PteroBilling 18 Nov 12, 2022
Magento 2 Blog Extension - FREE, fully featured, powerful Blog solution for your online store!

Blog MX | Magento 2 Blog Module by Mirasvit FREE, fully featured, powerful Blog solution for your online store! Magento 2 Blog MX allows you to open a

Mirasvit 71 Dec 7, 2022
The Laravel eCommerce ABA Payment Gateway module allows the admin to integrate the ABA payment gateway to the online store.

Introduction Bagisto ABA Payment Gateway. Requirements: Bagisto: v1.3.2. Installation with composer: Run the following command composer require bagist

Bagisto 3 May 31, 2022
StickWithIt is an online food ordering website created using PHP. You can view and purchase various items as well as remove items from the cart.

StickWithIt (App Name) StickWithIt is an online food ordering website created using PHP. The database used here is MYSQL database. The tool used here

Jenil Gajjar 1 May 11, 2022