On Mon, Jun 24, 2019 at 10:59:44AM +0200, David Sastre wrote:
I would not consider ansible as the right tool to provision a system
from scratch (as in PXE booting, etc...).
Ansible is better used on a system you can connect to using SSH and
perform actions as required, with or without doas, as you surely know.
You don't mention cloud providers/VPS you are trying to bootstrap
OpenBSD to, but the way I'd tackle this situation, if I have
understood your use case correctly, is as follows:

- Find out if the specific cloud provider is supported by packer [1]
(packer itself can be run in OpenBSD[2]).
 Custom builders can be written, but might be overkill for the task at hand.
- If the answer is yes, create a template to bootstrap an OpenBSD image.
 You can find many examples online[3]. The specifics of the packer
template vary depending on the cloud provider,
 but usually you can bootstrap the system from an ISO (or an existing
AMI, if in AWS), and finish provisioning
 the configuration using ansible.

And what if the answer is no? You didn't mention that :)

Yes, Ansible is not really the right tool for installing new images onto machines or re-imaging server. Yes, Packer and Terraform (both from the same company) are superb and wonderful ways of managing machines on AWS/Azure/the rest of the API-enabled IaaS crowd.

However great the Big Cloud providers are, though, sometimes they are not suitable for a project, and instead one is left in the position of bartering a cow in exchange for a VPS instance at HostElbonia, where you're lucky if the API is RFC 2549 compliant.

And in general, one of the things I like most about OpenBSD is the design for simplicity, emphasizing standard, boring interfaces that are extremely reliable and which don't require the "hot new shiny object" du jour. So while yes, automated provisioning of AWS over the API is an option, as is setting up the Linux VPS as a hypervisor running OpenBSD... it doesn't quite feel right.

It sounds like a custom bsd.rd with auto_install.conf, dropped onto the /boot partition by Ansible (or some other script or management tool!) is the way to go for this. Ihave a few other projects to deal with, but it is on my to-do list, and if I come up with something potentially useful to others then I will try and write it up in some form.

Reply via email to