wordpress-cookbook
wordpress-cookbook copied to clipboard
Make the cookbook easier to wrap
The following changes make it easier to wrap the wordpress cookbook and control its behaviour:
-
node.set_unlessdoesn't do what you might think it does (http://tickets.opscode.com/browse/CHEF-2945), and setting normal attributes makes things awkward. This PR changes the use of set_unless to a guard clause which means that a normal attribute will only be set if no other type of attribute is set. A wrapper cookbook can E.g. load the attribute values from a vault item and set them as default attributes, without having them persist into the node attributes or be over-written by set_unless. - Add the
node['wordpress']['db']['install']attribute that allows the wrapper to control the MySQL installation. For example I'm installing into a cloud (GCE) instance and wish to use the GCE MySQL instance via. a socket, so I don't need a local MySQL instance and can set the attribute tofalseto disable it entirely. - A small fix to the
is_local_host?helper that allows it to recognise UNIX sockets in the formlocalhost:/path/to/socket