[vagrant@client puppet]$ sudo puppet apply --environment test manifests/
Warning: Unknown variable: '::puppet::common_loglevel'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:3:21
Warning: Unknown variable: 'puppet::agent_loglevel'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:7:7
Warning: Unknown variable: '::puppet::server'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:10:18
Warning: Unknown variable: 'puppet::apply_loglevel'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:14:7
Notice: Compiled catalog for client.example.com in environment test in 0.04 seconds
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/content: content changed '{md5}a72aadac19feefd06f10fb6b8f90c5f4' to '{md5}0f89a3d91b54aec8463b4a250a493f36'
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/owner: owner changed 'vagrant' to 'root'
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/group: group changed 'vagrant' to 'wheel'
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/mode: mode changed '0664' to '0644'
Notice: Applied catalog in 0.06 seconds
[vagrant@client puppet]$
# Generated by Puppet EPP template processor
[
master
]
log_level
=
<
%= $::puppet::common_loglevel %>
# This is used by "puppet agent"
[agent]
<% if $puppet::agent_loglevel !=
undef
{
-
%>
log_level = <%= $::puppet::agent_loglevel %>
<
% }
-
%>
server = <%= $::puppet::server %>
# This is used for "puppet apply"
[
user
]
<
% if
$puppet
::
apply_loglevel
!=
undef
{
-
%>
log_level = <%= $::puppet::apply_loglevel %>
<
% }
-%>
class
puppet
(
$version
=
'latest'
,
$status
=
'running'
,
$enabled
=
true
,
$server
=
'puppet.example.com'
,
$common_loglevel
=
'warning'
,
$agent_loglevel
=
undef
,
$apply_loglevel
=
undef
,
)
{
I'm stepping through "Learning Puppet 4", and I ran into an error following steps in the book, and I want to understand what went wrong before I report it.
The section in question is "Using Puppet EPP Templates" in chapter 13.
I'll work backwards from the error I'm getting, showing the relevant files afterwards. Here is what I see when I apply the manifest:
[vagrant@client puppet]$ sudo puppet apply --environment test manifests/
Warning: Unknown variable: '::puppet::common_loglevel'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:3:21
Warning: Unknown variable: 'puppet::agent_loglevel'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:7:7
Warning: Unknown variable: '::puppet::server'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:10:18
Warning: Unknown variable: 'puppet::apply_loglevel'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:14:7
Notice: Compiled catalog for client.example.com in environment test in 0.04 seconds
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/content: content changed '{md5}a72aadac19feefd06f10fb6b8f90c5f4' to '{md5}0f89a3d91b54aec8463b4a250a493f36'
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/owner: owner changed 'vagrant' to 'root'
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/group: group changed 'vagrant' to 'wheel'
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/mode: mode changed '0664' to '0644'
Notice: Applied catalog in 0.06 seconds
[vagrant@client puppet]$
I also find it curious that the error messages print the name of the variable differently for different messages, sometimes prefixed with "::" and sometimes not. Any background that would explain that?
--
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/01a83a7f-c3f2-4ca6-83d9-df09bec41527%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi David:On Thu, May 19, 2016 at 1:57 PM, David Karr <davidmic...@gmail.com> wrote:I'm stepping through "Learning Puppet 4", and I ran into an error following steps in the book, and I want to understand what went wrong before I report it.
The section in question is "Using Puppet EPP Templates" in chapter 13.
I'll work backwards from the error I'm getting, showing the relevant files afterwards. Here is what I see when I apply the manifest:
[vagrant@client puppet]$ sudo puppet apply --environment test manifests/
Warning: Unknown variable: '::puppet::common_loglevel'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:3:21
Warning: Unknown variable: 'puppet::agent_loglevel'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:7:7
Warning: Unknown variable: '::puppet::server'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:10:18
Warning: Unknown variable: 'puppet::apply_loglevel'. at /etc/puppetlabs/code/environments/test/modules/puppet/templates/puppet.conf.epp:14:7
Notice: Compiled catalog for client.example.com in environment test in 0.04 seconds
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/content: content changed '{md5}a72aadac19feefd06f10fb6b8f90c5f4' to '{md5}0f89a3d91b54aec8463b4a250a493f36'
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/owner: owner changed 'vagrant' to 'root'
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/group: group changed 'vagrant' to 'wheel'
Notice: /Stage[main]/Main/File[/etc/puppetlabs/puppet/puppet.conf]/mode: mode changed '0664' to '0644'
Notice: Applied catalog in 0.06 seconds
[vagrant@client puppet]$Based on the warnings, it looks like the "puppet" class hasn't been declared. Did you `include puppet` somewhere or otherwise classify the node to include the "puppet" class?
class puppet(
# input parameters and default values for the class
$version = 'latest',
$status = 'running',
$enabled = true,
$server = 'puppet.example.com',
$common_loglevel = 'warning',
$agent_loglevel = undef,
$apply_loglevel = undef,
) {
# echo the input provided
notice("Install the $version version of Puppet, ensure it's $status, and set boot time start $enabled.")
# install puppet-agent
package { 'puppet-agent':
ensure => 'latest',
notify => Service['puppet'],
}
# manage the puppet service
service { 'puppet':
ensure => 'running',
enable => true,
subscribe => Package['puppet-agent'],
}
}
class puppet::agent {
}
file { '/etc/puppetlabs/puppet/puppet.conf':
ensure => file,
owner => 'root',
group => 'wheel',
mode => '0644',
# source => 'puppet:///modules/puppet/puppet.conf',
content => epp('puppet/puppet.conf.epp'),
}
--
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/99b94d41-8990-49a9-a927-3f2b8058a461%40googlegroups.com.
--
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/2ed6950d-124f-4baf-8d0a-d878832ede4d%40googlegroups.com.