Hi All,
I am using two Puppet Servers having version 4.7.0 (Foreman 1.13) and I see
that facts values using Foreman API (/v2/fact_values) are coming in one of
the servers in JSON format as follows.
"networking": "{"dhcp"=>"10.65.168.11", "domain"=>"
sdcorp.global.sandisk.com", "fqdn"=>"
Puppetest12345.sdcorp.global.sandisk.com
<http://puppetest12345.sdcorp.global.sandisk.com/>",
"hostname"=>"Puppetest12345", "interfaces"=>{"Local Area Connection
2"=>{"bindings"=>[{"address"=>"10.65.168.150",
"netmask"=>"255.255.248.0", "network"=>"10.65.168.0"}],
"bindings6"=>[{"address"=>"fe80::b45c:17f7:b3c1:fdd2%13",
"netmask"=>"ffff:ffff:ffff:ffff::", "network"=>"fe80::%13"}],
"dhcp"=>"10.65.168.11", "ip"=>"10.65.168.150",
"ip6"=>"fe80::b45c:17f7:b3c1:fdd2%13", "mac"=>"30:5A:3A:4B:06:52",
"mtu"=>1500, "netmask"=>"255.255.248.0",
"netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.65.168.0",
"network6"=>"fe80::%13"}}, "ip"=>"10.65.168.150",
"ip6"=>"fe80::b45c:17f7:b3c1:fdd2%13", "mac"=>"30:5A:3A:4B:06:52",
"mtu"=>1500, "netmask"=>"255.255.248.0",
"netmask6"=>"ffff:ffff:ffff:ffff::", "network"=>"10.65.168.0",
"network6"=>"fe80::%13", "primary"=>"Local Area Connection 2"}",
In the other hand, in another Puppet server the facts values are are coming
in different format.
"networking::interfaces::Ethernet::dhcp": "10.65.250.10",
"networking::interfaces::Ethernet::ip": "10.65.250.14",
"ipaddress": "10.65.250.14",
"networking::ip": "10.65.250.14",
"ipaddress_Ethernet": "10.65.250.14",
"memory::system::used": "1.08 GiB",
"timestamp": "11/05/2016 07:46:56",
"memory::system::used_bytes": "1157337088",
Can some please explain what that above format is and is there any
Puppet/Foreman configuration I can set to get O/P in JSON format as the
first Puppet server provides?
Alternately if that is not possible please let me know how can I convert
this format to JSON.
Any help is appreciated.
Regards
Amrit