--environment being over ridden by PE console's default environment group

90 views
Skip to first unread message

Carl P

unread,
Mar 6, 2015, 11:04:26 AM3/6/15
to puppet...@googlegroups.com
Hi,

I'm using dynamic environments with PE 3.7. I have production and development sub-directories in /etc/puppetlabs/puppet/environments containing environment.conf, hiera.yaml, Puppetfile, manifests/site.pp and modules/<various modules>

The nodes I'm trying to apply config to are members of the default production node group only.

When I run 'puppet agent -tv' all gets configured correctly, but when I try to configure it with the code in the development directory using 'puppet agent -tv --environment=development' I see the message:

         Warning: Local environment: "development" doesn't match server specified node environment "production", switching agent to "production".

I've spent a lot of time trying to resolve this problem to no avail. I'd appreciate a little help.

Many thanks
Carl

Nick Howes

unread,
Mar 7, 2015, 7:06:42 AM3/7/15
to puppet...@googlegroups.com
On Friday, 6 March 2015 16:04:26 UTC, Carl P wrote:
I'm using dynamic environments with PE 3.7. I have production and development sub-directories in /etc/puppetlabs/puppet/environments containing environment.conf, hiera.yaml, Puppetfile, manifests/site.pp and modules/<various modules>

The nodes I'm trying to apply config to are members of the default production node group only.

When I run 'puppet agent -tv' all gets configured correctly, but when I try to configure it with the code in the development directory using 'puppet agent -tv --environment=development' I see the message:

         Warning: Local environment: "development" doesn't match server specified node environment "production", switching agent to "production".

If an ENC (in this case Puppet Console) specifies an environment, then that will always override anything the agent tries to do. In general an ENC can choose not to set an environment, letting the agent decide. So you either need to set the node's environment from the Console, or tell it not to specify an environment. According to the PE docs linked below, it's possible to put a node in a node group with a special envrionment value of "Agent-specified", which will let the node make the decision.

Johan De Wit

unread,
Mar 7, 2015, 1:51:23 PM3/7/15
to puppet...@googlegroups.com
I made a blog about this topic, and how to enable dynamic environments, r10k and PE3.7

http://johan.koewacht.net/puppet/2015/01/12/R10k-and-PE-Console.html

Maybe it has some info in it that you could use

Grts

johan
--
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/0d5bce83-aab4-42e5-aa0f-df8c334b4108%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer              (805008667232363)
Puppet Certified Professional 2013/2014 (PCP0000006)
Puppet Certified Intstructor 
blog : http://johan.koewacht.net/
_________________________________________________________
 
Open-Future                 Phone     +32 (0)2/255 70 70
Zavelstraat 72              Fax       +32 (0)2/255 70 71
3071 KORTENBERG             Mobile    +32 (0)474/42 40 73
BELGIUM                     http://www.open-future.be
_________________________________________________________
 

Upcoming Events:

Puppet Fundamentals | http://www.open-future.be/puppet-fundamentals-training-16th-till-18th-march

Puppet Architect | http://www.open-future.be/puppet-architect-training-19th-till-20th-march

Puppet Practitioner | http://www.open-future.be/puppet-practitioner-training-14th-till-16th-april

Linux Training | http://www.open-future.be/linux-training-20th-till-24th-april

Bacula Administrator 1 | http://www.open-future.be/bacula-administrator-i-training-28th-till-30th-april

Zabbix Certified Specialist | http://www.open-future.be/zabbix-certified-specialist-training-4th-till-6th-may

Zabbix Certified Professional | http://www.open-future.be/zabbix-certified-professional-training-7th-till-8th-may

Subscribe to our newsletter: http://eepurl.com/BUG8H


Carl P

unread,
Mar 8, 2015, 3:20:23 PM3/8/15
to puppet...@googlegroups.com
Thanks Nick. I'll try this first thing tomorrow.

Regards
Carl

Carl P

unread,
Mar 8, 2015, 3:28:48 PM3/8/15
to puppet...@googlegroups.com
Excellent Johan. I'm using R10K so I'll look at your article in detail.

Many thanks.

Carl P

unread,
Mar 8, 2015, 5:30:33 PM3/8/15
to puppet...@googlegroups.com
Couldn't wait until the morning. Tried it on my lapi and it works perfectly! I really appreciate your's and Johan's help with this.

Regards
Carl
Reply all
Reply to author
Forward
0 new messages