An open API service indexing awesome lists of open source software.

https://github.com/ceejbot/dirac

command-line tool for adding & removing hosts from ansible inventory
https://github.com/ceejbot/dirac

Last synced: 8 months ago
JSON representation

command-line tool for adding & removing hosts from ansible inventory

Awesome Lists containing this project

README

          

# @ceejbot/dirac

Add and remove hosts from ansible inventory files.

Parses existing files & preserves whitespace & comments.

[![on npm](http://img.shields.io/npm/v/@ceejbot/dirac.svg?style=flat)](https://www.npmjs.org/package/@ceejbot/dirac) [![Tests](http://img.shields.io/travis/ceejbot/dirac.svg?style=flat)](http://travis-ci.org/ceejbot/dirac) [![Coverage](http://img.shields.io/coveralls/ceejbot/dirac.svg?style=flat)](https://coveralls.io/r/ceejbot/dirac)

## Usage

Install: `npm install -g @ceejbot/dirac`

Then run:

```
cat /path/to/inventory | dirac [--var name=val] [--group groupname] foo.example.com > output

Options:
--remove remove this host from inventory; all other options ignored [boolean]
--group, -g one or more groups to add this host to [default: "generic"]
--var, -v host vars to set; name=val format
--version show version information [boolean]
--help Show help [boolean]
```

You can specify as many `var` and `group` options as you need.

## Notes

The Dirac Communicator is James Blish's name for an ansible-like communication device.

## TODO

Handle variables better.

## LICENSE

ISC.