Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

the include method uses the information from the 'classes' array in your hiera config to include them in your puppet code. There is no such mechanism that 'automatically' pulls in a package array from hiera. I'm not sure if there is a better way to do it in modern puppet (puppet4/5), but you can use the create_resources function to pass in an array of hashes representing the resources that you wish to create.

https://docs.puppet.com/puppet/latest/function.html#createresources

# A hash of user resources:
$myusers = {
  'nick' => { uid    => '1330',
              gid    => allstaff,
              groups => ['developers', 'operations', 'release'], },
  'dan'  => { uid    => '1308',
              gid    => allstaff,
              groups => ['developers', 'prosvc', 'release'], },
}

create_resources(user, $myusers)

the include https://docs.puppet.com/puppet/latest/function.html#hierainclude

The hiera_include method uses the information from the 'classes' array in your hiera config to include them in your puppet code. There is no such mechanism that 'automatically' pulls in a package array from hiera. I'm not sure if there is a better way to do it in modern puppet (puppet4/5), but you can use the create_resources function to pass in an array of hashes representing the resources that you wish to create.

https://docs.puppet.com/puppet/latest/function.html#createresources

# A hash of user resources:
$myusers = {
  'nick' => { uid    => '1330',
              gid    => allstaff,
              groups => ['developers', 'operations', 'release'], },
  'dan'  => { uid    => '1308',
              gid    => allstaff,
              groups => ['developers', 'prosvc', 'release'], },
}

create_resources(user, $myusers)

https://docs.puppet.com/puppet/latest/function.html#hierainclude

The hiera_include hiera_include method uses the information from the 'classes' array in your hiera config to include them in your puppet code. There is no such mechanism that 'automatically' pulls in a package array from hiera. I'm not sure if there is a better way to do it in modern puppet (puppet4/5), but you can use the create_resources function to pass in an array of hashes representing the resources that you wish to create.

https://docs.puppet.com/puppet/latest/function.html#createresources

# A hash of user resources:
$myusers = {
  'nick' => { uid    => '1330',
              gid    => allstaff,
              groups => ['developers', 'operations', 'release'], },
  'dan'  => { uid    => '1308',
              gid    => allstaff,
              groups => ['developers', 'prosvc', 'release'], },
}

create_resources(user, $myusers)

https://docs.puppet.com/puppet/latest/function.html#include https://docs.puppet.com/puppet/latest/function.html#hierainclude

The include(hiera_array('classes')) call seems to be a different version of the hiera_include method method, which uses the information from the 'classes' array in your hiera config to include them in your puppet code. There is no such mechanism that 'automatically' pulls in a package array from hiera. I'm not sure if there is a better way to do it in modern puppet (puppet4/5), but you can use the create_resources function to pass in an array of hashes representing the resources that you wish to create.

https://docs.puppet.com/puppet/latest/function.html#createresources

# A hash of user resources:
$myusers = {
  'nick' => { uid    => '1330',
              gid    => allstaff,
              groups => ['developers', 'operations', 'release'], },
  'dan'  => { uid    => '1308',
              gid    => allstaff,
              groups => ['developers', 'prosvc', 'release'], },
}

create_resources(user, $myusers)

https://docs.puppet.com/puppet/latest/function.html#include https://docs.puppet.com/puppet/latest/function.html#hierainclude

The include(hiera_array('classes'))include(hiera_array('classes', [])) call seems to be a different version of the hiera_include method, which uses the information from the 'classes' array in your hiera config to include them in your puppet code. There is no such mechanism that 'automatically' pulls in a package array from hiera. I'm not sure if there is a better way to do it in modern puppet (puppet4/5), but you can use the create_resources function to pass in an array of hashes representing the resources that you wish to create.

https://docs.puppet.com/puppet/latest/function.html#createresources

# A hash of user resources:
$myusers = {
  'nick' => { uid    => '1330',
              gid    => allstaff,
              groups => ['developers', 'operations', 'release'], },
  'dan'  => { uid    => '1308',
              gid    => allstaff,
              groups => ['developers', 'prosvc', 'release'], },
}

create_resources(user, $myusers)