Tuesday, January 6, 2015

puppet



  • to check if the puppet agent is running:
    •   service puppet status
    • usually, the service is monitoreed and should not be stopped
  • Enable / disable
    • [root@p1al25]# puppet agent --disable "Modification blahblah" --verbose
    • [root@p1al25]# puppet agent --enable --verbose
  • Execute puppet agent
    • puppet agent -t  --debug
    • used to install the latest version of the package
  • check if the agent is enabled or disabled
    • [root@p1al25 ~]# service puppet status
    • puppet (pid 4387) is running...
    • [root@p1al25 ~]# puppet agent --disable "my message" --verbose
    • check if it is disabled or not
      • [root@p1al25 ~]# cat `puppet agent --configprint agent_disabled_lockfile` 
      • {"disabled_message":"reason not specified"}
    • I advise to use --verbose, otherwise you don’t get the errors.
  • In the case herebelow, I was using puppet with a non root user. This user doesn’t have the privilege to create files in its root.
    • bash-4.1$ puppet agent
    • bash-4.1$ puppet agent --verbose
      • Error: Could not set 'directory' on ensure: Permission denied - /data1/toto/.puppet
      • Error: Could not set 'directory' on ensure: Permission denied - /data1/toto/.puppet
      • Wrapped exception:
      • Permission denied - /data1/leguide/ciao/.puppet
  • puppet conf
    • puppet config print
      • is supposed to print what is in
      • less /etc/puppet/puppet.conf
  • puppet certificates
    • server:
      • puppet cert clean lgstagevirt-vm-3s-1.toto.com
      • puppet cert list --all |grep vm
    • client:
      • \rm -r /var/lib/puppet/ssl
      • puppet agent -t -d --waitforcert 30
    • then server:
      • puppet cert sign  lgstagevirt-vm-3s-1.toto.com

No comments: