blob: 66883b8fb119e36bde882cc52ae17e2232f6b8ba [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 Komarek968ebba2017-08-24 15:46:29 +020044Reclass model with multiple node defined and interpolation enabled
45
46.. literalinclude:: tests/pillar/generate_multi_interpolate.sls
47 :language: yaml
48
Ales Komareka4f836f2017-05-17 13:12:51 +020049Reclass storage with simple class mappings
Filip Pytloun49768a42015-10-06 16:28:32 +020050
Ales Komarek51e459c2017-02-19 08:47:46 +010051.. literalinclude:: tests/pillar/class_mapping.sls
52 :language: yaml
Filip Pytloun49768a42015-10-06 16:28:32 +020053
Ales Komareka4f836f2017-05-17 13:12:51 +020054Reclass models with dynamic node classification
Filip Pytloun49768a42015-10-06 16:28:32 +020055
Ales Komareka4f836f2017-05-17 13:12:51 +020056.. literalinclude:: tests/pillar/node_classify.sls
57 :language: yaml
58
Ales Komarek052aea12017-08-21 14:17:32 +020059Classify node after creation and unclassify on node deletion
60
61.. code-block:: yaml
62
63 salt:
64 master:
65 reactor:
66 reclass/minion/classify:
67 - salt://reclass/reactor/node_register.sls
68 reclass/minion/declassify:
69 - salt://reclass/reactor/node_unregister.sls
70
71Event to trigger the node classification
72
73.. code-block:: bash
74
75 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'}"
76
77.. note::
78
79 You can send any parameters in the event payload, all will be checked
80 against dynamic node classification conditions.
81
82 Both actions will use the minion ID as the node_name to be updated.
83
84Event to trigger the node declassification
85
86.. code-block:: bash
87
88 salt-call event.send 'reclass/minion/declassify'
89
Ales Komareka4f836f2017-05-17 13:12:51 +020090
91More Information
92================
Filip Pytloun49768a42015-10-06 16:28:32 +020093
94* http://reclass.pantsfullofunix.net/index.html
95* http://reclass.pantsfullofunix.net/operations.html
Ales Komarek51e459c2017-02-19 08:47:46 +010096
Filip Pytloun2ea4e6a2017-02-02 13:02:03 +010097
98Documentation and Bugs
99======================
100
101To learn how to install and update salt-formulas, consult the documentation
102available online at:
103
104 http://salt-formulas.readthedocs.io/
105
106In the unfortunate event that bugs are discovered, they should be reported to
107the appropriate issue tracker. Use Github issue tracker for specific salt
108formula:
109
110 https://github.com/salt-formulas/salt-formula-reclass/issues
111
112For feature requests, bug reports or blueprints affecting entire ecosystem,
113use Launchpad salt-formulas project:
114
115 https://launchpad.net/salt-formulas
116
117You can also join salt-formulas-users team and subscribe to mailing list:
118
119 https://launchpad.net/~salt-formulas-users
120
121Developers wishing to work on the salt-formulas projects should always base
122their work on master branch and submit pull request against specific formula.
123
124 https://github.com/salt-formulas/salt-formula-reclass
125
126Any questions or feedback is always welcome so feel free to join our IRC
127channel:
128
129 #salt-formulas @ irc.freenode.net