YaleUniversity / packer-plugin-goss

Goss Provisioner for Packer
MIT License
136 stars 45 forks source link

Feature request - set up goss in server-mode #9

Closed petemounce closed 3 years ago

petemounce commented 6 years ago

It would be really useful if the provisioner had a mode whereby it set up goss to run in server mode to be used as a health-check.

Parameters that I think would be necessary:

This would be a bit more involved, since it would probably also need to create a service definition file, which on modern ubuntu would be a systemd unit file, on macOS a LaunchAgent, and so on.

Is that something you'd be interested in a PR for?

fishnix commented 6 years ago

Let me think about this a little, it might be out of scope for this tool and better suited for some form of configuration management/scripting... although presumably you have the test suite already there.... What's the use case you're hoping to address?

petemounce commented 6 years ago

So, I'm building buildkite agents via packer, bash and ansible.

For local iteration, I'm using the https://github.com/indusbox/goss-ansible role to download and install goss to the system (/usr/local/bin).

During packer builds, I'm using your module to run my tests (so I get 2 test runs, since I haven't bothered making the ansible goss run conditional on "is-packer").

We've had a myriad of problems with people remoting onto build agents in the past to debug builds, then not cleaning up after themselves. Shifting to buildkite is new for us, and so we're going to be treating the infrastructure much more like cattle.

The idea of setting up goss as a health check, then having a load-balancer continuously ping it, and trigger the node to be burned if it fails too many health checks in a row is a really compelling idea.

I think, that said, it's a problem better solved by config management.

That said, since I'm installing goss via config management, it would be convenient to be able to tell the plugin to use the goss that I install, rather than going out to fetch it. I had a look and didn't see that that was currently possible; is it?

fishnix commented 3 years ago

closing old issues, reopen if still interested 👍