Close

Foreman – triggering a puppet run from the gui interface

https://github.com/ripienaar/mcollective-vagrant

Announcement

I have released my new course on Udemy, Kubernetes By Example. Sign up now to get free lifetime access!

On the agent, add the following near to the top of the file:

# vim /etc/puppet/auth.conf
path /run
allow *

Note: later on change the “*” to the fqdn of the puppetmaster fqdn.

On the puppetmaster enable mcollective:

$ cat /etc/foreman-proxy/settings.d/puppet.yml
.
.
.# valid providers:
#   puppetrun   (for puppetrun/kick, deprecated in Puppet 3)
#   mcollective (uses mco puppet)
#   puppetssh   (run puppet over ssh)
#   salt        (uses salt puppet.run)
#   customrun   (calls a custom command with args)
:puppet_provider: mcollective
.
.
.

Foreman gui:
on foreman settings (More -> Settings -> “Puppet”tab), set puppetrun to “true”.

Edit the master sudoers file as described here:

http://theforeman.org/manuals/1.8/index.html#4.3.7Puppet

On the agent add the following to sudoers file:

# /etc/sudoers
foreman-proxy ALL=(ALL) NOPASSWD: ALL
foreman ALL=(ALL) NOPASSWD: ALL


On foreman, You might need to do the following for the first time only:

# on the agent first do:
$ service puppet restart
# then on master, do:
puppet kick puppetagent01.local
# then on foreman gui, hit the puppet run button

https://tickets.puppetlabs.com/browse/PUP-2659

http://wiki.infn.it/progetti/cloud-areapd/best_practices/config_puppetrun

https://groups.google.com/forum/#!topic/foreman-users/vFViUPc8zok

http://serverfault.com/questions/638360/how-to-get-run-puppet-button-working-on-foreman

This might be best:
http://projects.theforeman.org/projects/foreman/wiki/_mcollective_

https://github.com/witlessbird/foreman_mco # you can install this using:

$ yum install ruby193-rubygem-foreman-mco.noarch

I think on the agents you need to do:

$ yum install mcollective-client

Actually, I think the above is done on the foreman server itself, see:

http://www.pythian.com/blog/some-observations-of-puppetrun-with-foreman/

https://github.com/puppet-community/puppet-mcollective