Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Add razor puppet resource. #48

Closed
wants to merge 16 commits into from

4 participants

Nan Liu Stephen Johnson Branan Purvine-Riley Mehdi ABAAKOUK
Nan Liu
nanliu commented
  • 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.
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
Stephen Johnson

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

lib/puppet/provider/rz_policy/default.rb
((46 lines not shown))
  46
+    @property_hash[:ensure] = :present
  47
+    uuid = query_razor.get_model_uuid(@resource[:model])
  48
+
  49
+    policy = {
  50
+      'template'    => @resource[:template],
  51
+      'label'       => @resource[:name],
  52
+      'model_uuid'  => uuid,
  53
+      'broker_uuid' => @resource[:broker],
  54
+      'enabled'     => @resource[:enabled],
  55
+      'tags'        => @resource[:tags],
  56
+      'maximum'     => @resource[:maximum] || 0,
  57
+    }
  58
+
  59
+    policy['broker_uuid'] = @resource[:broker] if @resource[:broker] != 'none'
  60
+
  61
+    Puppet.debug "razor -w model add '#{policy.to_pson}'"
1

razor policy not razor model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/puppet/type/rz_policy.rb
((11 lines not shown))
  11
+
  12
+  newparam(:name, :namevar => true) do
  13
+    desc "The name of the policy."
  14
+
  15
+    newvalues(/\w+/)
  16
+  end
  17
+
  18
+  newproperty(:enabled) do
  19
+    newvalues(true, false)
  20
+    defaultto(true)
  21
+  end
  22
+
  23
+  newproperty(:description) do
  24
+  end
  25
+
  26
+  newproperty(:tags) do
1
Branan Purvine-Riley Owner
branan added a note

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
Nan Liu

Replaced due to changes to razor project.

Nan Liu nanliu closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 16 unique commits by 3 authors.

Jul 31, 2012
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
Aug 01, 2012
Fix two mistakes in the refactor. 2f7798a
Aug 02, 2012
Fix debug message. ab7a5f4
Aug 06, 2012
Update description and add munging.
Munge tag values. Add munging for policy tags.
fdd1aee
Fix policy maximum default. 00674da
Add validation and munge for rz_model and rz_image. 237c3db
Aug 15, 2012
Add razor tag resource. e9c8fbe
Add additional resource examples. fde9690
Fix bug so policy tags are all added. 1f6bf0f
Aug 16, 2012
Mehdi ABAAKOUK Add razor broker ressource 30ed628
Nan Liu Merge pull request #1 from sileht/to-pull/ressource
Add razor broker ressource
815e255
Aug 17, 2012
Change munge to validate. 4e2a99e
Merge branch 'tb/resource' of github.com:nanliu/puppetlabs-razor into…
… tb/resource
cb12cc5
Remove description since we can't change it. e427e3a
Remove validation since it's not passing array. 848b8f5
Fix annoying @ issue with model metadata. 7009f84
Something went wrong with that request. Please try again.