Long Story
I'm preparing cloud-init scripts for instaling monitoring software agent (disclaimer: I'm one of the founders of MonitOwl). The agent software collect information (like memory or network stats) and send it to server. Each company group should connect to own personalized server URL like: https://customer_name.example.org.
The cloud-init script is a Content-Type: multipart/mixed;
that downloads agent from github, install systemd service and install python requirements. Currently we use it like:
# ec2-run-instances --user-data-file <our_generated_file>
For our internal deployments we use ansible (parametrized with VARS) but now more and more people ask for cloud-init script.
Goal
I would like to have one common cloud-init script for all companies and just provide argument with URL to server. I would like to put this cloud-init script in our github repository, to make the experience of installing agent even better.
Problem
Unfortunately the only way I found is to prepare a separate script - generator that will create the cloud-init script with hardcoded URL inside. Is there any nice way to accomplish my goal? I cannot believe that canonical didn't think about parametrization when developing cloud-init.