Map ctlplane network to management fqdn
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Mon, 5 Sep 2016 11:45:47 +0000 (14:45 +0300)
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>
Mon, 5 Sep 2016 11:45:47 +0000 (14:45 +0300)
We don't really expose a management network, but a ctlplane one. So
when someone requests the ctlplane fqdn, we'll give the management
one. Since that's what we actually fill in the hosts.

Change-Id: Iede5a06d73206f98f283729f1879484f09d4012a

lib/facter/alt_fqdns.rb

index 89c4b6a..216beef 100644 (file)
     end
   end
 end
+# map ctlplane network to management fqdn
+Facter.add('fqdn_ctlplane') do
+  setcode do
+    hostname_parts = [
+      Facter.value(:hostname),
+      'management',
+      Facter.value(:domain),
+    ].reject { |part| part.nil? || part.empty? }
+    hostname_parts.join(".")
+  end
+end