From 65461ecaa718abc8e7d0ecfb2c315f3f751c4a06 Mon Sep 17 00:00:00 2001 From: Endre Karlson Date: Sat, 6 Oct 2012 22:12:33 +0200 Subject: [PATCH] Make it provider ish --- manifests/init.pp | 17 +++++------------ manifests/ovs.pp | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 manifests/ovs.pp diff --git a/manifests/init.pp b/manifests/init.pp index 128a32c1..9f6e2d5d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,13 +1,6 @@ -class vswitch { - package { ["openvswitch-switch", "openvswitch-datapath-dkms"]: - ensure => present - } - - service { "openvswitch-switch": - ensure => true, - enable => true, - hasstatus => true, - status => "/etc/init.d/openvswitch-switch", - require => Package["openvswitch-switch"] - } +class vswitch ( + $provider = "ovs" +) { + $cls = "vswitch::$provider" + include $cls } diff --git a/manifests/ovs.pp b/manifests/ovs.pp new file mode 100644 index 00000000..82c51a93 --- /dev/null +++ b/manifests/ovs.pp @@ -0,0 +1,17 @@ +class vswitch::ovs { + case $::osfamily { + Debian: { + package {["openvswitch-switch", "openvswitch-datapath-dkms"]: ensure => present} + } + Ubuntu: { + package {["openvswitch-switch", "openvswitch-datapath-dkms"]: ensure => present} + + service {"openvswitch-switch": + ensure => true, + enable => true, + hasstatus => true, + status => "/etc/init.d/openvswitch-switch", + } + } + } +}