I have a running puppet master-agent setup and currently trying to figure out how to use hiera to provision php.
My Puppetfile:
forge "http://forge.puppetlabs.com"
mod "jfryman/nginx"
mod "puppetlabs/mysql"
mod "mayflower/php"
mod 'puppetlabs-vcsrepo'
mod 'puppetlabs/ntp', '4.1.0'
mod 'puppetlabs/stdlib'
My site.pp
:
hiera_include('classes')
My environment.conf
, where the modulepath is maintained:
manifest = site.pp
modulepath = modules:site
My hiera config on puppet master at /etc/puppetlabs/puppet/hiera.yml
:
---
:backends:
- yaml
:hierarchy:
- "nodes/%{::trusted.certname}"
- "environment/%{server_facts.environment}"
- common
:yaml:
# datadir is empty here, so hiera uses its defaults:
# - /etc/puppetlabs/code/environments/%{environment}/hieradata on *nix
# - %CommonAppData%\PuppetLabs\code\environments\%{environment}\hieradata on Windows
# When specifying a datadir, make sure the directory exists.
:datadir:
From what I understand, general config that should be present on all servers goes into common.yaml
. With this setup, I managed to install ntp on my node with this config at hieradata/common.yaml
:
---
classes:
- 'profile::base'
ntp::servers:
- server 0.de.pool.ntp.org
- server 1.de.pool.ntp.org
- server 2.de.pool.ntp.org
- server 3.de.pool.ntp.org
Now, my hierarchy also states that all node specific config should go into hieradata/nodes/{fqdn-of-the-node}.yml
.
Now, finally coming to my questions:
I have a file hieradata/nodes/myserver.example.com.yml
which holds this:
classes:
- 'profile::php'
And a manifest under site/profile/manifests/php.pp
:
class profile::php {
class { '::php': }
}
But this does not provision php. As you saw, I use mayflower/php
from the forge.
Now, my two questions are:
Is my hiera file for php in the right location? What am I missing then to make it provision php to my agent?