blob: 73cdb83bf9bc7fac5be13373bec6b5a9c687c8a8 [file] [log] [blame]
Filip Pytloun49768a42015-10-06 16:28:32 +02001
Aleš Komárek586daae2017-02-06 19:47:06 +01002===============
Ales Komareka4f836f2017-05-17 13:12:51 +02003Reclass Formula
Aleš Komárek586daae2017-02-06 19:47:06 +01004===============
Filip Pytloun49768a42015-10-06 16:28:32 +02005
Ales Komarek51e459c2017-02-19 08:47:46 +01006reclass is an external node classifier (ENC) as can be used with automation
7tools, such as Puppet, Salt, and Ansible. It is also a stand-alone tool for
8merging data sources recursively.
9
Filip Pytloun49768a42015-10-06 16:28:32 +020010
Ales Komareka4f836f2017-05-17 13:12:51 +020011Sample Metadata
12===============
Filip Pytloun49768a42015-10-06 16:28:32 +020013
14Reclass storage with data fetched from git
15
Ales Komarek51e459c2017-02-19 08:47:46 +010016.. literalinclude:: tests/pillar/storage_git.sls
17 :language: yaml
Filip Pytloun49768a42015-10-06 16:28:32 +020018
19Reclass storage with local data source
20
Ales Komarek51e459c2017-02-19 08:47:46 +010021.. literalinclude:: tests/pillar/storage_local.sls
22 :language: yaml
Filip Pytloun49768a42015-10-06 16:28:32 +020023
Ales Komarekf0942d72017-05-23 10:10:37 +020024Reclass storage with archive data source
25
26.. literalinclude:: tests/pillar/storage_archive.sls
27 :language: yaml
28
29Reclass storage with archive data source with content hash check
30
31.. literalinclude:: tests/pillar/storage_archive_public.sls
32 :language: yaml
33
Ales Komareka4a9f572016-12-03 20:15:50 +010034Reclass model with single node definition
35
Ales Komarek51e459c2017-02-19 08:47:46 +010036.. literalinclude:: tests/pillar/generate_single.sls
37 :language: yaml
Ales Komareka4a9f572016-12-03 20:15:50 +010038
39Reclass model with multiple node defined
40
Ales Komarek51e459c2017-02-19 08:47:46 +010041.. literalinclude:: tests/pillar/generate_multi.sls
42 :language: yaml
Ales Komareka4a9f572016-12-03 20:15:50 +010043
Ales Komareka4f836f2017-05-17 13:12:51 +020044Reclass storage with simple class mappings
Filip Pytloun49768a42015-10-06 16:28:32 +020045
Ales Komarek51e459c2017-02-19 08:47:46 +010046.. literalinclude:: tests/pillar/class_mapping.sls
47 :language: yaml
Filip Pytloun49768a42015-10-06 16:28:32 +020048
Ales Komareka4f836f2017-05-17 13:12:51 +020049Reclass models with dynamic node classification
Filip Pytloun49768a42015-10-06 16:28:32 +020050
Ales Komareka4f836f2017-05-17 13:12:51 +020051.. literalinclude:: tests/pillar/node_classify.sls
52 :language: yaml
53
Ales Komarek052aea12017-08-21 14:17:32 +020054Classify 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
66Event 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
79Event to trigger the node declassification
80
81.. code-block:: bash
82
83 salt-call event.send 'reclass/minion/declassify'
84
Ales Komareka4f836f2017-05-17 13:12:51 +020085
86More Information
87================
Filip Pytloun49768a42015-10-06 16:28:32 +020088
89* http://reclass.pantsfullofunix.net/index.html
90* http://reclass.pantsfullofunix.net/operations.html
Ales Komarek51e459c2017-02-19 08:47:46 +010091
Filip Pytloun2ea4e6a2017-02-02 13:02:03 +010092
93Documentation and Bugs
94======================
95
96To learn how to install and update salt-formulas, consult the documentation
97available online at:
98
99 http://salt-formulas.readthedocs.io/
100
101In the unfortunate event that bugs are discovered, they should be reported to
102the appropriate issue tracker. Use Github issue tracker for specific salt
103formula:
104
105 https://github.com/salt-formulas/salt-formula-reclass/issues
106
107For feature requests, bug reports or blueprints affecting entire ecosystem,
108use Launchpad salt-formulas project:
109
110 https://launchpad.net/salt-formulas
111
112You can also join salt-formulas-users team and subscribe to mailing list:
113
114 https://launchpad.net/~salt-formulas-users
115
116Developers wishing to work on the salt-formulas projects should always base
117their work on master branch and submit pull request against specific formula.
118
119 https://github.com/salt-formulas/salt-formula-reclass
120
121Any questions or feedback is always welcome so feel free to join our IRC
122channel:
123
124 #salt-formulas @ irc.freenode.net