Good afternoon!
I'm struggling to make the foreman read the reports, already read many
tutorials, and also other discussions here, but still can not work.
I'll show how this environment:
Puppet.conf of puppetmaster:
[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
factpath = $vardir/lib/facter
templatedir = $confdir/templates
pluginsync = true
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
reportdir = /var/lib/puppet/reports
autosign = true
modulepath=/etc/puppet/modules
[agent]
report = true
ignorecache = true
[master]
reports = foreman, http, store, log
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
reportdir = /var/lib/puppet/reports
storeconfigs = true
dbadapter = mysql
dbuser = puppet
dbpassword = puppet
dbname = puppet
dbserver = localhost
dbsocket = /var/lib/mysql/mysql.sock
modulepath=/etc/puppet/modules
rrddir=/var/lib/puppet/rrd
rrdinterval=$runinterval
rrdgraph=true
And my puppet.conf of my clients:
[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
report = true
[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/localconfigi
runinterval = 14400
report = true
server = server.domain.com.br
I took a look at my log and it has no entry for this parameter
"ReportsController#upload"
it is my foreman.rb
$foreman_url="https://172.16.3.19:443"
require 'puppet'
require 'net/http'
require 'uri'
Puppet::Reports.register_report(:foreman) do
Puppet.settings.use(:reporting)
desc "Sends reports directly to Foreman"
def process
begin
uri = URI.parse($foreman_url)
http = Net::HTTP.new(uri.host, uri.port)
if uri.scheme == 'https' then
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
req = Net::HTTP::Post.new("/reports/create?format=yml")
req.set_form_data({'report' => to_yaml})
response = http.request(req)
rescue Exception => e
raise Puppet::Error, "Could not send report to Foreman at
#{$foreman_url}/reports/create?format=yml: #{e}"
end
end
end
foreman.rb the file has to be on clients too?
I wonder what's wrong in my installation?
Tks
[]'s