Chef Sugar Extensions useful if you use Rackspace as a provider
Include it in your Chef recipes:
include_recipe 'chef-sugar-rackspace::default'
Rackconnect helpers require the Rackconnect Ohai plugin to be installed.
rackconnected?
- return true if the node is rackconnected
####Note If the rackconnect plugin is not installed but the helper is called rackconnected? will return false. This should not be an issue in most cases but could cause unexepected results on a rackconnected server.
unless rackconnected?
include_recipes 'firewall'
end
cloud_network_ip
- return the node's ip from a Rackspace cloud networkbest_rackspace_ip_for
- determine the best IP address for a given node, preferring a cloud network IP addresscloud_networks
- return Rackspace cloud networks as a Hash with each key being a cloud network label
node.set['redis']['bind'] = cloud_network_ip
cloud_network_ip takes an optional argument of the Cloud Network Label
node.set['redis']['bind'] = cloud_network_ip('mycloudnetwork')
Prefers a connected Rackspace cloud network IP but falls through to using the default Chef Sugar best_ip_for() method if one does not exist.
memcached = search('node', 'tags:memcached').first
memcahed_ip = best_rackspace_ip_for(memcached)
private_networks = cloud_networks
- Author: Jim Rosser (jarosser06@gmail.com)
copyright (C) 2015 Jim Rosser
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.