No Description

Philip Walls 4a51fa328c Add more examples and a README file. 9 years ago
examples 4a51fa328c Add more examples and a README file. 9 years ago
README 4a51fa328c Add more examples and a README file. 9 years ago
rolegen.py 0b6061e904 Add support for depends/before on ALL roles. 9 years ago
test_rolegen.py c8bf9cbb8c Move rolegen to a new repository. 9 years ago

README

[ Synopsis ]

Generates roles.conf files for slack from a YAML file


[ Usage ]

Get more detailed usage:

$ ./rolegen.py --help

Generate a roles.conf file from YAML:

$ ./rolegen.py -i examples/complex.yaml -o /tmp/roles.conf

To display a visual representation of the dependency graph:

$ ./rolegen.py -i examples/complex.yaml -g

List all hosts of a certain role:

$ ./rolegen.py -i examples/complex.yaml -r role1

List all roles in dependency order:

$ ./rolegen.py -i examples/complex.yaml -l

List all roles implied by a virtual:

$ ./rolegen.py -i examples/complex.yaml -v virtual1

List roles for a host in dependency order:

$ ./rolegen.py -i examples/complex.yaml -s host1


[ Configuration format ]

The configuration format is standard YAML: http://yaml.org/spec/current.html

The basic structure of the configuration file is:

hosts:
:
roles:
-
-

The roles can also be defined in the opposite way:

roles:
:
hosts:
-
-

In standard YAML form, lists can also be condensed into a single line:

roles:
:
hosts: [ , ]


[ Virtuals ]

Virtuals allow you to group multiple roles into a single alias.

virtuals:
:
roles:
-
-


[ Dependencies ]

Roles defined under the "roles" and "virtuals" sections can have dependencies
associated with them. The dependency keywords are "before" and "depends".

roles:
:
depends:
-
-
before:
-

Hosts can be added along dependencies or separately under the "hosts" section.

There is also an @ALL@ keyword which can be used to make a certain role be
topologically sorted before or after all other roles:

roles:
:
before:
- @ALL@

This can be used to push out a role containing common scripts so that they can
be used from all other roles.


[ Domain name ]

If you define a domain name in the YAML file, it will be appended to all hosts
throughout the rest of the configuration file.

domain: example.com