useradd Puppet manifest
class useradd { user { “testabc”: ensure => present, uid => 1002, shell => “/bin/bash”, home => “/home/testabc”, group => ‘puppet’ managehome => true } }
class useradd { user { “testabc”: ensure => present, uid => 1002, shell => “/bin/bash”, home => “/home/testabc”, group => ‘puppet’ managehome => true } }
vi init.pp class httpd { file { “/etc/httpd/conf/httpd.conf”: ensure => present, require => Package[‘httpd’], notify => Service[‘httpd’], } service { “httpd”: ensure => running, enable => true, } package { “httpd”: ensure => present } file { “/etc/httpd/conf.d/vhost.conf”: ensure => present, source => “puppet:///httpd/vhost.conf”, owner => root, group => root, } }
#DevOps and automating the repayment of technical debt.
On the Master Server: cd /etc/puppet/modules/motd mdkir {files,manifest,template,test} cd manifest vi init.pp class motd { file { ‘/etc/motd’: ensure => file, source => ‘puppet:///modules/motd/motd’, } }
On the Client: # puppet agent -t on the master # puppet cert list # puppet cert sign clienthostname
Install latest versions of Puppet using Puppet Labs package repository on your correspondent CentOS versions # rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm On the Master Server Set the hostname of the master server to puppet vi /etc/sysconfig/networks hostname = puppet # yum install puppet-server # service puppetmaster restart vi /etc/ssh/sshd_Config uncomment permitrootlogin = yes On the Client Server … More Installation of Puppet Master and Client on CentOS 6.6