Utility to extract IPs from a service defined in inventory.json
- Go 82.3%
- Makefile 17.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| man | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| Makefile | ||
| README.md | ||
inv2ips(1)
inv2ips(1) is a small utility that outputs CSV IP addresses for a given service name.
Install
$ git clone ssh://git@git.evantann.com:2222/egtann/inv2ips.git
$ 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