This repository has been archived by the owner on Oct 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniele Sluijters
committed
Mar 13, 2014
1 parent
c73b8b6
commit 1a0b0bc
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
################ | ||
puppetdb-stencil | ||
################ | ||
|
||
When passed one or more resource types those resources are rendered through templates. The templates are loaded based on a template matching the exact resource type name with a .jinja2 extension or an optionally passed template. | ||
|
||
.. code-block:: bash | ||
$ python puppetdb-stencil.py mytype | ||
A more complex example that renders multiple types through a shared template: | ||
|
||
.. code-block:: bash | ||
$ python puppetdb-stencil.py nagios_host nagios_hostgroup -t examples/nagios_.jinja2 | ||
Template selection | ||
------------------ | ||
|
||
The jinja2 loader is used to first search in the current directory and then the absolute path. This is done for every template specified. A template name is generated for the current resource type name. | ||
|
||
.. code-block:: bash | ||
$ python puppetdb-stencil.py nagios_host -t examples/nagios_.jinja2 | ||
This looks in these places: | ||
|
||
* ``nagios_host.jinja2`` | ||
* ``/nagios_host.jinja2`` | ||
* ``examples/nagios_.jinja2`` | ||
* ``/examples/nagios_.jinja2`` | ||
|
||
Installation | ||
------------ | ||
|
||
This project requires pypuppetdb and Jinja2 to function. On Python 2.6 it additionally requires argparse. | ||
|
||
.. code-block:: bash | ||
$ pip install -r requirements.txt |