Installing RancherOS on disk with iPXE

Hello!
I am trying to automate the installation of the RancherOS on a virtual machine.
The route I took involves booting the RancherOS via iPXE (which works fine) with a custom cloud-config file (generated by Foreman) and after running the ros install command.
I’m not sure how to automatically call the ros install command during iPXE boot; I looked at: https://github.com/rancher/os/issues/446#issuecomment-131446590 and I’m thinking to run a command via a container like they does, but how to ensure that the container starts only once and not at every boot?
Is there any better way to automate the RancherOS install?

Thank you,
Virgil

1 Like

I’m using a simple cloud config like that:

#cloud-config
write_files:
  - path: /opt/rancher/bin/install.yml
    permissions: "0700"
    content: |
      #cloud-config
      hostname: rancher-os
      ssh_authorized_keys:
        - ... 
  - path: /opt/rancher/bin/start.sh
    permissions: "0700"
    content: |
      #!/bin/bash
      echo Y | sudo ros install -f -c /opt/rancher/bin/install.yml -d /dev/sda

Yep, that’s cloud config inside cloud config. The outer one is used only during first boot to install to disk. The inner one is used after install.