chef/cookbooks/pacemaker/libraries/chef/mixin/pacemaker/standard_cib_object.rb
# In Pacemaker, target-role defaults to 'Started', but we want
# to allow consumers of the LWRPs the choice whether their
# newly created resource gets started or not, and we also want
# to adhere to the Principle of Least Surprise.  Therefore we
# stick to the intuitive semantics that
#
#   action :create
#
# creates the resource with target-role="Stopped" in order to
# prevent it from starting immediately, whereas
#
#   action [:create, :start]
#
# creates the resource and then starts it.
#
# Consequently we deprecate setting target-role values directly
# via the meta attribute.
In Pacemaker, target-role defaults to 'Started', but we want
to allow consumers of the LWRPs the choice whether their
newly created resource gets started or not, and we also want
to adhere to the Principle of Least Surprise.  Therefore we
stick to the intuitive semantics that

action :create

creates the resource with target-role="Stopped" in order to
prevent it from starting immediately, whereas

action [:create, :start]

creates the resource and then starts it.

Consequently we deprecate setting target-role values directly
via the meta attribute.
In Pacemaker target - role defaults to ' Started ' but we want to allow consumers of the LWRPs the choice whether their newly created resource gets started or not and we also want to adhere to the Principle of Least Surprise . Therefore we stick to the intuitive semantics that action : create creates the resource with target - role = " Stopped " in order to prevent it from starting immediately whereas action [ : create : start ] creates the resource and then starts it . Consequently we deprecate setting target - role values directly via the meta attribute .
def deprecate_target_role
        if new_resource.respond_to? :meta
          meta = new_resource.meta
          if meta && meta['target-role']
            ::Chef::Log.warn "#{new_resource} used deprecated target-role " +
              "#{meta['target-role']}; use action :start / :stop instead"
          end
        end
      end
def deprecate_target_role if new_resource . respond_to? :meta meta = new_resource . meta if meta && meta [ 'target-role' ] :: Chef :: Log . warn "#{new_resource} used deprecated target-role " + "#{meta['target-role']}; use action :start / :stop instead" end end end
In Pacemaker, target-role defaults to 'Started', but we want
to allow consumers of the LWRPs the choice whether their
newly created resource gets started or not, and we also want
to adhere to the Principle of Least Surprise.
In Pacemaker target - role defaults to ' Started ' but we want to allow consumers of the LWRPs the choice whether their newly created resource gets started or not and we also want to adhere to the Principle of Least Surprise .