Skip to content

Commit c7eb686

Browse files
committed
Merge pull request #183 from fasrc/fix_oned_peer
replace oned_peer with one_host
2 parents 7d02400 + 7bb8518 commit c7eb686

6 files changed

Lines changed: 39 additions & 135 deletions

File tree

lib/puppet/provider/oned_peer.rb

Lines changed: 0 additions & 54 deletions
This file was deleted.

lib/puppet/type/oned_peer.rb

Lines changed: 0 additions & 30 deletions
This file was deleted.

manifests/compute_node.pp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
class one::compute_node(
2929
$puppetdb = $one::puppetdb,
3030
$oneid = $one::oneid,
31-
$vtype = $one::vtype,
32-
$ntype = $one::ntype,
31+
$im_mad = $one::im_mad,
32+
$vm_mad = $one::vm_mad,
33+
$vn_mad = $one::vn_mad,
3334
) {
3435
include one::prerequisites
3536
include one::install
@@ -48,11 +49,12 @@
4849
Class['one::service']
4950

5051
if ($puppetdb == true) {
51-
# Register the node in the puppetdb
52-
@@one::oned::peer { $::fqdn :
53-
tag => $oneid,
54-
vtype => $vtype,
55-
ntype => $ntype,
52+
# Register the node as a onehost in the puppetdb
53+
@@onehost { $::fqdn :
54+
tag => $oneid,
55+
im_mad => $im_mad,
56+
vm_mad => $vm_mad,
57+
vn_mad => $vn_mad,
5658
}
5759
}
5860
}

manifests/init.pp

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,35 @@
2222
# $node true|false - default true
2323
# defines whether the host is node (virtualization host/worker)
2424
#
25-
# $vtype - default kvm
25+
# $im_mad - default kvm
26+
# set Information Manager driver for opennebula compute node
27+
# supported types:
28+
# - kvm
29+
# - xen
30+
# - vmware
31+
# - ec2
32+
# - ganglia
33+
# - dummy
34+
#
35+
# $vm_mad - default kvm
2636
# set virtualization type for opennebula compute node
27-
# supported vtypes:
37+
# supported types:
2838
# - kvm
29-
# - xen3
30-
# - xen4
39+
# - xen
3140
# - vmware
3241
# - ec2
3342
# - dummy
3443
# - qemu
3544
#
36-
# $ntype - default 802.1Q
45+
# $vn_mad - default 802.1Q
3746
# set network type for opennebula compute node
38-
# supported tyes
47+
# supported types:
3948
# - 802.1Q
4049
# - ebtables
4150
# - firewall
4251
# - ovswitch
4352
# - vmware
53+
# - dummy
4454
#
4555
# $oned true|false - default false
4656
# defines whether OpenNebula-Daemon should be installed.
@@ -77,7 +87,7 @@
7787
# defines whether the oneflow service should be installed
7888
#
7989
# $puppetdb true|false - default false
80-
# defines to use puppetDB to discover peer nodes
90+
# defines to use puppetDB to discover peer nodes (hypervisors)
8191
#
8292
# $debug_level - default 0
8393
# defines the debug level under which oned and sunstone are running
@@ -321,8 +331,9 @@
321331
class one (
322332
$oneid = 'one-cloud',
323333
$node = true,
324-
$vtype = 'kvm',
325-
$ntype = '802.1Q',
334+
$im_mad = 'kvm',
335+
$vm_mad = 'kvm',
336+
$vn_mad = '802.1Q',
326337
$oned = false,
327338
$sunstone = false,
328339
$sunstone_passenger = false,
@@ -441,14 +452,18 @@
441452
Class['one::service']
442453

443454
if ($oned) {
444-
if ( member(['kvm','xen3','xen4','vmware','ec2', 'qemu'], $vtype) ) {
445-
if ( member(['802.1Q','ebtables','firewall','ovswitch'], $ntype) ) {
446-
include one::oned
455+
if ( member(['kvm','xen','vmware','ec2', 'ganglia','dummy'], $im_mad) ) {
456+
if ( member(['kvm','xen','vmware','ec2', 'qemu', 'dummy'], $vm_mad) ) {
457+
if ( member(['802.1Q','ebtables','firewall','ovswitch','vmware','dummy'], $vn_mad) ) {
458+
include one::oned
459+
} else {
460+
fail("Network Type: ${vn_mad} is not supported.")
461+
}
447462
} else {
448-
fail("Network Type: ${ntype} is not supported.")
463+
fail("Virtualization type: ${vm_mad} is not supported")
449464
}
450465
} else {
451-
fail("Virtualization type: ${vtype} is not supported")
466+
fail("Information Manager type: ${im_mad} is not supported")
452467
}
453468
}
454469
if ($node) {

manifests/oned.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
if ($puppetdb == true) {
6464
# Realize all the known nodes
65-
One::Oned::Peer <<| tag == $oneid |>> {
65+
Onehost <<| tag == $oneid |>> {
6666
require => Class[one::oned::service],
6767
}
6868
}

manifests/oned/peer.pp

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)