Hello Everyone,
I'm pretty new to puppet and foreman ( about 2 weeks ) but I find
them to be great tools.
This is my test environment:
Puppetmaster (2.69) running on CentOS with foreman 0.3-1 and 2 nodes
cent0S and RHEL5.5. I set up ENC following the instructions on foreman
website.
Everything worked fine except my nodes can't node see the values of
global parameters.
When I click on (Foreman Interface)YAML link or execute (puppetmaster
command line)/etc/puppet/node.rb <nodename> I can see all values but
my configuration on the nodes are failing because they can't see the
values of my global parameters.
Does anyone know what I am missing ?
Any suggestions on the this would be greatly appreciated
Cheers,
Raquel.
Puppet.conf
[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
[master]
storeconfigs = true
dbadapter = mysql
dbuser = puppet
dbpassword = puppet
dbserver = localhost
dbsocket = /var/lib/mysql/mysql.sock
rrddir=/var/lib/puppet/rrd
rrdinterval=$runinterval
rrdgraph=true
# Enable reporting for Foreman
reports=log, foreman
autosing = true
Actitivate external node classifier
external_nodes = /etc/puppet/node.rb
node_terminus = exec
modulepaht=/etc/puppet/modules
node.rb
#! /usr/bin/ruby
a simple script which fetches external nodes from Foreman
you can basically use anything that knows how to get http data, e.g.
wget/curl etc.
Foreman url
foreman_url="http://xx.xx.xx.xx:3000"
require 'yaml'
require 'uri'
require 'net/http'
foreman_url += "/node/#{ARGV[0]}?format=yml"
url = URI.parse(foreman_url)
$stdout.puts "%s:%s%s" % [ url.host, url.port, url.path]
req = Net::HTTP::Get.new(foreman_url)
res = Net::HTTP.start(url.host, url.port) {|http| http.request(req)}
case res
when Net::HTTPOK
puts res.body
else
$stderr.puts "Error retrieving node %s: %s" % [ARGV[0], res.class]
end