phansible/phansible — pull request #158 by sndpl (2014-12-13 14:35:24+00:00)
Title: proposal to fix #153

Hi,
this is a proposal to fix #153, this means not everything is working yet because I first want the opinion of @erikaheidi or @InFog or @naxhh what they think of this before I fix the rest of the roles.

So what did I do this time :) Well first I added 3 functions (they all will become private in the final version) to each role which can retrieve the following data:
* data.yml
the data a role expects
* initial.yml
Initial values for the above data.yml, only add entries for values we want to change.
* available.yml
Available options that are used in the twig templates. These options are now located in app/config/phansible but they belong to a role.

These new yml files will be located in src/Phansible/Resources/config/roles/.
So how to get this data? In the baseRole I also added a getData() function to retrieve this data.

The same function is also used to create the config data based on the requestVars. So instead of using the requestVars, I now first get the default data and merge it with the requestVars. This way values of checkboxes are always filled (since they don't appear in the requestVars when not checked).

What else does it fix?
* Roles are even cleaner now, some roles will only contain the protected vars.
* Vagrant role doesn't need the $app anymore because the role can retrieve it's own options (#148)

Any questions / comments are welcome :) and as said before it's a proof of concept, so not fully functional but good enough for a discussion :)