Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configurable defaults for chef-solo & chef-client paths.
This commit adds 3 new tunables: 1 for all Chef provisioners, 1 for `chef_solo`, and 1 for `chef_zero` and builds on @sethvargo's previous commit. **:chef_omnibus_root** which defaults to `"/opt/chef"` is the location in which Kitchen will check when determining if a Chef Omnibus package is installed. Modifying this attribute will allow users to use alternative Omnibus packages and is most likely always reasonable with its default value. **:chef_solo_path** is used with the `chef_solo` provisioner, and is the full path on the remote instance to the `chef-solo` binary, and by default is calculated using the `:chef_omnibus_root` attribute as its base. For example, if the Omnibus root is `"/opt/chef"`, then the `:chef_solo_path` value will be calculated as `"/opt/chef/bin/chef-solo"`. If the `chef-solo` command is located elsewhere, this value can be set in a provisioner block to override the default. For example, setting this attribute to `"chef-solo"` will invoke the command without an absolute path and rely on `$PATH` lookup. **:chef_client_path** is used with the `chef_zero` provisioner, and is the full path on the remote instance to the `chef-client` binary, and by default is calculated using the `:chef_omnibus_root` attribute as its base. For example, if the Omnibus root is `"/opt/chef"`, then the `:chef_client_path` value will be calculated as `"/opt/chef/bin/chef-client"`. If the `chef-client` command is located elsewhere, this value can be set in a provisioner block to override the default. For example, setting this attribute to `"chef-client"` will invoke the command without an absolute path an rely on `$PATH` lookup. Here is a concrete example of overriding `:chef_solo_path` and `chef_client_path` in a `.kitchen.yml` file: --- driver: name: vagrant platforms: - name: ubuntu-14.04-solo provisioner: name: chef_solo chef_solo_path: /mnt/alt/bin/chef-solo - name: ubuntu-14.04-client provisioner: name: chef_zero chef_client_path: /bin/chef-client suites: - name: default **Warning:** previous logic used a non-absolute path to invoke both `chef-solo` and `chef-zero` which means that this commit has the potential to cause some Kitchen runs to fail, assuming that the Chef being invoked before was not actually `/opt/chef/bin/chef-solo` or `/opt/chef/bin/chef-client`. In this case, users can override the new computed default with a value of `"chef-solo"` or `"chef-client"` to exactly preserve previous behavior.
- Loading branch information
Showing
6 changed files
with
38 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters