Error 400 when importing facts

Hi,

After configuring Foreman to receive all the reports from all our puppet
agents (which works like a charm), I'm trying to configure the facts
importing process.

We have 3 puppet masters with a central database where we store all the
exported resources and we don't want foreman to use the same database.
We are not using ENC either so the only choice we have is to use the
push_facts.rb script:

When running it, the script doesn't show any error, however, the facts
are not imported and I'm getting the following error in foreman.log:

Processing FactValuesController#create to yml (for 192.168.254.226 at
2011-12-30 12:56:30) [POST]
Parameters: {"facts"=>"[FILTERED]", "format"=>"yml",
"action"=>"create", "controller"=>"fact_values"}
Completed in 2ms (View: 0, DB: 0) | 400 Bad Request
[http://xxxxx.xxxx.xxxx.xxx/fact_values/create?format=yml]

Some thing I had to change is the directory where the script is going to
get the yaml files. While the script is going to
${puppetdir}/yaml/facts/ for some reason we don't have this directory
but {puppetdir}/yaml/node/

Are those yaml files the ones the script is supposed to use? Why I don't
have the same directory name?

We're using puppet 2.7.9

Cheers

> Hi,
>
> After configuring Foreman to receive all the reports from all our puppet
> agents (which works like a charm), I'm trying to configure the facts
> importing process.
>
> We have 3 puppet masters with a central database where we store all the
> exported resources and we don't want foreman to use the same database. We
> are not using ENC either so the only choice we have is to use the
> push_facts.rb script:
> https://github.com/ohadlevy/puppet-foreman/blob/
> 1fec77660a1d32337fc053a5789bf6**116ccd7b31/foreman/files/push_**facts.rb<https://github.com/ohadlevy/puppet-foreman/blob/1fec77660a1d32337fc053a5789bf6116ccd7b31/foreman/files/push_facts.rb>
>
> When running it, the script doesn't show any error, however, the facts are
> not imported and I'm getting the following error in foreman.log:
>
> Processing FactValuesController#create to yml (for 192.168.254.226 at
> 2011-12-30 12:56:30) [POST]
> Parameters: {"facts"=>"[FILTERED]", "format"=>"yml", "action"=>"create",
> "controller"=>"fact_values"}
> Completed in 2ms (View: 0, DB: 0) | 400 Bad Request [
> http://xxxxx.xxxx.xxxx.xxx/**fact_values/create?format=yml<http://xxxxx.xxxx.xxxx.xxx/fact_values/create?format=yml>
> ]
>
> Some thing I had to change is the directory where the script is going to
> get the yaml files. While the script is going to ${puppetdir}/yaml/facts/
> for some reason we don't have this directory but {puppetdir}/yaml/node/
>
> Are those yaml files the ones the script is supposed to use? Why I don't
> have the same directory name?
>
> We're using puppet 2.7.9
>

My guess you are using the inventory service, if you dont use it, change
your facts store to yaml, then it would create those files, and you would
be able to import it.

hope this helps,
Ohad

··· 2011/12/30 Carles Amigó

