From 1be510f9529cb082f802408b472a77d074b394c0 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Sun, 14 Apr 2013 13:46:12 +0000 Subject: Add zarb MLs html archives --- zarb-ml/mageia-sysadm/2010-November/000721.html | 194 ++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 zarb-ml/mageia-sysadm/2010-November/000721.html (limited to 'zarb-ml/mageia-sysadm/2010-November/000721.html') diff --git a/zarb-ml/mageia-sysadm/2010-November/000721.html b/zarb-ml/mageia-sysadm/2010-November/000721.html new file mode 100644 index 000000000..f70b2ca3f --- /dev/null +++ b/zarb-ml/mageia-sysadm/2010-November/000721.html @@ -0,0 +1,194 @@ + + + + [Mageia-sysadm] [357] add testvm module, used to run test VMs + + + + + + + + + +

[Mageia-sysadm] [357] add testvm module, used to run test VMs

+ root at mageia.org + root at mageia.org +
+ Sun Nov 21 21:54:46 CET 2010 +

+
+ +
Revision: 357
+Author:   boklm
+Date:     2010-11-21 21:54:45 +0100 (Sun, 21 Nov 2010)
+Log Message:
+-----------
+add testvm module, used to run test VMs
+
+Added Paths:
+-----------
+    puppet/modules/testvm/
+    puppet/modules/testvm/files/
+    puppet/modules/testvm/files/_vm
+    puppet/modules/testvm/files/vm-jonund
+    puppet/modules/testvm/manifests/
+    puppet/modules/testvm/manifests/init.pp
+
+Added: puppet/modules/testvm/files/_vm
+===================================================================
+--- puppet/modules/testvm/files/_vm	                        (rev 0)
++++ puppet/modules/testvm/files/_vm	2010-11-21 20:54:45 UTC (rev 357)
+@@ -0,0 +1,53 @@
++#!/bin/sh
++
++test -z $vmname && exit 1
++
++vmdir="$HOME/VMs"
++piddir="$HOME/PIDs"
++logdir="$HOME/log"
++vmfile="$vmdir/$vmname"
++pidfile="$piddir/$vmname"
++logfile="$logdir/$vmname"
++qemucmd="qemu-kvm -nographic -pidfile $pidfile -hda $vmfile -net nic,vlan=0 -net user,vlan=0,hostfwd=tcp::$sshport-:22 $QEMUOPT"
++
++function running()
++{
++	test -f $pidfile || return 1
++	pid=`cat $pidfile`
++	test -d "/proc/$pid"
++}
++
++function stop()
++{
++	test -f $pidfile || return 1
++	pid=`cat $pidfile`
++	kill "$pid" && rm -f "$pidfile"
++}
++
++function start()
++{
++	running && echo "VM is already running" && return 1
++	nohup $qemucmd > $logfile 2>&1 &
++}
++
++case "$1" in
++	start)
++		start
++		;;
++	stop)
++		stop
++		;;
++	restart)
++		start
++		stop
++		;;
++	status)
++		running
++		vmrunning=$?
++		test $vmrunning -eq 0 && echo "VM $vmname is running"
++		test $vmrunning -eq 0 || echo "VM $vmname is stopped"
++		;;
++	ssh)
++		running && ssh -p $sshport localhost
++		;;
++esac
+
+Added: puppet/modules/testvm/files/vm-jonund
+===================================================================
+--- puppet/modules/testvm/files/vm-jonund	                        (rev 0)
++++ puppet/modules/testvm/files/vm-jonund	2010-11-21 20:54:45 UTC (rev 357)
+@@ -0,0 +1,5 @@
++#!/bin/sh
++vmname=jonund
++sshport=5051
++SCRIPTSDIR=$(dirname $0)
++. "$SCRIPTSDIR/_vm"
+
+
+Property changes on: puppet/modules/testvm/files/vm-jonund
+___________________________________________________________________
+Added: svn:executable
+   + *
+
+Added: puppet/modules/testvm/manifests/init.pp
+===================================================================
+--- puppet/modules/testvm/manifests/init.pp	                        (rev 0)
++++ puppet/modules/testvm/manifests/init.pp	2010-11-21 20:54:45 UTC (rev 357)
+@@ -0,0 +1,33 @@
++class testvm
++{
++    $testvm_login = "testvm"
++    $testvmdir = "/home/testvm"
++
++    group {"$testvm_login":
++	ensure => present,
++    }
++
++    user {"$testvm_login":
++	ensure => present,
++	comment => "System user used to run test VMs",
++	managehome => true,
++	gid => $vmtest_login,
++	shell => "/bin/bash",
++    }
++
++    file { "$testvmdir/bin/_vm":
++	ensure => present,
++        owner => root,
++	group => root,
++	mode => 644,
++	source => "puppet:///modules/testvm/_vm",
++    }
++
++    file { "$testvmdir/bin/vm-jonund":
++	ensure => present,
++        owner => root,
++	group => $testvm_login,
++	mode => 750,
++	source => "puppet:///modules/testvm/vm-jonund",
++    }
++}
+-------------- next part --------------
+An HTML attachment was scrubbed...
+URL: </pipermail/mageia-sysadm/attachments/20101121/c6d6ef4e/attachment-0001.html>
+
+ + + + + + + + +
+

+ +
+More information about the Mageia-sysadm +mailing list
+ -- cgit v1.2.1