puppet local environment doesn't match server specified node environment switching agent to

1,766 views
Skip to first unread message

Andreas Dvorak

unread,
Sep 22, 2015, 3:55:31 AM9/22/15
to Puppet Users
Hi,

I have created a new environment for windows server, but the agent does not use it. Can somebody please help me?

message on agent run:
puppet local environment windows doesn't match server specified node environment switching agent to production

puppet.conf of windows agent

    [main]
    server=puppet-simu.baag
    ca_server=puppet1-simu.baag
    autoflush=true

    [agent]
    environment=windows
    pluginsync=true


puppet.conf of master
[main]
    autosign        = $confdir/autosign.conf { mode = 664 }
    environmentpath = $confdir/environments
    logdir          = /var/log/puppet
    rundir          = /var/run/puppet
    ssldir          = $vardir/ssl
    privatekeydir   = $ssldir/private_keys { group = service }
    hostprivkey     = $privatekeydir/$certname.pem { mode = 640 }
    pluginsync      = true

[agent]
    classfile         = $vardir/classes.txt
    localconfig       = $vardir/localconfig
    default_schedules = false
    report            = true
    pluginsync        = true
    masterport        = 8140
    environment       = production
    certname          = sv2655.muc.baag
    dns_alt_names     = puppet-simu.baag, puppet1-simu.baag
    server            = sv2655.muc.baag
    listen            = false
    splay             = false
    runinterval       = 1800
    noop              = false
    show_diff         = false

[master]
    autosign       = $confdir/autosign.conf { mode = 664 }
    reports        = foreman
    external_nodes = /etc/puppet/node.rb
    node_terminus  = exec
    ca             = true
    ssldir         = /var/lib/puppet/ssl


cat environment.conf
config_version = /usr/bin/git --git-dir /data/git/windows/.git show --stat | head -1| cut -d" " -f2
manifest       = /data/git/windows/manifests
modulepath     = /data/git/windows/modules

# pwd
/etc/puppet/environments
# ls -l
total 20
drwxr-xr-x 2 root root 4096 Oct 18  2013 common
drwxr-xr-x 3 root root 4096 Oct 18  2013 development
drwxr-xr-x 4 root root 4096 Sep 21 09:48 example_env
drwxr-xr-x 3 root root 4096 Sep 21 10:09 production
drwxr-xr-x 2 root root 4096 Sep 22 08:48 windows

# pwd
/data/git/windows/manifests

# ls -l
total 4
-rw-rw-r-- 1 gitwin gitwin  23 Sep 22 08:41 nodes.pp
-rw-rw-r-- 1 gitwin gitwin 195 Sep 22 08:41 site.pp
# cat site.pp
node default {
  notify { 'Server ist noch nicht in Puppet definiert': }
}
if versioncmp($::puppetversion, '3.6.0') >= 0 {
  Package {
    allow_virtual => true,
  }
}
hiera_include('classes')

# cat nodes.pp
node 'vm7523.baag' {
}


Best regards,
Andreas

Rich Burroughs

unread,
Sep 22, 2015, 4:32:26 AM9/22/15
to Puppet Users
Are you using Puppet Enterprise? If so, have a look at this:

https://docs.puppetlabs.com/pe/latest/console_classes_groups_preconfigured_groups.html#the-agent-specified-environment-node-group

If you are using the console for node classification you need to have a group that allows the agent to specify the environment, to use something other than production. Or you can create a group that points to a specific environment.


Rich
--
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/3b134331-5c38-47b4-bef5-9dd467318b4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andreas Dvorak

unread,
Sep 22, 2015, 4:51:17 AM9/22/15
to Puppet Users
Hi,

I am using Puppet 3.6.2 free version. The node classification is done by the node.pp file.
I do not understand the group. Where does the Puppet Master do the overwritting of the environment?

Andreas

jcbollinger

unread,
Sep 22, 2015, 8:57:01 AM9/22/15
to Puppet Users


A non-default environment for a given node can be specified either on the master (via an ENC or other node terminus) or by the agent, according to its configuration.  If it is specified in both places than the master wins, and a warning is reported on the agent.  This is what you are seeing.

You do have an ENC configured on your master, so presumably it is indeed setting nodes' environments.


John

Andreas Dvorak

unread,
Sep 22, 2015, 10:13:00 AM9/22/15
to Puppet Users
Hi,

now I found out that I need to create the new windows environment in The Foreman. Than I change the server in The Foreman from production to windows.

Thank you.

Andreas



Reply all
Reply to author
Forward
0 new messages