Foreman report 403 forbidden when receive reports from puppet

Hello,everyone
I'm a newbie in foreman.I fall in problem with reports.
I have tow server, A and B.A used as Foreman,B usea as puppet server and
puppet agent.

Foreman has the following error message, puppet working perfect.How can I
resolve it?
Started POST "/api/reports" for 10.68.189.45 at 2015-01-13 13:24:17 +0800
Processing by Api::V2::ReportsController#create as JSON
Parameters: {"report"=>"[FILTERED]", "apiv"=>"v2"}
No smart proxy server found on [] and is not in trusted_puppetmaster_hosts
Rendered api/v2/errors/access_denied.json.rabl within
api/v2/layouts/error_layout (0.5ms)
Filter chain halted as :require_puppetmaster_or_login rendered or redirected
Completed 403 Forbidden in 9.3ms (Views: 1.4ms | ActiveRecord: 0.4ms)

Server A environment is
RHEL6.2;ruby2.0.0p451;foreman 1.7,without other app
Server B environment is
RHEL6.2;ruby1.8.7 352;puppet/puppet-server 3.4.2-1 without other
app
Both have iptables/selinux disalbed

Server B,Puppet configuration
cat /etc/puppet/foreman.yaml

··· --- # Update for your Foreman and Puppet master hostname(s) :url: "http://10.68.189.206:3000" :ssl_ca: "/var/lib/puppet/ssl/certs/ca.pem" :ssl_cert: "/var/lib/puppet/ssl/certs/test.puppet.com.pem" :ssl_key: "/var/lib/puppet/ssl/private_keys/test.puppet.com.pem" :user: "admin" :password: "As687656"

Advanced settings

:puppetdir: “/var/lib/puppet”
:puppetuser: “puppet”
:facts: true
:timeout: 10
:threads: null

Server A ,Foreman configuration
cat database.yml
production:
adapter: mysql2
database: foreman
username: foreman
password: foreman
host: localhost
socket: /var/lib/mysql/mysql.sock

cat settings.yaml

You must restart the Rack server after changing either of these values

because they are cached at startup.

:unattended: true
:login: true
:require_ssl: false
:locations_enabled: false
:organizations_enabled: false
#JSONP or “JSON with padding” is a complement to the base JSON data format.
#It provides a method to request JSON data from a server in a different
domain.
:support_jsonp: false
#:puppetconfdir: /etc/puppet
#:puppetvardir: /var/lib/puppet

Mark translated strings with X characters (for developers)

:mark_translated: false

Local administrative settings for application domain, fqdn, foreman URL,

administrator email address etc. If you don’t have a Puppet provisioning

system you may want to change to setup your project on your local machine.

:domain: ‘localdomain.net
:fqdn: ‘localhost.localdomain.net

anyone can help me?

在 2015年1月13日星期二 UTC+8下午6:45:42,admi…@gmail.com写道:

··· > > Hello,everyone > I'm a newbie in foreman.I fall in problem with reports. > I have tow server, A and B.A used as Foreman,B usea as puppet server > and puppet agent. > > Foreman has the following error message, puppet working perfect.How can I > resolve it? > Started POST "/api/reports" for 10.68.189.45 at 2015-01-13 13:24:17 +0800 > Processing by Api::V2::ReportsController#create as JSON > Parameters: {"report"=>"[FILTERED]", "apiv"=>"v2"} > No smart proxy server found on [] and is not in trusted_puppetmaster_hosts > Rendered api/v2/errors/access_denied.json.rabl within > api/v2/layouts/error_layout (0.5ms) > Filter chain halted as :require_puppetmaster_or_login rendered or > redirected > Completed 403 Forbidden in 9.3ms (Views: 1.4ms | ActiveRecord: 0.4ms) > > Server A environment is > RHEL6.2;ruby2.0.0p451;foreman 1.7,without other app > Server B environment is > RHEL6.2;ruby1.8.7 352;puppet/puppet-server 3.4.2-1 without other > app > Both have iptables/selinux disalbed > > Server B,Puppet configuration > cat /etc/puppet/foreman.yaml > --- > # Update for your Foreman and Puppet master hostname(s) > :url: "http://10.68.189.206:3000" > :ssl_ca: "/var/lib/puppet/ssl/certs/ca.pem" > :ssl_cert: "/var/lib/puppet/ssl/certs/test.puppet.com.pem" > :ssl_key: "/var/lib/puppet/ssl/private_keys/test.puppet.com.pem" > :user: "admin" > :password: "As687656" > > # Advanced settings > :puppetdir: "/var/lib/puppet" > :puppetuser: "puppet" > :facts: true > :timeout: 10 > :threads: null > > Server A ,Foreman configuration > cat database.yml > production: > adapter: mysql2 > database: foreman > username: foreman > password: foreman > host: localhost > socket: /var/lib/mysql/mysql.sock > > cat settings.yaml > --- > # You must restart the Rack server after changing either of these values > # because they are cached at startup. > # > :unattended: true > :login: true > :require_ssl: false > :locations_enabled: false > :organizations_enabled: false > #JSONP or "JSON with padding" is a complement to the base JSON data format. > #It provides a method to request JSON data from a server in a different > domain. > :support_jsonp: false > #:puppetconfdir: /etc/puppet > #:puppetvardir: /var/lib/puppet > > # Mark translated strings with X characters (for developers) > :mark_translated: false > > # Local administrative settings for application domain, fqdn, foreman URL, > # administrator email address etc. If you don't have a Puppet provisioning > # system you may want to change to setup your project on your local > machine. > :domain: 'localdomain.net' > :fqdn: 'localhost.localdomain.net' >