Cheers


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com**.
To unsubscribe from this group, send email to foreman-users+unsubscribe@**
googlegroups.com foreman-users%2Bunsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/**
group/foreman-users?hl=enhttp://groups.google.com/group/foreman-users?hl=en
.

Yes, we're using the inventory service and unfortunately we cannot
disable it because we have other software fetching information from it

Is there any other way to import those facts into foreman?

··· On 12/30/2011 01:39 PM, Ohad Levy wrote: > > > 2011/12/30 Carles Amig� > > > Hi, > > After configuring Foreman to receive all the reports from all our > puppet agents (which works like a charm), I'm trying to configure > the facts importing process. > > We have 3 puppet masters with a central database where we store all > the exported resources and we don't want foreman to use the same > database. We are not using ENC either so the only choice we have is > to use the push_facts.rb script: > https://github.com/ohadlevy/__puppet-foreman/blob/__1fec77660a1d32337fc053a5789bf6__116ccd7b31/foreman/files/push___facts.rb > > > When running it, the script doesn't show any error, however, the > facts are not imported and I'm getting the following error in > foreman.log: > > Processing FactValuesController#create to yml (for 192.168.254.226 > at 2011-12-30 12:56:30) [POST] > Parameters: {"facts"=>"[FILTERED]", "format"=>"yml", > "action"=>"create", "controller"=>"fact_values"} > Completed in 2ms (View: 0, DB: 0) | 400 Bad Request > [http://xxxxx.xxxx.xxxx.xxx/__fact_values/create?format=yml > ] > > Some thing I had to change is the directory where the script is > going to get the yaml files. While the script is going to > ${puppetdir}/yaml/facts/ for some reason we don't have this > directory but {puppetdir}/yaml/node/ > > Are those yaml files the ones the script is supposed to use? Why I > don't have the same directory name? > > We're using puppet 2.7.9 > > > My guess you are using the inventory service, if you dont use it, change > your facts store to yaml, then it would create those files, and you > would be able to import it. > > hope this helps, > Ohad > > > Cheers > > -- > You received this message because you are subscribed to the Google > Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com > __. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@__googlegroups.com > . > For more options, visit this group at > http://groups.google.com/__group/foreman-users?hl=en > . > > > -- > You received this message because you are subscribed to the Google > Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en.

> Yes, we're using the inventory service and unfortunately we cannot disable
> it because we have other software fetching information from it
>
> Is there any other way to import those facts into foreman?
>

I'm sure that there is a way, and probably its not too hard, if you can
provide some sample output that you can get from the inventory service, we
could probably import that back into foreman.

(ideally in a feature request )

Thanks,
Ohad

··· 2011/12/30 Carles Amigó

On 12/30/2011 01:39 PM, Ohad Levy wrote:

2011/12/30 Carles Amigó <carles.amigo@softonic.com
<mailto:carles.amigo@softonic.**com carles.amigo@softonic.com>>

Hi,

After configuring Foreman to receive all the reports from all our
puppet agents (which works like a charm), I’m trying to configure
the facts importing process.

We have 3 puppet masters with a central database where we store all
the exported resources and we don’t want foreman to use the same
database. We are not using ENC either so the only choice we have is
to use the push_facts.rb script:
https://github.com/ohadlevy/**puppet-foreman/blob/**
1fec77660a1d32337fc053a5789bf6**__116ccd7b31/foreman/files/**
push___facts.rbhttps://github.com/ohadlevy/__puppet-foreman/blob/__1fec77660a1d32337fc053a5789bf6__116ccd7b31/foreman/files/push___facts.rb

<https://github.com/ohadlevy/puppet-foreman/blob/
1fec77660a1d32337fc053a5789bf6**116ccd7b31/foreman/files/push_**facts.rbhttps://github.com/ohadlevy/puppet-foreman/blob/1fec77660a1d32337fc053a5789bf6116ccd7b31/foreman/files/push_facts.rb

When running it, the script doesn’t show any error, however, the
facts are not imported and I’m getting the following error in
foreman.log:

Processing FactValuesController#create to yml (for 192.168.254.226
at 2011-12-30 12:56:30) [POST]
Parameters: {“facts”=>"[FILTERED]", “format”=>“yml”,
“action”=>“create”, “controller”=>“fact_values”}
Completed in 2ms (View: 0, DB: 0) | 400 Bad Request
[http://xxxxx.xxxx.xxxx.xxx/__**fact_values/create?format=ymlhttp://xxxxx.xxxx.xxxx.xxx/__fact_values/create?format=yml

<http://xxxxx.xxxx.xxxx.xxx/**fact_values/create?format=ymlhttp://xxxxx.xxxx.xxxx.xxx/fact_values/create?format=yml

**]

Some thing I had to change is the directory where the script is
going to get the yaml files. While the script is going to
${puppetdir}/yaml/facts/ for some reason we don’t have this
directory but {puppetdir}/yaml/node/

Are those yaml files the ones the script is supposed to use? Why I
don’t have the same directory name?

We’re using puppet 2.7.9

My guess you are using the inventory service, if you dont use it, change
your facts store to yaml, then it would create those files, and you
would be able to import it.

hope this helps,
Ohad

Cheers


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com
<mailto:foreman-users@**googlegroups.comforeman-users@googlegroups.com

__.

To unsubscribe from this group, send email to
foreman-users+unsubscribe@__go**oglegroups.comhttp://googlegroups.com
<mailto:foreman-users%**2Bunsubscribe@googlegroups.comforeman-users%2Bunsubscribe@googlegroups.com
**>.

For more options, visit this group at
http://groups.google.com/__**group/foreman-users?hl=enhttp://groups.google.com/__group/foreman-users?hl=en
<http://groups.google.com/**group/foreman-users?hl=enhttp://groups.google.com/group/foreman-users?hl=en

.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com**.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@**googlegroups.comforeman-users%2Bunsubscribe@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/**group/foreman-users?hl=enhttp://groups.google.com/group/foreman-users?hl=en
.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com**.
To unsubscribe from this group, send email to foreman-users+unsubscribe@**
googlegroups.com foreman-users%2Bunsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/**
group/foreman-users?hl=enhttp://groups.google.com/group/foreman-users?hl=en
.