Ask Your Question
0

pe 201502 - new env ignored

asked 2015-09-21 02:50:09 -0600

cm01 gravatar image

updated 2015-10-05 18:33:08 -0600

Guys,

I've added a new env test1 by adding the appropriate dirs on the Master and target node.
I've pinned the node to the test1 env group (and its not listed in the pinned nodes for production), but whenever I run

puppet agent -t

it says

production.

Can anybody help?

NB: I want the node's env to be controlled by the Master.

Chris

@Greg:

On the node:

 puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for vm3.local
Info: Applying configuration version '1442966700'
Notice: Applied catalog in 1.01 seconds

 puppet config print environment
production

Can you be a bit more specific about the console info please. Is this what you want?

Test1 environment

Parent
    Production environment
Environment
    test1 env group


1 node is pinned to this node group:
Certname         

vm3.local

@Greg (2):

Classification

Create, edit, and remove node groups here.
Node group name     Parent name     Environment      

Agent-specified environment Production environment  agent-specified env group    
All Nodes   All Nodes   production   
NTP All Nodes   production   
PE ActiveMQ Broker  PE Infrastructure   production   
PE Agent    PE Infrastructure   production   
PE Certificate Authority    PE Infrastructure   production   
PE Console  PE Infrastructure   production   
PE Infrastructure   All Nodes   production   
PE Master   PE Infrastructure   production   
PE MCollective  PE Infrastructure   production   
PE PuppetDB PE Infrastructure   production   
Production environment  All Nodes   production env group     
Test1 environment   Production environment  test1 env group     


vm3.local

    Facts Classes Variables Reports Groups 

Class   Source group
puppet_enterprise::profile::agent   PE Agent
puppet_enterprise   PE Agent
ntp     NTP
puppet_enterprise::profile::mcollective::agent  PE MCollective
puppet_enterprise   PE MCollective


# cat puppet.conf 
# This file can be used to override the default puppet settings.
# See the following links for more details on what settings are available:
# - https://docs.puppetlabs.com/puppet/latest/reference/config_important_settings.html
# - https://docs.puppetlabs.com/puppet/latest/reference/config_about_settings.html
# - https://docs.puppetlabs.com/puppet/latest/reference/config_file_main.html
# - https://docs.puppetlabs.com/references/latest/configuration.html
[main]
server = puppet.local
[agent]
certname = vm3.local

HTH
PS how do you post the exact image like that?

@Greg:

Interesting; created user to install on vm3 by basically copying user2 on vm2 (you solved my qn about that) and got

# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for vm3.local
Info: Applying configuration version '1443059500'
Notice: Applied catalog in 0.86 seconds

However, it didn't create the user or home dir or group ie nada...


Definitely sure :)

Actually, I just realised that wasn't entirely clear (above); what I actually did was copy the user2 manifests then edited to user3 to match the hostname (for consistency). Also I checked the passwd, group files and /home dir.


Re classes:

In the file /etc/puppetlabs/code/environments/test1/manifests/site.pp

node 'vm3.local' {
    include vm3
}


/etc/puppetlabs/code/environments/test1/modules/vm3/manifests
# ls
groups.pp  init.pp  users.pp
# cat *
class vm3::groups {
    group { "pupusers":
        ensure => present,
        gid    => 3000,
    }
}

# vm3.local defn
class vm3 {
        include vm3::groups
        include vm3::users ...
(more)
edit retag flag offensive close merge delete

Comments

Can you create a pastebin of the agent output and post a link to it? It would also help to see a screenshot of the top of the node detail page in PE Console where classification is displayed.

GregLarkin gravatar imageGregLarkin ( 2015-09-22 10:26:17 -0600 )edit

You can post images by taking a screenshot, saving it locally to your machine, and clicking the "image" toolbar button when you edit your question. It looks like a picture frame.

GregLarkin gravatar imageGregLarkin ( 2015-09-23 11:37:47 -0600 )edit

Just to back up a bit - are there any resources in your test1 environment that you expect to be applied to vm3.local but are not? The fact that the configprint environment output shows "production" only means that's what the puppet agent is reading from puppet.conf or is the default if not specified

GregLarkin gravatar imageGregLarkin ( 2015-09-23 11:42:07 -0600 )edit

When the agent contacts the master, the master will set the environment properly. You should try adding some unique code to a class in the test1 environment, run the agent again and see if it is applied to the node. If it isn't, we can dig in further.

GregLarkin gravatar imageGregLarkin ( 2015-09-23 11:42:55 -0600 )edit

Dumb question, but are you sure that user2 is not already present on the machine? It would be helpful to put a notify resource with a debug message in the same class that declares user2. Notify resources always emit a message, and it's a good way to test to make sure your class is being applied.

GregLarkin gravatar imageGregLarkin ( 2015-09-24 11:38:07 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-09-25 04:14:20 -0600

dont want to muddy the answers here so feel free to ignore!

puppet config print environment will say production by default

type:

puppet config print -section agent environment

this shoud give correct environment

edit flag offensive delete link more
0

answered 2015-09-23 00:41:40 -0600

GregLarkin gravatar image

I'd like to see the list of groups in the classification page of your console, like this one:

image description

and then, the list of classes assigned to the node in question, like this:

image description

Also, please post the contents of your puppet.conf file from your vm3.local node.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-09-21 02:50:09 -0600

Seen: 243 times

Last updated: Oct 05 '15