Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move define resource razor::system to tests.

The define resource type is specific to ubuntu and it's not generic
enough to be in the module, but it should serve as a good example for
anyone using the razor resources to model systems.
  • Loading branch information...
commit 792a74aff20cea428fbe4b330675eb6320d4760b 1 parent 9744530
@nanliu nanliu authored
Showing with 77 additions and 65 deletions.
  1. +0 −38 manifests/system.pp
  2. +39 −26 tests/openstack.pp
  3. +38 −1 tests/system.pp
View
38 manifests/system.pp
@@ -1,38 +0,0 @@
-# Deploying specific systems. Only tested with Ubuntu precise.
-define razor::system (
- $hostprefix = $name,
- $domain,
- $password,
- $tag_matcher = [],
- $broker = 'none',
- $instances = '0',
- $image = 'precise',
- $policy_template = 'linux_deploy',
- $model_template = 'ubuntu_precise',
-) {
-
- rz_model { $name:
- ensure => present,
- image => $image,
- metadata => { 'domainname' => $domain,
- 'hostname_prefix' => $hostprefix,
- 'root_password' => $password, },
- template => $model_template,
- }
-
- rz_tag { $name:
- tag_label => $name,
- tag_matcher => $tag_matcher,
- }
-
- rz_policy { $name:
- ensure => 'present',
- broker => $broker,
- model => $name,
- enabled => 'true',
- tags => [$name],
- template => 'linux_deploy',
- maximum => $instances,
- }
-}
-
View
65 tests/openstack.pp
@@ -1,4 +1,42 @@
-# Example Openstack
+# Deploying Ubuntu Precise
+define razor::system (
+ $hostprefix = $name,
+ $domain,
+ $password,
+ $tag_matcher = [],
+ $broker = 'none',
+ $instances = '0',
+ $image = 'precise',
+ $policy_template = 'linux_deploy',
+ $model_template = 'ubuntu_precise',
+) {
+
+ rz_model { $name:
+ ensure => present,
+ image => $image,
+ metadata => { 'domainname' => $domain,
+ 'hostname_prefix' => $hostprefix,
+ 'root_password' => $password, },
+ template => $model_template,
+ }
+
+ rz_tag { $name:
+ tag_label => $name,
+ tag_matcher => $tag_matcher,
+ }
+
+ rz_policy { $name:
+ ensure => 'present',
+ broker => $broker,
+ model => $name,
+ enabled => 'true',
+ tags => [$name],
+ template => 'linux_deploy',
+ maximum => $instances,
+ }
+}
+
+# Example Openstack Desployment on UCS hardware.
rz_image { 'rz_mk_prod-image.0.9.0.4.iso':
ensure => present,
type => 'mk',
@@ -12,31 +50,6 @@
source => '/opt/razor/ubuntu-12.04.1-server-amd64.iso',
}
-razor::system { 'danscontroller':
- domain => 'dmz25.lab',
- password => 'test1234',
- instances => 1,
- image => 'Precise',
- tag_matcher => [
- { 'key' => 'macaddress_eth0',
- 'compare' => 'equal',
- 'value' => '00:25:B5:00:05:CF',
- 'inverse' => false,
- } ],
-} ->
-razor::system { 'danscompute':
- domain => 'dmz25.lab',
- password => 'test1234',
- instances => 1,
- image => 'Precise',
- tag_matcher => [
- { 'key' => 'macaddress_eth0',
- 'compare' => 'equal',
- 'value' => '00:25:B5:00:05:2F',
- 'inverse' => false,
- } ],
-} ->
-
razor::system { 'compute':
domain => 'dmz25.lab',
password => 'test1234',
View
39 tests/system.pp
@@ -1,4 +1,40 @@
-# Example for how to specify per host policy based on macaddress.
+# Deploying Ubuntu precise.
+define razor::system (
+ $hostprefix = $name,
+ $domain,
+ $password,
+ $tag_matcher = [],
+ $broker = 'none',
+ $instances = '0',
+ $image = 'precise',
+ $policy_template = 'linux_deploy',
+ $model_template = 'ubuntu_precise',
+) {
+
+ rz_model { $name:
+ ensure => present,
+ image => $image,
+ metadata => { 'domainname' => $domain,
+ 'hostname_prefix' => $hostprefix,
+ 'root_password' => $password, },
+ template => $model_template,
+ }
+
+ rz_tag { $name:
+ tag_label => $name,
+ tag_matcher => $tag_matcher,
+ }
+
+ rz_policy { $name:
+ ensure => 'present',
+ broker => $broker,
+ model => $name,
+ enabled => 'true',
+ tags => [$name],
+ template => 'linux_deploy',
+ maximum => $instances,
+ }
+}
rz_image { 'rz_mk_prod-image.0.9.0.4.iso':
ensure => present,
@@ -13,6 +49,7 @@
source => 'http://releases.ubuntu.com/12.04/ubuntu-12.04.1-server-amd64.iso',
}
+# Example for how to specify per host policy based on macaddress.
razor::system { 'demo':
domain => 'dmz25.lab',
password => 'test1234',
Please sign in to comment.
Something went wrong with that request. Please try again.