-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #288 from nornir-automation/develop
Release 2.0.0
- Loading branch information
Showing
187 changed files
with
6,679 additions
and
2,552 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 |
---|---|---|
|
@@ -101,5 +101,6 @@ output/ | |
.DS_Store | ||
|
||
.pytest_cache/ | ||
.mypy_cache/ | ||
|
||
.vscode |
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,11 @@ | ||
--- | ||
build: | ||
image: latest | ||
|
||
python: | ||
version: 3.6 | ||
pip_install: true | ||
|
||
formats: [] | ||
|
||
requirements_file: docs/requirements.txt |
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
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
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
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
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 |
---|---|---|
@@ -1,29 +1,29 @@ | ||
The configuration parameters will be set by the :doc:`Nornir.core.configuration.Config </ref/api/configuration>` class. | ||
{% macro document_section(section, schema) %} | ||
{{ section }} | ||
{{ "-" * section|length }} | ||
|
||
{% for k, v in params|dictsort %} | ||
---------- | ||
{% for k, v in schema["properties"].items() -%} | ||
|
||
{{ k }} | ||
---------------------------------- | ||
``{{ k }}`` | ||
{{ "_" * (k|length + 4) }} | ||
|
||
.. list-table:: | ||
:widths: 15 85 | ||
|
||
.. raw:: html | ||
* - **Description** | ||
- {{ v["description"] }} | ||
* - **Type** | ||
- ``{{ v["type"] }}`` | ||
* - **Default** | ||
- {{ "``{}``".format(v["default"]) if v["default"] else "" }} | ||
* - **Required** | ||
- ``{{ v["required"] or false }}`` | ||
* - **Environment Variable** | ||
- ``{{ "NORNIR_{}_{}".format(section, k).upper() }}`` | ||
|
||
<table border="1" class="docutils"> | ||
<th>Environment variable</th> | ||
<th>Type</th> | ||
<th>Default</th> | ||
<tr> | ||
{% if v['type'] in ('str', 'int', 'bool') %} | ||
<td>{{ v['env'] or 'BRIGADE_' + k|upper }}</td> | ||
{% else %} | ||
<td>N/A</td> | ||
{% endif %} | ||
<td>{{ v['type'] }}</td> | ||
<td>{{ v['default_doc'] or v['default'] }}</td> | ||
</tr> | ||
</table> | ||
|
||
{{ v['description'] }} | ||
{% endfor %} | ||
{%- endmacro %} | ||
|
||
{% for k, v in schema["properties"].items() if k not in ["user_defined"] %} | ||
{{ document_section(k, v) }} | ||
{% endfor %} |
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
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 |
---|---|---|
@@ -1,10 +1,25 @@ | ||
Configuration | ||
============= | ||
|
||
Each configuration parameter are applied in the following order: | ||
The configuration is comprised of a set of sections and parameters for those sections. You can set the configuration programmatically using nornir by passing a dictionary of options for each section, by using a YAML file, by setting the corresponding environment variables or by a combination of the three. The order of preference from less to more preferred is "configuration file" -> "env variable" -> "code". | ||
|
||
1. Environment variable | ||
2. Parameter in configuration file / object | ||
3. Default value | ||
An example using ``InitNornir`` would be:: | ||
|
||
nr = InitNornir( | ||
core={"num_workers": 20}, | ||
logging={"file": "mylogs", "level": "debug"} | ||
) | ||
|
||
A similar example using a ``yaml`` file: | ||
|
||
.. include:: ../howto/advanced_filtering/config.yaml | ||
:code: yaml | ||
|
||
Next, you can find each section and their corresponding options. | ||
|
||
.. include:: generated/parameters.rst | ||
|
||
user_defined | ||
------------ | ||
|
||
You can set any ``<k, v>`` pair you want here and you will have it available under your configuration object, i.e. ``nr.config.user_defined.my_app_option``. |
Oops, something went wrong.