Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 257

Understanding Hiera settings and like it's working

$
0
0
Hello, I've recently found a structure of puppet ready and functional using hiera, but I don't know like it's working. my hiera settings: /etc/puppetlabs/code/hiera.yaml
:backends:
  - yaml
:yaml:
  :datadir: "/etc/puppetlabs/code/environments/%{environment}/hieradata"
:hierarchy:
  - "hostname/%{city}/%{trusted.certname}"
  - "profiles/%{::location}/%{::service}/%{::profileserver}"
  - "profiles/%{::location}/default"
  - "city/%{city}"
  - "virtual_%{is_virtual}/%{virtual}"
  - "os/%{kernel}/%{osfamily}"
  - "os/%{kernel}/default"

#:merge_behavior: deeper
/etc/puppetlabs/code/environments/production/manifests/site.pp
$city          = define_server($trusted['certname'],'city')
$location      = define_server($trusted['certname'],'location')
$service       = define_server($trusted['certname'],'service')
$profileserver = define_server($trusted['certname'],'profile')
an example of settings in hiera hierarchy /etc/puppetlabs/code/environments/production/hieradata/profiles/aa/puppetmaster/master.yaml
---
######################################
#####     puppet-agent             ###
######################################
puppet_agent::master: true
puppet_agent::vardir: '/opt/puppetlabs/server/data/puppetserver'
#puppet_agent::logdir: '/var/log/puppetlabs/puppetserver'
puppet_agent::rundir: '/var/run/puppetlabs/puppetserver'
puppet_agent::pidfile: '/var/run/puppetlabs/puppetserver/puppetserver.pid'
puppet_agent::codedir: '/etc/puppetlabs/code'
puppet_agent::storeconfigs: true
puppet_agent::storeconfigs_backend: 'puppetdb'
puppet_agent::reports: 'puppetdb'
The question is, how the puppet knows what are the profiles, services and cities of the servers? I've already looked on facts of the agents but don't found this variable! thanks.

Viewing all articles
Browse latest Browse all 257

Trending Articles