Filip Pytloun | 49768a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 1 | |
Aleš Komárek | 586daae | 2017-02-06 19:47:06 +0100 | [diff] [blame] | 2 | =============== |
Ales Komarek | a4f836f | 2017-05-17 13:12:51 +0200 | [diff] [blame] | 3 | Reclass Formula |
Aleš Komárek | 586daae | 2017-02-06 19:47:06 +0100 | [diff] [blame] | 4 | =============== |
Filip Pytloun | 49768a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 5 | |
Ales Komarek | 51e459c | 2017-02-19 08:47:46 +0100 | [diff] [blame] | 6 | reclass is an “external node classifier” (ENC) as can be used with automation |
| 7 | tools, such as Puppet, Salt, and Ansible. It is also a stand-alone tool for |
| 8 | merging data sources recursively. |
| 9 | |
Filip Pytloun | 49768a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 10 | |
Ales Komarek | a4f836f | 2017-05-17 13:12:51 +0200 | [diff] [blame] | 11 | Sample Metadata |
| 12 | =============== |
Filip Pytloun | 49768a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 13 | |
| 14 | Reclass storage with data fetched from git |
| 15 | |
Ales Komarek | 51e459c | 2017-02-19 08:47:46 +0100 | [diff] [blame] | 16 | .. literalinclude:: tests/pillar/storage_git.sls |
| 17 | :language: yaml |
Filip Pytloun | 49768a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 18 | |
| 19 | Reclass storage with local data source |
| 20 | |
Ales Komarek | 51e459c | 2017-02-19 08:47:46 +0100 | [diff] [blame] | 21 | .. literalinclude:: tests/pillar/storage_local.sls |
| 22 | :language: yaml |
Filip Pytloun | 49768a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 23 | |
Ales Komarek | f0942d7 | 2017-05-23 10:10:37 +0200 | [diff] [blame] | 24 | Reclass storage with archive data source |
| 25 | |
| 26 | .. literalinclude:: tests/pillar/storage_archive.sls |
| 27 | :language: yaml |
| 28 | |
| 29 | Reclass storage with archive data source with content hash check |
| 30 | |
| 31 | .. literalinclude:: tests/pillar/storage_archive_public.sls |
| 32 | :language: yaml |
| 33 | |
Ales Komarek | a4a9f57 | 2016-12-03 20:15:50 +0100 | [diff] [blame] | 34 | Reclass model with single node definition |
| 35 | |
Ales Komarek | 51e459c | 2017-02-19 08:47:46 +0100 | [diff] [blame] | 36 | .. literalinclude:: tests/pillar/generate_single.sls |
| 37 | :language: yaml |
Ales Komarek | a4a9f57 | 2016-12-03 20:15:50 +0100 | [diff] [blame] | 38 | |
| 39 | Reclass model with multiple node defined |
| 40 | |
Ales Komarek | 51e459c | 2017-02-19 08:47:46 +0100 | [diff] [blame] | 41 | .. literalinclude:: tests/pillar/generate_multi.sls |
| 42 | :language: yaml |
Ales Komarek | a4a9f57 | 2016-12-03 20:15:50 +0100 | [diff] [blame] | 43 | |
Ales Komarek | a4f836f | 2017-05-17 13:12:51 +0200 | [diff] [blame] | 44 | Reclass storage with simple class mappings |
Filip Pytloun | 49768a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 45 | |
Ales Komarek | 51e459c | 2017-02-19 08:47:46 +0100 | [diff] [blame] | 46 | .. literalinclude:: tests/pillar/class_mapping.sls |
| 47 | :language: yaml |
Filip Pytloun | 49768a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 48 | |
Ales Komarek | a4f836f | 2017-05-17 13:12:51 +0200 | [diff] [blame] | 49 | Reclass models with dynamic node classification |
Filip Pytloun | 49768a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 50 | |
Ales Komarek | a4f836f | 2017-05-17 13:12:51 +0200 | [diff] [blame] | 51 | .. literalinclude:: tests/pillar/node_classify.sls |
| 52 | :language: yaml |
| 53 | |
Ales Komarek | 052aea1 | 2017-08-21 14:17:32 +0200 | [diff] [blame^] | 54 | Classify node after creation and unclassify on node deletion |
| 55 | |
| 56 | .. code-block:: yaml |
| 57 | |
| 58 | salt: |
| 59 | master: |
| 60 | reactor: |
| 61 | reclass/minion/classify: |
| 62 | - salt://reclass/reactor/node_register.sls |
| 63 | reclass/minion/declassify: |
| 64 | - salt://reclass/reactor/node_unregister.sls |
| 65 | |
| 66 | Event to trigger the node classification |
| 67 | |
| 68 | .. code-block:: bash |
| 69 | |
| 70 | salt-call event.send 'reclass/minion/classify' "{'node_master_ip': '$config_host', 'node_ip': '${node_ip}', 'node_domain': '$node_domain', 'node_cluster': '$node_cluster', 'node_hostname': '$node_hostname', 'node_os': '$node_os'}" |
| 71 | |
| 72 | .. note:: |
| 73 | |
| 74 | You can send any parameters in the event payload, all will be checked |
| 75 | against dynamic node classification conditions. |
| 76 | |
| 77 | Both actions will use the minion ID as the node_name to be updated. |
| 78 | |
| 79 | Event to trigger the node declassification |
| 80 | |
| 81 | .. code-block:: bash |
| 82 | |
| 83 | salt-call event.send 'reclass/minion/declassify' |
| 84 | |
Ales Komarek | a4f836f | 2017-05-17 13:12:51 +0200 | [diff] [blame] | 85 | |
| 86 | More Information |
| 87 | ================ |
Filip Pytloun | 49768a4 | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 88 | |
| 89 | * http://reclass.pantsfullofunix.net/index.html |
| 90 | * http://reclass.pantsfullofunix.net/operations.html |
Ales Komarek | 51e459c | 2017-02-19 08:47:46 +0100 | [diff] [blame] | 91 | |
Filip Pytloun | 2ea4e6a | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 92 | |
| 93 | Documentation and Bugs |
| 94 | ====================== |
| 95 | |
| 96 | To learn how to install and update salt-formulas, consult the documentation |
| 97 | available online at: |
| 98 | |
| 99 | http://salt-formulas.readthedocs.io/ |
| 100 | |
| 101 | In the unfortunate event that bugs are discovered, they should be reported to |
| 102 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 103 | formula: |
| 104 | |
| 105 | https://github.com/salt-formulas/salt-formula-reclass/issues |
| 106 | |
| 107 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 108 | use Launchpad salt-formulas project: |
| 109 | |
| 110 | https://launchpad.net/salt-formulas |
| 111 | |
| 112 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 113 | |
| 114 | https://launchpad.net/~salt-formulas-users |
| 115 | |
| 116 | Developers wishing to work on the salt-formulas projects should always base |
| 117 | their work on master branch and submit pull request against specific formula. |
| 118 | |
| 119 | https://github.com/salt-formulas/salt-formula-reclass |
| 120 | |
| 121 | Any questions or feedback is always welcome so feel free to join our IRC |
| 122 | channel: |
| 123 | |
| 124 | #salt-formulas @ irc.freenode.net |