diff options
Diffstat (limited to 'plugins/facter/xen.rb')
-rw-r--r-- | plugins/facter/xen.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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 + |