Hi,

As the error said you should add

trusted_puppetmaster_hosts= ["my_host"]

in settings.yaml

··· 2015-01-14 5:27 GMT+01:00 :

anyone can help me?

在 2015年1月13日星期二 UTC+8下午6:45:42,admi…@gmail.com写道:

Hello,everyone
I’m a newbie in foreman.I fall in problem with reports.
I have tow server, A and B.A used as Foreman,B usea as puppet server
and puppet agent.

Foreman has the following error message, puppet working perfect.How can I
resolve it?
Started POST “/api/reports” for 10.68.189.45 at 2015-01-13 13:24:17 +0800
Processing by Api::V2::ReportsController#create as JSON
Parameters: {“report”=>"[FILTERED]", “apiv”=>“v2”}
No smart proxy server found on [] and is not in trusted_puppetmaster_hosts
Rendered api/v2/errors/access_denied.json.rabl within
api/v2/layouts/error_layout (0.5ms)
Filter chain halted as :require_puppetmaster_or_login rendered or
redirected
Completed 403 Forbidden in 9.3ms (Views: 1.4ms | ActiveRecord: 0.4ms)

Server A environment is
RHEL6.2;ruby2.0.0p451;foreman 1.7,without other app
Server B environment is
RHEL6.2;ruby1.8.7 352;puppet/puppet-server 3.4.2-1 without
other app
Both have iptables/selinux disalbed

Server B,Puppet configuration
cat /etc/puppet/foreman.yaml

Update for your Foreman and Puppet master hostname(s)

:url: “http://10.68.189.206:3000
:ssl_ca: “/var/lib/puppet/ssl/certs/ca.pem”
:ssl_cert: “/var/lib/puppet/ssl/certs/test.puppet.com.pem”
:ssl_key: “/var/lib/puppet/ssl/private_keys/test.puppet.com.pem”
:user: “admin”
:password: “As687656”

Advanced settings

:puppetdir: “/var/lib/puppet”
:puppetuser: “puppet”
:facts: true
:timeout: 10
:threads: null

Server A ,Foreman configuration
cat database.yml
production:
adapter: mysql2
database: foreman
username: foreman
password: foreman
host: localhost
socket: /var/lib/mysql/mysql.sock

cat settings.yaml

You must restart the Rack server after changing either of these values

because they are cached at startup.

:unattended: true
:login: true
:require_ssl: false
:locations_enabled: false
:organizations_enabled: false
#JSONP or “JSON with padding” is a complement to the base JSON data
format.
#It provides a method to request JSON data from a server in a different
domain.
:support_jsonp: false
#:puppetconfdir: /etc/puppet
#:puppetvardir: /var/lib/puppet

Mark translated strings with X characters (for developers)

:mark_translated: false

Local administrative settings for application domain, fqdn, foreman URL,

administrator email address etc. If you don’t have a Puppet provisioning

system you may want to change to setup your project on your local

machine.
:domain: ‘localdomain.net
:fqdn: ‘localhost.localdomain.net


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.