~egtann/inv2ips

utility to extract ips from a service defined in inventory.json
84b5456a — Evan Tann 2 months ago
update cmd syntax, add man pages, install instructions
0bc9c442 — Evan Tann 2 months ago
rename module to inv2ips, remove up dependency
e506b4ea — Evan Tann 5 months ago
update module path

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~egtann/inv2ips
read/write
git@git.sr.ht:~egtann/inv2ips

You can also use your local clone with git send-email.

#inv2ips(1)

inv2ips(1) is a small utility that outputs CSV IP addresses for a given service name.

#Install

$ git clone git@git.sr.ht:~egtann/inv2ips
$ sudo make install

Check the man pages for inv2ips(1) and inventory.json(5) for detailed usage information and examples.

#Usage

Given an inventory.json file that looks like this:

{
	"my-app": ["10.128.0.1", "10.128.0.2"]
}
$ inv2ips my-app
10.128.0.1,10.128.0.2

This may be useful to dynamically update addresses in environment files or flags using their service names, such as appending them to a config file during deploy:

$ echo "IPS=$(inv2ips -p 3000 inventory)" >> config.env

It may also be useful when combined with Up to deploy services or environments by name:

$ up -t $(inv2ips production) deploy