Chapter 09/circuit-oneops-1-master/components/cookbooks/f5-bigip/libraries/provider_ltm_virtual_server.rb
#
# Add any missing profiles associated with current_resource
#
Add any missing profiles associated with current_resource
Add any missing profiles associated with current_resource
def add_profiles
        matching_profiles = new_resource.profiles & current_resource.profiles
        missing_profiles = new_resource.profiles - matching_profiles
        return if missing_profiles.empty?
        converge_by("Adding profiles to #{new_resource}") do
          Chef::Log.info("Adding profiles to #{new_resource}")
          load_balancer.client['LocalLB.VirtualServer'].add_profile([new_resource.vs_name], [missing_profiles])
          current_resource.profiles(new_resource.profiles)
          new_resource.updated_by_last_action(true)
        end
      end
def add_profiles matching_profiles = new_resource . profiles & current_resource . profiles missing_profiles = new_resource . profiles - matching_profiles return if missing_profiles . empty? converge_by ( "Adding profiles to #{new_resource}" ) do Chef :: Log . info ( "Adding profiles to #{new_resource}" ) load_balancer . client [ 'LocalLB.VirtualServer' ] . add_profile ( [ new_resource . vs_name ] , [ missing_profiles ] ) current_resource . profiles ( new_resource . profiles ) new_resource . updated_by_last_action ( true ) end end
Add any missing profiles associated with current_resource
Add any missing profiles associated with current_resource