diff options
author | Pietro Ferrari <pietro@riseup.net> | 2008-11-11 00:16:41 +0000 |
---|---|---|
committer | Pietro Ferrari <pietro@riseup.net> | 2008-11-11 00:16:41 +0000 |
commit | b43b2a2d5b0c424f3fce801f9158af60df20978a (patch) | |
tree | b1e48d613ee0d76a686a83c2ccdec4f769060c89 /plugins | |
parent | 0a4679409748b22f464526ec2c4aad1771c80b80 (diff) | |
download | puppet-virtual-b43b2a2d5b0c424f3fce801f9158af60df20978a.tar.gz puppet-virtual-b43b2a2d5b0c424f3fce801f9158af60df20978a.tar.bz2 |
merge some changes from immerda repository. specially xen related.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/facter/virtual.rb | 2 | ||||
-rw-r--r-- | plugins/facter/xen.rb | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/plugins/facter/virtual.rb b/plugins/facter/virtual.rb index e649345..afb60f3 100644 --- a/plugins/facter/virtual.rb +++ b/plugins/facter/virtual.rb @@ -13,7 +13,7 @@ Facter.add("virtual") do setcode do - lspciexists = system "which lspci >&/dev/null" + lspciexists = system "which lspci > /dev/null 2>&1" if $?.exitstatus == 0 output = %x{lspci} output.each {|p| diff --git a/plugins/facter/xen.rb b/plugins/facter/xen.rb new file mode 100644 index 0000000..0ea8fa2 --- /dev/null +++ b/plugins/facter/xen.rb @@ -0,0 +1,12 @@ +# xen.rb -- linux-vserver.org related facts +# Copyright (C) 2008 Puzzle ITC +# See LICENSE for the full license granted to you. + +Facter.add("xen_domains") do + confine :virtual => :xen0 + ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin" + setcode do + %x{xm list | egrep -v '(^Name|^Domain-0)' | wc -l}.chomp + end +end + |