Tuesday, August 16, 2016

Puppet Client Installation Steps

I am sharing the steps to be followed to install Puppet on CentOS.
I will not cover the steps to followed to CentOS.

  • Install CentOS
  • Edit the /etc/ssh/sshd_config file, ensure Permit Root Login is YES
  • Install Yum Repo for Puppet 
$rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm ]
         [ Please validate the arch of the Linux distribution you are using ]
  • Now install puppet using Yum  
$yum install puppet 
  • Edit the puppet.conf file to add the puppet server. Also add puppet server in the /etc/hosts to make sure it points to the right server node.
[main]
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig

server = puppet1.mylabserver.com
  • test the setup by using the command $puppet agent -t
[root@host2 puppet]# puppet agent -t
Info: Creating a new SSL key for host2.mylabserver.com
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for host2.mylabserver.com
Info: Certificate Request fingerprint (SHA256): 02:85:1F:AF:BF:04:32:93:A6:64:5B:CE:04:5B:CF:99:BF:1B:C9:D6:BA:20:84:0E:E4:F3:84:D4:2C:D8:F4:B3
Exiting; no certificate found and waitforcert is disabled
  • Sign the certificate at the master node :
[root@puppet1 ~]# puppet cert list
  "host2.mylabserver.com" (SHA256) 02:85:1F:AF:BF:04:32:93:A6:64:5B:CE:04:5B:CF:99:BF:1B:C9:D6:BA:20:84:0E:E4:F3:84:D4:2C:D8:F4:B3
[root@puppet1 ~]# puppet cert sign host2.mylabserver.com
Notice: Signed certificate request for host2.mylabserver.com
Notice: Removing file Puppet::SSL::CertificateRequest host2.mylabserver.com at '/etc/puppetlabs/puppet/ssl/ca/requests/ashsethi2.mylabserver.com.pem'

  • Now when you run puppet agent -t on the host2 node, it will show that it is recognised by the puppet server, in this case puppet1.mylabserver.com

No comments:

Post a Comment

The Azure Synapse Resource Provider Error

  If you are get the error " The Azure Synapse resource provider (Microsoft.Synapse) needs to be registered with the selected subscript...