Creating the user account on puppet agent

78 views
Skip to first unread message

Raj Raju

unread,
Feb 24, 2015, 2:08:17 AM2/24/15
to puppet...@googlegroups.com
Hi,

I am tried to creating the user account on puppet agent.puppet agent is not reflecting my changes.

Edited  /etc/puppetlabs/puppet/manifests/site.pp file as follows:

node 'puppet.client.net' {
  include user
}


Edited  /etc/puppetlabs/puppet/manifests/init.pp file as follows:

class user {
  user { 'hellboy':
    ensure => present,
    comment => 'user',
    home => '/home/hellboy',
    managehome => true
  }
}



After that I have run below command on puppet agent

[root@puppet ~]# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for puppet.client.net
Info: Applying configuration version '1424761232'
Notice: Finished catalog run in 3.44 seconds

please help on this issue.

Johan De Wit

unread,
Feb 24, 2015, 2:51:42 AM2/24/15
to puppet...@googlegroups.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/75bfb8e2-51aa-4c05-a124-ff4c931f5bff%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)
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 Practitioner | http://www.open-future.be/puppet-practitioner-training-17th-till-19th-february

Bacula Administrator 1 | http://www.open-future.be/bacula-administrator-i-training-24th-till-26th-february

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

Zabbix Certified Professional | http://www.open-future.be/zabbix-certified-professional-training-5th-till-6th-march

Bacula Administrator 1 | http://www.open-future.be/bacula-administrator-i-training-10th-till-12th-march

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

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


jcbollinger

unread,
Feb 24, 2015, 9:25:33 AM2/24/15
to puppet...@googlegroups.com


On Tuesday, February 24, 2015 at 1:08:17 AM UTC-6, Raj Raju wrote:
Hi,

I am tried to creating the user account on puppet agent.puppet agent is not reflecting my changes.

Edited  /etc/puppetlabs/puppet/manifests/site.pp file as follows:

node 'puppet.client.net' {
  include user
}


Edited  /etc/puppetlabs/puppet/manifests/init.pp file as follows:

class user {
  user { 'hellboy':
    ensure => present,
    comment => 'user',
    home => '/home/hellboy',
    managehome => true
  }
}



First off, it's unclear on which machine you made those changes.  Since you are using the agent, the manifests that are effective are those on the machine that serves as master.  That can be the same machine on which you are running the agent, but typically it is not.

Secondly, a class named "user" should be defined in a manifest file <puppet base>/modules/user/manifests/init.pp.  It appear that you are attempting to put yours in <puppet base>/manifests/init.pp.  Under some circumstances that might nevertheless work, but you should get started on the right foot to avoid making a mess that you will later need to clean up.

Note: I'm assuming that /etc/puppetlabs/puppet is the correct Puppet base directory (confdir) for your installation.  That's one of the usual choices, but not the default.
 


After that I have run below command on puppet agent

[root@puppet ~]# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for puppet.client.net
Info: Applying configuration version '1424761232'
Notice: Finished catalog run in 3.44 seconds



I suppose you are trying to point out that the log does not mention the specified user, but is the user in fact present?  At default verbosity, the agent does not report about resources that are already in the correct state.

If the agent is running in daemon mode, then it might have applied your config change between when you saved your manifest changes on the master, and when you ran the agent manually.  Alternatively, if you created the user by some other means, or if you previously ran the agent manually, then that user may have been created.  The agent will emit information about all managed resources if you add the --debug option to your command.

If the debug output does not mention your user resource then it follows that you're not working with the manifests that the master is relying on.  In that case, you might be editing manifests on the agent (and the master is a different machine).


John

Reply all
Reply to author
Forward
0 new messages