pinpox / lollypops

Lollypop Operations - NixOS Deployment Tool
https://pinpox.github.io/lollypops/
GNU General Public License v3.0
118 stars 17 forks source link

feature request: Support for groups and/or tags? #26

Closed justyns closed 8 months ago

justyns commented 8 months ago

I'd like to be able to deploy to a group of hosts in parallel. Currently, I can run nix run . -- all and it works to deploy to all servers as expected. However, sometimes I only want to deploy to a set of servers at one time. E.g. something like nix run . -- web_servers.

I'm not sure how this would look in the config, maybe just a new option named 'group' or something simple like that? A list of tags could also work.

Apologies if this is already possible somehow, but I couldn't figure it out.

pinpox commented 8 months ago

Hello!

This is partly already possible, by just specifying multiple servers. You can run something like:

nix run . -- host1 host2 host3 --parallel

and it will deploy the three hosts in parallel.

Still you are right, it might be a good idea to have predefined groups or tags, I would have to look at how that could be implemented. If you have any ideas, I'm happy to review pull-requests, it should be backwards-compatible though.

justyns commented 8 months ago

Hello!

nix run . -- host1 host2 host3 --parallel

This does work great, the only issue I have is it getting cumbersome when there are more than a handful of hosts.

I opened up a PR that adds a group name option. It seemed like the simplest solution to me, but I'm not super familiar with nix or go-task. Instead of nix run . -- db1 db2 db3, I can run nix run . -- db assuming they all have group = "db".

I'm happy to change it though if you have any other ideas

pinpox commented 8 months ago

Implemented by #27