aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-16 14:23:12 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-16 14:23:12 -0300
commit1bb5a446b26dfb90c2f67a231ac1a360e4fecfac (patch)
tree694488570c79619117b3e22c801ee05489aa940c /manifests
parentd56416fc07eece9fdeb9554ce123341f124a10ad (diff)
downloadpuppet-nodo-1bb5a446b26dfb90c2f67a231ac1a360e4fecfac.tar.gz
puppet-nodo-1bb5a446b26dfb90c2f67a231ac1a360e4fecfac.tar.bz2
Virtual: kvm-manager support
Diffstat (limited to 'manifests')
-rw-r--r--manifests/subsystem/virtual/instance.pp74
1 files changed, 24 insertions, 50 deletions
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",