:yaml:
:datadir: "/etc/puppet/environments/%{environment}/hieradata"
:hierarchy:
- "node/%{::fqdn}"
- "role/%{::role}"
- "profile/%{::profile}"
- "operatingsystem/%{::operatingsystem}/%{::operatingsystemmajrelease}"
- "operatingsystem/%{::operatingsystem}"
- "osfamily/%{::osfamily}"
- "datacenter/%{::datacenter}"
- "virtual/%{::is_virtual}"
- common
hiera_include('classes', '')
node default {
$role = hiera('role')
include $role
}
# Mon
---
classes: apt
apt::mirror: http://debianmirror.example.bla/pub/linux/debian/debian/
apt::source: true
---
mysql::server::override_options :
'client':
[...]
Puppet Version is 3.8.7-1puppetlabs1 on Debian 7.11
Any suggestions?
[...]
DEBUG: 2016-12-21 19:14:39 +0100: Hiera JSON backend starting
DEBUG: 2016-12-21 19:14:39 +0100: Looking up mysql::server::backup::backupuser in JSON backend
DEBUG: 2016-12-21 19:14:39 +0100: Looking for data source role/mysql_server
DEBUG: 2016-12-21 19:14:39 +0100: Cannot find datafile /etc/puppet/hiera/role/mysql_server.json, skipping
DEBUG: 2016-12-21 19:14:39 +0100: Looking for data source common
DEBUG: 2016-12-21 19:14:39 +0100: Cannot find datafile /etc/puppet/hiera/common.json, skipping
DEBUG: 2016-12-21 19:14:39 +0100: Hiera YAML backend starting
DEBUG: 2016-12-21 19:14:39 +0100: Looking up mysql::server::backup::backupuser in YAML backend
DEBUG: 2016-12-21 19:14:39 +0100: Looking for data source role/mysql_server
DEBUG: 2016-12-21 19:14:39 +0100: Found mysql::server::backup::backupuser in role/mysql_server
dbbackup
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/68e1bc79-6709-47a3-a3e3-7a9cbd483a84%40googlegroups.com.
hi,
yep, restarting after every change.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c1bc2d00-8c3e-411f-b8be-cf1136ddc320%40googlegroups.com.
[...]
2016-12-21 20:59:16,496 INFO [puppet-server] Puppet Caching node for mon.example.com
2016-12-21 20:59:17,236 WARN [puppet-server] Scope(Class[main]) Could not look up qualified variable '::role';
2016-12-21 20:59:17,236 WARN [puppet-server] Scope(Class[main]) Could not look up qualified variable '::profile';
2016-12-21 20:59:17,238 WARN [puppet-server] Scope(Class[main]) Could not look up qualified variable '::datacenter';
2016-12-21 20:59:17,239 WARN [puppet-server] Scope(Class[main]) Could not look up qualified variable '::role';
2016-12-21 20:59:17,240 WARN [puppet-server] Scope(Class[main]) Could not look up qualified variable '::profile';
2016-12-21 20:59:17,241 WARN [puppet-server] Scope(Class[main]) Could not look up qualified variable '::datacenter';
2016-12-21 20:59:17,243 WARN [puppet-server] Scope(Class[main]) Could not look up qualified variable '::role';
2016-12-21 20:59:17,243 WARN [puppet-server] Scope(Class[main]) Could not look up qualified variable '::profile';
2016-12-21 20:59:17,245 WARN [puppet-server] Scope(Class[main]) Could not look up qualified variable '::datacenter';
2016-12-21 20:59:18,406 ERROR [puppet-server] Puppet Must pass backupuser to Class[Mysql::Server::Backup] at /opt/puppet/environments/test/modules/profile/manifests/mysql/server.pp:12 on node mon.example.com
/usr/lib/ruby/vendor_ruby/puppet/util/errors.rb:106:in `fail'
/usr/lib/ruby/vendor_ruby/puppet/resource.rb:482:in `validate_complete'
org/jruby/RubyHash.java:1342:in `each'
[...]
cu denny
hi,
I try to understand the example from https://rnelson0.com/2015/02/02/deploying-mysql-with-puppet-without-disabling-selinux/comment-page-1/ with MySQL.
At this moment, most parts are working, except role/mysql.yaml . It seems, that this file isn't noticed by hiera/puppet:
:yaml:
:datadir: "/etc/puppet/environments/%{environment}/hieradata"
:hierarchy:
- "node/%{::fqdn}"
- "role/%{::role}"
- "profile/%{::profile}"
- "operatingsystem/%{::operatingsystem}/%{::operatingsystemmajrelease}"
- "operatingsystem/%{::operatingsystem}"
- "osfamily/%{::osfamily}"
- "datacenter/%{::datacenter}"
- "virtual/%{::is_virtual}"
- common
./manifests/site.pp
hiera_include('classes', '')
node default {
$role = hiera('role')
include $role
}
Here, you define $role, but you're pulling it from hiera as well-- where is this variable defined?
Facter.add(:role) do
setcode do
host = Facter.value(:fqdn)
declared_role = Facter.value(host)
declared_role.nil? ? 'base' : declared_role
end
end
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/2840db66-1c91-43c9-8e96-47f52b38f7e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
hieradata/node/mon.example.com.yaml
hieradata/role/mon.yaml
hieradata/global.yaml
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/06466f47-ef76-40d9-b61c-a99e3ac01f3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.