TimDaub / hetzner-cloud-deploy-server-action

Deploy a Hetzner Cloud Server from a GitHub Action.
GNU General Public License v3.0
31 stars 14 forks source link

Allow providing "user-data" #17

Open ctron opened 3 years ago

ctron commented 3 years ago

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.

TimDaub commented 3 years ago

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?

ctron commented 3 years ago

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)
TimDaub commented 3 years ago

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

ctron commented 3 years ago

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

TimDaub commented 3 years ago

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.