From 1bb5a446b26dfb90c2f67a231ac1a360e4fecfac Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 16 Jun 2016 14:23:12 -0300 Subject: Virtual: kvm-manager support --- manifests/subsystem/virtual/instance.pp | 74 +++++++++++---------------------- 1 file changed, 24 insertions(+), 50 deletions(-) (limited to 'manifests/subsystem/virtual/instance.pp') diff --git a/manifests/subsystem/virtual/instance.pp b/manifests/subsystem/virtual/instance.pp index dddebea..d304001 100644 --- a/manifests/subsystem/virtual/instance.pp +++ b/manifests/subsystem/virtual/instance.pp @@ -1,25 +1,25 @@ # Define a virtual server instance define nodo::subsystem::virtual::instance( - $context, - $ensure = 'running', - $proxy = false, - $puppetmaster = false, - $web = false, - $gitd = false, - $mail = false, - $icecast = false, - $sound = false, - $tor = false, - $ticket = false, - $memory_limit = false, - $dns = false, - $jabber = false, - $mumble = false, - $gobby = false, - $yacy = false, - $rsync = false, - $avahi = false, - $implementation = false + $vg, + $context, + $ram = '1G', + $size = '10G', + $ensure = 'running', + $proxy = false, + $web = false, + $gitd = false, + $mail = false, + $icecast = false, + $tor = false, + $ticket = false, + $dns = false, + $jabber = false, + $mumble = false, + $gobby = false, + $yacy = false, + $rsync = false, + $avahi = false, + $subnet = '10.1.1', ) { # Instance id if $context <= 9 { @@ -28,29 +28,12 @@ define nodo::subsystem::virtual::instance( $id = $context } - # Puppetmaster ssl port - case $puppetmaster_port { - '': { $puppetmaster_port = "8140" } + virtual::kvm::manager::instance { $name: + vg => $vg, + size => $size, + ram => $ram, } - # Set puppetmaster non-ssl port - case $puppetmaster_nonssl_port { - '': { $puppetmaster_nonssl_port = "8141" } - } - - # Tor port - case $tor_port { - '': { $tor_port = "9001" } - } - - # Subnet - case $implementation { - 'vserver': { $subnet = "192.168.0" } - default: { $subnet = "10.1.1" } - } - - $dev = hiera('nodo::subsystem::vm::interface', 'eth0') - # Apply firewall rules just for running virtual machines case $ensure { 'running': { @@ -67,15 +50,6 @@ define nodo::subsystem::virtual::instance( } } - if $puppetmaster { - class { - "firewall::virtual::puppetmaster": - destination => "${subnet}.$context", - puppetmaster_port => $puppetmaster_port, - puppetmaster_nonssl_port => $puppetmaster_nonssl_port, - } - } - if $web { firewall::virtual::web { $name: destination => "${subnet}.$context", -- cgit v1.2.3