blob: 9a48d4babc0a09af11bf7a2c95059676808ead8b [file] [log] [blame]
martin f. krafftcc8851d2013-08-27 13:43:16 +02001==================
2reclass to-do list
3==================
4
martin f. krafftcbaf4c82013-08-27 13:47:59 +02005Common set of classes
6---------------------
7A lot of the classes I have set up during the various stages of development of
8|reclass| are generic. It would probably be sensible to make them available as
9part of |reclass|, to give people a common baseline to work from, and to
10ensure a certain level of consistency between users.
11
martin f. krafft2bdfffd2014-03-01 13:45:04 +010012This could also provide a more realistic example to users on how to use
13|reclass|.
14
martin f. krafftcc8851d2013-08-27 13:43:16 +020015Testing framework
16-----------------
17There is rudimentary testing in place, but it's inconsistent. I got
18side-tracked into discussions about the philosphy of mocking objects. This
19could all be fixed and unified.
20
21Also, storage, outputters, CLI and adapters have absolutely no tests yet…
22
martin f. krafft2bdfffd2014-03-01 13:45:04 +010023The testing framework should also incorporate the example classes mentioned
24above.
25
martin f. krafftcc8851d2013-08-27 13:43:16 +020026Configurable file extension
27---------------------------
28Right now, ``.yml`` is hard-coded. This could be exported to the
29configuration file, or even given as a list, so that ``.yml`` and ``.yaml``
30can both be used.
31
martin f. krafft2bdfffd2014-03-01 13:45:04 +010032Actually, I don't think this is such a good idea. If we create too many
33options right now, it'll be harder to unify later. Please also see `issue #17
34<https://github.com/madduck/reclass/issues/17`_ for a discussion about this.
35
martin f. krafftcc8851d2013-08-27 13:43:16 +020036Verbosity, debugging
37--------------------
38Verbose output and debug logging would be a very useful addition to help
39people understand what's going on, where data are being changed/merged, and to
40help solve problems.
41
martin f. krafftcc8851d2013-08-27 13:43:16 +020042Data from CMS for interpolation
43-------------------------------
44Depending on the CMS in question, it would be nice if |reclass| had access to
45the host-specific data (facts, grains, etc.) and could use those in parameter
46interpolation. I can imagine this working for Salt, where the ``grains``
47dictionary (and results from previous external node classifiers) is made
48available to the external node classifiers, but I am not convinced this will
49be possible in Ansible and Puppet.
50
martin f. krafft2bdfffd2014-03-01 13:45:04 +010051On the other hand, providing CMS-specific data to reclass will make people
52depend on it, meaning Salt cannot be used with multiple tools anymore.
53
54The way to deal with that would be to map grains, facts, whatever the CMS
55calls them, to a shared naming scheme/taxonomy, but that's a painful task,
56I think. It would mean, however, that even templates could be shared between
57CMSs if they only use the data provided by reclass (i.e. grains/facts become
58pillar data).
martin f. krafft3fe5f942013-08-27 15:58:51 +020059
martin f. krafft4ff12822013-08-28 11:51:17 +020060Membership information
61----------------------
62It would be nice if |reclass| could provide e.g. the Nagios master node with
63a list of clients that define it as their master. That would short-circuit
64Puppet's ``storeconfigs`` and Salt's ``mine``.
65
martin f. krafft2bdfffd2014-03-01 13:45:04 +010066The way I envision this currently is to provide something I call "inventory
67queries". For instance, the Nagios master node's reclass data would contain
68the following (``$[…]`` would denote interpolation to create a list, a bit
69like list comprehension)::
70
71 parameters:
72 nagios:
73 hosts: $[nagios:master == SELF.nodename]
74
75This would cause |reclass| to iterate the inventory and generate a list of all
76the nodes that define a parameter ``nagios:master`` whose value equals to the
77name of the current node.
78
79This could be greatly simplified. For instance, we could simply limit
80comparisons against the name of the current node and just specify
81
82::
83
84 $[nagios:master]
85
86which would be expanded to a list of node names whose pillar data includes
87``${nagios:master}`` that matches the current node's name.
88
89Or it could be made arbitrarily complex and flexible, e.g. any of the
90following::
91
92 $[nagios:master == SELF.nodename] # replace with nodename
93 $[nagios:master == SELF.nodename | nodename] # name replacement value
94 $[nagios:master == SELF.nodename | nagios:nodeid] # replace with pillar data
95 $[x:nagios:nodeid foreach x | x:nagios:master == SELF.nodename]
96
97
98I'd rather not code this up from scratch, so I am looking for ideas for reuse
99
martin f. krafft54bb4722013-12-26 14:47:19 +1300100Configuration file lookup improvements
101--------------------------------------
102Right now, the adapters and the CLI look for the :doc:`configuration file
103<configfile>` in a fixed set of locations. On of those derives from
104``OPT_INVENTORY_BASE_URI``, the default inventory base URI (``/etc/reclass``).
105This should probably be updated in case the user changes the URI.
106
107Furthermore, ``$CWD`` and ``~`` might not make a lot of sense in all
108use-cases.
109
martin f. krafft2bdfffd2014-03-01 13:45:04 +0100110However, this might be better addressed by the following point:
111
112Adapter class hierarchy
113-----------------------
114At the moment, adapters are just imperative code. It might make more sense to
115wrap them in classes, which customise things like command-line and config file
116parsing.
117
118One nice way would be to generalise configuration file reading, integrate it
119with command-line parsing, and then allow the consumers (the adapters) to
120configure them, for instance, in the Salt adapter::
121
122 config_proxy = ConfigProxy()
123 config_proxy.set_configfile_search_path(['/etc/reclass', '/etc/salt'])
124 config_proxy.lock_config_option('output', 'yaml')
125
126The last call would effectively remove the ``--output`` config option from the
127CLI, and yield an error (or warning) if the option was encountered while
128parsing the configuration file.
129
130Furthermore, the class instances could become long-lived and keep a reference
131to a storage proxy, e.g. to prevent having to reload storage on every request.
132
133Node lists
134----------
135Class mappings are still experimental, and one of the reasons I am not too
136happy with them right now is that one would still need to provide node files
137for all nodes for ``inventory`` invocations. This is because class mappings
138can assign classes based on patterns or regular expressions, but it is not
139possible to turn a pattern or regular expression into a list of valid nodes.
140
141`Issue #9 <https://github.com/madduck/reclass/issues/9>`_ contains a lengthy
142discussion on this. At the moment, I am unsure what the best way forward is.
143
144Inventory filters
145-----------------
146As described in `issue #11 <https://github.com/madduck/reclass/issues/11>`_:
147provide a means to limit the enumeration of the inventory, according to node
148name patterns, or using classes white-/blacklists.
149
martin f. krafft3fe5f942013-08-27 15:58:51 +0200150.. include:: substs.inc