wordpress-cookbook icon indicating copy to clipboard operation
wordpress-cookbook copied to clipboard

Make the cookbook easier to wrap

Open Vanders opened this issue 9 years ago • 0 comments

The following changes make it easier to wrap the wordpress cookbook and control its behaviour:

  1. node.set_unless doesn'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.
  2. 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 to false to disable it entirely.
  3. A small fix to the is_local_host? helper that allows it to recognise UNIX sockets in the form localhost:/path/to/socket

Vanders avatar May 26 '16 07:05 Vanders