hetzner-cloud-deploy-server-action icon indicating copy to clipboard operation
hetzner-cloud-deploy-server-action copied to clipboard

Allow providing "user-data"

Open ctron opened this issue 4 years ago • 5 comments

Again, trying to follow the https://github.com/machulav/ec2-github-runner#example for Hetzner, I would need to run a few commands after the server was created.

This can be achieved by providing "user-data" to the Hetzner server instance. However, this action doesn't seem to allow providing any user data.

It would be great if this action could let the user provide an arbitrary string, so that a server can be set up during the provisioning process. Rather than SSH-ing into it later.

ctron avatar Jun 16 '21 08:06 ctron

Interesting. Can you maybe refer me to a section of the Hetzner REST API where it's specified how user data can be created and added to a machine?

TimDaub avatar Jun 16 '21 08:06 TimDaub

On the API no, but hcloud has it:

Create a server

Usage:
  hcloud server create FLAGS

Flags:
…
      --user-data-from-file stringArray   Read user data from specified file (use - to read from stdin)

ctron avatar Jun 16 '21 09:06 ctron

Good to know. How I'm automating installing things at the moment is by logging into ssh from my personal GitHub Action. But being able to pass a user data string to sdtin would make things less complex I imagine

TimDaub avatar Jun 16 '21 12:06 TimDaub

Maybe it helps you understand what I am trying to do: https://github.com/drogue-iot/drogue-cloud-testing/blob/main/.github/workflows/system-test.yaml

ctron avatar Jun 16 '21 12:06 ctron

I'd be happy to have this functionality added. I think manually logging in with SSH is not always the desired use case. Feel free to send a PR.

TimDaub avatar Aug 10 '21 09:08 TimDaub