Last active
August 29, 2015 14:18
-
-
Save nalingarg2/51aedeb669ded7ae7011 to your computer and use it in GitHub Desktop.
puppet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://docs.puppetlabs.com/learning/agent_master_basic.html | |
┌───────────────┬───────────────────┐ | |
│ Pre-2.6 │ Post-2.6 │ | |
├───────────────┼───────────────────┤ | |
│ puppetmasterd │ puppet master │ | |
│ puppetd │ puppet agent │ | |
│ puppet │ puppet apply │ | |
│ puppetca │ puppet cert │ | |
│ ralsh │ puppet resource │ | |
│ puppetrun │ puppet kick │ | |
│ puppetqd │ puppet queue │ | |
│ filebucket │ puppet filebucket │ | |
│ puppetdoc │ puppet doc │ | |
│ pi │ puppet describe │ | |
└───────────────┴───────────────────┘ | |
#Installing Repo | |
rpm -‐ivh http://yum.puppetlabs.com/puppetlabs-‐ release-‐el-‐6.noarch.rpm | |
# Installing Puppet Master | |
yum install puppet-‐server | |
#service puppetmaster start | |
#Installing Agent | |
yum install puppet | |
service puppet start * | |
#////////////////////////////////////////////////////////////////////////////////////// | |
#puppet agent | |
puppet agent --waitforcert 30 --server server -v | |
# Settings in [main] are used if a more specific section | |
# doesn’t set a value. | |
[main] | |
server = puppetserver.ops.cw.com | |
# | |
puppet | |
master | |
and | |
puppet | |
cert | |
applications. | |
[master] | |
certname = puppetserver.ops.cw.com | |
#////////////////////////////////////////////////////////////////// | |
#////////////////////////////////////////////////////////////////// | |
#puppet-agent | |
server = puppetserver.ops.cw.com | |
pluginsync = true | |
#////////////////////////////////////////////////////////////////// | |
#puppet agent | |
puppet agent --waitforcert 30 --server server -v | |
puppet agent --test | |
#puppet server | |
puppet cert list | |
puppet cert sign agent1.localdomain | |
nano /etc/puppetlabs/puppet/manifests/site.pp | |
#///////////////////////////////////////////////////////////////////////////////////////////// | |
node 'pagent.novalocal' { | |
# Note the quotes around the name! Node names can have characters that | |
# aren't legal for class names, so you can't always use bare, unquoted | |
# strings like we do with classes. | |
# Any resource or class declaration can go inside here. For now: | |
package | |
{ | |
"build-‐essential": | |
ensure => installed, | |
provider => yum; | |
"python": | |
ensure => installed, | |
provider => yum; | |
"python-‐dev": | |
ensure => installed, | |
provider => yum; | |
"python-‐setuptools": | |
ensure => installed, | |
provider => yum; | |
} | |
file | |
{ | |
'/tmp/test2': | |
ensure => directory, | |
mode => 0644 | |
} | |
} | |
#////////////////////////////////////////////////////////////////////////////////////////// | |
puppet parser validate /etc/puppet/manifests/site.pp | |
#//////////////////////////////////////////////////////////////////////////////////////// | |
puppet apply etc/puppet/manifests/site.pp --debug | |
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$4 | |
or | |
nano /etc/puppet/manifests/site.pp | |
#///////////////////////////////////////////////////// | |
node 'pagent' { | |
include test | |
} | |
#///////////////////////////////////////////////////// | |
nano /etc/puppet/modules/test/manifests/init.pp | |
#///////////////////////////////////////////////////////// | |
class test { | |
# Note the quotes around the name! Node names can have characters that | |
# aren't legal for class names, so you can't always use bare, unquoted | |
# strings like we do with classes. | |
# Any resource or class declaration can go inside here. For now: | |
package | |
{ | |
"build-‐essential": | |
ensure => installed, | |
provider => yum; | |
"python": | |
ensure => installed, | |
provider => yum; | |
"python-‐dev": | |
ensure => installed, | |
provider => yum; | |
"python-‐setuptools": | |
ensure => installed, | |
provider => yum; | |
} | |
file | |
{ | |
'/tmp/test3': | |
ensure => directory, | |
mode => 0644 | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment