We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f05f0e0 commit 5ceaeeeCopy full SHA for 5ceaeee
lib/facter/volume_group_map.rb
@@ -0,0 +1,21 @@
1
+# frozen_string_literal: true
2
+
3
+Facter.add(:volume_group_map) do
4
+ # Fact should be confined to only linux servers that have the lvs command
5
+ confine do
6
+ Facter.value('kernel') == 'Linux' &&
7
+ Facter::Core::Execution.which('vgs')
8
+ end
9
10
+ setcode do
11
+ Facter.value(:volume_groups).keys.to_h do |vg|
12
+ [
13
+ vg,
14
+ Facter::Core::Execution.exec("vgs -o pv_name #{vg} --noheading --nosuffix")
15
+ .split("\n")
16
+ .map { |x| x.strip }
17
+ .join(',')
18
+ ]
19
20
21
+end
0 commit comments