Skip to content

Add razor puppet resource. #48

Closed
wants to merge 16 commits into from

4 participants

@nanliu
nanliu commented Jul 31, 2012
  • Add image, model, policy resource.
  • Remove ruby 1.8.7 sample manifests.
  • Update puppet_x to the correct location.
  • Add example manifests showing image and policy management.
@nanliu nanliu Add razor puppet resource.
* Add image, model, policy resource.
* Remove ruby 1.8.7 sample manifests.
* Update puppet_x to the correct location.
* Add example manifests showing image and policy management.
0845e40
@stephenrjohnson

doesn't this need to stop in otherwise you get at /Stage[main]/Razor/Rz_image[rz_mk_prod-image.0.9.0.4.iso]/ensure: change from absent to present failed: Could not set 'present on ensure: undefined method `curl' for #Puppet::Type::Rz_image::ProviderDefault:0x7fe406957ff8

@stephenrjohnson

Should this be Puppet::debug

@stephenrjohnson stephenrjohnson commented on an outdated diff Aug 2, 2012
lib/puppet/provider/rz_policy/default.rb
+ @property_hash[:ensure] = :present
+ uuid = query_razor.get_model_uuid(@resource[:model])
+
+ policy = {
+ 'template' => @resource[:template],
+ 'label' => @resource[:name],
+ 'model_uuid' => uuid,
+ 'broker_uuid' => @resource[:broker],
+ 'enabled' => @resource[:enabled],
+ 'tags' => @resource[:tags],
+ 'maximum' => @resource[:maximum] || 0,
+ }
+
+ policy['broker_uuid'] = @resource[:broker] if @resource[:broker] != 'none'
+
+ Puppet.debug "razor -w model add '#{policy.to_pson}'"

razor policy not razor model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@branan branan commented on an outdated diff Aug 6, 2012
lib/puppet/type/rz_policy.rb
+
+ newparam(:name, :namevar => true) do
+ desc "The name of the policy."
+
+ newvalues(/\w+/)
+ end
+
+ newproperty(:enabled) do
+ newvalues(true, false)
+ defaultto(true)
+ end
+
+ newproperty(:description) do
+ end
+
+ newproperty(:tags) do
@branan
Puppet member
branan added a note Aug 6, 2012

This should have a munge that converts a single string to an array, so that policies with one tag don't need to be defined with a single-element array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@nanliu
nanliu commented Sep 25, 2012

Replaced due to changes to razor project.

@nanliu nanliu closed this Sep 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.