Skip to content

Feature "expanded custom facts"

Created by: MemberIT

New feature "expanded custom facts" Puppet code:

  $title_facters = {
    my_fact => {
      ensure => present,
      value  =>
        ['my_val0', 'my_val1'],
    },
    my_fact2 => {
      ensure => present,
      value  => {
        key1 => [
          'val11',
          'val12',
        ],
        key2 => {
          key21 => 'val211',
          key22 => [
            'val221',
            'val222',
          ],
        },
      },
    },
  }
  create_resources('::puppet::fact', $title_facters)

facters:

# facter -v
3.3.0 (commit fc9282a2d426f7c8a742fd5b23c4cb06852eee20)
# facter my_fact
[
  "my_val0",
  "my_val1"
]
# facter my_fact2
{
  key1 => [
    "val11",
    "val12"
  ],
  key2 => {
    key21 => "val211",
    key22 => [
      "val221",
      "val222"
    ]
  }
}
# facter my_fact2.key1
[
  "val11",
  "val12"
]
# facter my_fact2.key2
{
  key21 => "val211",
  key22 => [
    "val221",
    "val222"
  ]
}

Merge request reports