Chapter 09/circuit-oneops-1-master/components/cookbooks/f5-bigip/libraries/provider_ltm_pool.rb
#
# Create a new pool given new_resource attributes
#
Create a new pool given new_resource attributes
Create a new pool given new_resource attributes
def create_pool
        converge_by("Create #{new_resource} pool") do
          Chef::Log.info "Create #{new_resource} pool"
          members = new_resource.members.map do |member|
            { 'address' => member['address'], 'port' => member['port'] }
          end
          load_balancer.client['LocalLB.Pool'].create_v2([new_resource.pool_name], [new_resource.lb_method], [members])
          current_resource.lb_method(new_resource.lb_method)
          current_resource.members(new_resource.members)
          current_resource.monitors([])
          new_resource.updated_by_last_action(true)
        end
      end
def create_pool converge_by ( "Create #{new_resource} pool" ) do Chef :: Log . info "Create #{new_resource} pool" members = new_resource . members . map do | member | { 'address' => member [ 'address' ] , 'port' => member [ 'port' ] } end load_balancer . client [ 'LocalLB.Pool' ] . create_v2 ( [ new_resource . pool_name ] , [ new_resource . lb_method ] , [ members ] ) current_resource . lb_method ( new_resource . lb_method ) current_resource . members ( new_resource . members ) current_resource . monitors ( [ ] ) new_resource . updated_by_last_action ( true ) end end
Create a new pool given new_resource attributes
Create a new pool given new_resource attributes