You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

User:Razzi/Installing puppet on mac

From Wikitech-static
Jump to navigation Jump to search
brew install puppetlabs/puppet/puppet-agent

Puppet executable lives at

/opt/puppetlabs/bin/puppet

It's added to the path, upon the next shell restart: /opt/puppetlabs/bin got added to path (but how?!)

Get an example module with at https://github.com/gbuktenica/Puppet_Masterless/

git clone https://github.com/gbuktenica/Puppet_Masterless/
cd Puppet_Masterless

Run it without a server with:

/opt/puppetlabs/bin/puppet apply --modulepath ./modules/ manifests/site.pp

Even simpler:

$ cat helloworld.pp
file { '/tmp/helloworld.txt':
  content => "hello world"
}

puppet apply helloworld.pp

Bolt

brew install puppet-bolt

bolt project init datahub_alpha

bolt module add puppetlabs-vcsrepo

bolt apply helloworld.pp --target localhost

Timing: puppet apply wins

puppet-datahub $ time bolt apply helloworld.pp --target localhost
...
Ran on 1 target in 3.69 sec

________________________________________________________
Executed in    4.62 secs    fish           external
   usr time    2.84 secs  506.00 micros    2.83 secs
   sys time    0.41 secs   51.00 micros    0.41 secs

puppet-datahub $ time puppet apply helloworld.pp
Notice: Compiled catalog for razzi-framework. in environment production in 0.01 seconds
Notice: Applied catalog in 0.00 seconds

________________________________________________________
Executed in    1.64 secs      fish           external
   usr time  794.29 millis  493.00 micros  793.79 millis
   sys time  100.33 millis   51.00 micros  100.28 millis

How to install puppet modules with r10k:

r10k puppetfile install