Puppet facts not in 'inventory data'

I had setup foreman to use puppet facts during my first attempt and
everything was great. Now I'm going through the process again to
package/document and am running into issues. Before I would have
'inventory data' from hosts when clicking on statistics, or when
viewing hosts it would show their OS and whatnot. Now its not.
However, I view the facts of a node from foreman and they exist.

I've read Puppet Facts - Foreman and
am following it. I'm at a foreman version that has CHANGELOG entries
through 2011-03-29. I have it using the same database as puppet
storedconfigs. But where it says "Note: starting from version 0.2,
this is no longer required.
Foreman will automatically refresh the host facts once a puppet report
comes in if you setup Foreman to use the same database as storeconfigs
in the database.yml file." it does not seem to be doing this. If I
run the command below in the wiki "rake puppet:migrate:populate_hosts
RAILS_ENV=production" I get what I expect.

I don't remember having to do that before, but I could just have
forgotten. Is there a way to check what version of foreman I am
running to make sure this isn't a bug/feature that has already been
addressed? Or is there a delay between when I host first uploads a
report and its 'automatically' used by foreman?

Thanks,
Jake

Well, it depends on what version your running since I created a feature request to send back the version.

http://foreman/status?format=json

should return :
{"status":200,"version":"0.2.1","result":"ok","db_duration_ms":"1"}
If you have the patch that shows the version.

Corey

··· On May 19, 2011, at 12:37 PM, Jake - USPS wrote:

I had setup foreman to use puppet facts during my first attempt and
everything was great. Now I’m going through the process again to
package/document and am running into issues. Before I would have
’inventory data’ from hosts when clicking on statistics, or when
viewing hosts it would show their OS and whatnot. Now its not.
However, I view the facts of a node from foreman and they exist.

I’ve read Puppet Facts - Foreman and
am following it. I’m at a foreman version that has CHANGELOG entries
through 2011-03-29. I have it using the same database as puppet
storedconfigs. But where it says “Note: starting from version 0.2,
this is no longer required.
Foreman will automatically refresh the host facts once a puppet report
comes in if you setup Foreman to use the same database as storeconfigs
in the database.yml file.” it does not seem to be doing this. If I
run the command below in the wiki “rake puppet:migrate:populate_hosts
RAILS_ENV=production” I get what I expect.

I don’t remember having to do that before, but I could just have
forgotten. Is there a way to check what version of foreman I am
running to make sure this isn’t a bug/feature that has already been
addressed? Or is there a delay between when I host first uploads a
report and its ‘automatically’ used by foreman?

Thanks,
Jake


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.

Are you running foreman and puppet on the same host?

if you dont, foreman has straight forward way to auto detect that you
are actively using storeconfigs, therefore you would need to add an option
to your foreman settings file…

and while looking at that code, i've noticed a missing feature :slight_smile:

if you can, please edit config/initializers/foreman.rb and simply find the
line with
SETTINGS[:using_storeconfigs] = …
and change it to:
SETTINGS[:using_storeconfigs] = true

if it works, please open a new feature request to allow defining if are
using store configs or not…

thanks!
Ohad

··· On Thu, May 19, 2011 at 10:37 PM, Jake - USPS wrote:

I had setup foreman to use puppet facts during my first attempt and
everything was great. Now I’m going through the process again to
package/document and am running into issues. Before I would have
’inventory data’ from hosts when clicking on statistics, or when
viewing hosts it would show their OS and whatnot. Now its not.
However, I view the facts of a node from foreman and they exist.

I’ve read Puppet Facts - Foreman and
am following it. I’m at a foreman version that has CHANGELOG entries
through 2011-03-29. I have it using the same database as puppet
storedconfigs. But where it says “Note: starting from version 0.2,
this is no longer required.
Foreman will automatically refresh the host facts once a puppet report
comes in if you setup Foreman to use the same database as storeconfigs
in the database.yml file.” it does not seem to be doing this. If I
run the command below in the wiki “rake puppet:migrate:populate_hosts
RAILS_ENV=production” I get what I expect.

I don’t remember having to do that before, but I could just have
forgotten. Is there a way to check what version of foreman I am
running to make sure this isn’t a bug/feature that has already been
addressed? Or is there a delay between when I host first uploads a
report and its ‘automatically’ used by foreman?

>
>
>
>> I had setup foreman to use puppet facts during my first attempt and
>> everything was great. Now I'm going through the process again to
>> package/document and am running into issues. Before I would have
>> 'inventory data' from hosts when clicking on statistics, or when
>> viewing hosts it would show their OS and whatnot. Now its not.
>> However, I view the facts of a node from foreman and they exist.
>>
>> I've read Puppet Facts - Foreman and
>> am following it. I'm at a foreman version that has CHANGELOG entries
>> through 2011-03-29. I have it using the same database as puppet
>> storedconfigs. But where it says "Note: starting from version 0.2,
>> this is no longer required.
>> Foreman will automatically refresh the host facts once a puppet report
>> comes in if you setup Foreman to use the same database as storeconfigs
>> in the database.yml file." it does not seem to be doing this. If I
>> run the command below in the wiki "rake puppet:migrate:populate_hosts
>> RAILS_ENV=production" I get what I expect.
>>
>> I don't remember having to do that before, but I could just have
>> forgotten. Is there a way to check what version of foreman I am
>> running to make sure this isn't a bug/feature that has already been
>> addressed? Or is there a delay between when I host first uploads a
>> report and its 'automatically' used by foreman?
>>
>>
> Are you running foreman and puppet on the same host?
>
> if you dont, foreman has straight forward way to auto detect that you
> are actively using storeconfigs, therefore you would need to add an option
> to your foreman settings file…
>
I meant has no straight forward way…

>
> and while looking at that code, i've noticed a missing feature :slight_smile:
>
> if you can, please edit config/initializers/foreman.rb and simply find the
> line with
> SETTINGS[:using_storeconfigs] = …
> and change it to:
> SETTINGS[:using_storeconfigs] = true
>
> if it works, please open a new feature request to allow defining if are
> using store configs or not…
>
when using a remote foreman server…

··· On Thu, May 19, 2011 at 10:46 PM, Ohad Levy wrote: > On Thu, May 19, 2011 at 10:37 PM, Jake - USPS wrote:

thanks!
Ohad

You guys are great! I have puppetmaster on the system, but I didn't
have the storedconfig entry in /etc/puppet/puppet.conf yet. You are
right that I have other puppetmasters that report remotely to this
server and they were configured correctly. After adding the entries
in /etc/puppet/puppet.conf, restarting apache and having an agent run/
report it showed up correctly. I must of had the entries needed the
first time I did it.

As for the version, I'm still curious what I'm running. Using the
status page didn't tell me though …

{"status":200,"db_duration_ms":"1","result":"ok"}

So if there is another way to check let me know. But not a huge deal
since this is working again now.

Thanks guys!
Jake

··· On May 19, 2:57 pm, Ohad Levy wrote: > On Thu, May 19, 2011 at 10:46 PM, Ohad Levy wrote: > > > On Thu, May 19, 2011 at 10:37 PM, Jake - USPS wrote: > > >> I had setup foreman to use puppet facts during my first attempt and > >> everything was great. Now I'm going through the process again to > >> package/document and am running into issues. Before I would have > >> 'inventory data' from hosts when clicking on statistics, or when > >> viewing hosts it would show their OS and whatnot. Now its not. > >> However, I view the facts of a node from foreman and they exist. > > >> I've readhttp://theforeman.org/projects/foreman/wiki/Puppet_Factsand > >> am following it. I'm at a foreman version that has CHANGELOG entries > >> through 2011-03-29. I have it using the same database as puppet > >> storedconfigs. But where it says "Note: starting from version 0.2, > >> this is no longer required. > >> Foreman will automatically refresh the host facts once a puppet report > >> comes in if you setup Foreman to use the same database as storeconfigs > >> in the database.yml file." it does not seem to be doing this. If I > >> run the command below in the wiki "rake puppet:migrate:populate_hosts > >> RAILS_ENV=production" I get what I expect. > > >> I don't remember having to do that before, but I could just have > >> forgotten. Is there a way to check what version of foreman I am > >> running to make sure this isn't a bug/feature that has already been > >> addressed? Or is there a delay between when I host first uploads a > >> report and its 'automatically' used by foreman? > > > Are you running foreman and puppet on the same host? > > > if you dont, foreman has straight forward way to auto detect that you > > are actively using storeconfigs, therefore you would need to add an option > > to your foreman settings file.. > > I meant has no straight forward way.. > > > > > and while looking at that code, i've noticed a missing feature :-) > > > if you can, please edit config/initializers/foreman.rb and simply find the > > line with > > SETTINGS[:using_storeconfigs] = .. > > and change it to: > > SETTINGS[:using_storeconfigs] = true > > > if it works, please open a new feature request to allow defining if are > > using store configs or not... > > when using a remote foreman server.. > > > > > > > > > > > thanks! > > Ohad

OK, so this is now working and not working for me.

I have 2 nodes that reported and show all the information. I then did
a 3rd node and its hostname shows up as the fqdn (others were just
their hostname) and it does not show its OS / ENV / Model in the hosts
page. All the facts exist though.

So the first 2 nodes were:
Foremanserver (node a)
Puppetmaster (node b)

The third node was a regular agent (node c).

All 3 systems uses node b as the puppetmaster. And the puppetmaster
node b reports to foreman and sends the storedconfigs to foreman
server.

Any ideas what I can check to troubleshoot why the third node process
is behaving differently?

Also, I'm using thin_storeconfigs … just want to verify that is OK.

Thanks,
Jake

··· On May 19, 3:08 pm, Jake - USPS wrote: > You guys are great! I have puppetmaster on the system, but I didn't > have the storedconfig entry in /etc/puppet/puppet.conf yet. You are > right that I have other puppetmasters that report remotely to this > server and they were configured correctly. After adding the entries > in /etc/puppet/puppet.conf, restarting apache and having an agent run/ > report it showed up correctly. I must of had the entries needed the > first time I did it. > > As for the version, I'm still curious what I'm running. Using the > status page didn't tell me though ... > > {"status":200,"db_duration_ms":"1","result":"ok"} > > So if there is another way to check let me know. But not a huge deal > since this is working again now. > > Thanks guys! > Jake > > On May 19, 2:57 pm, Ohad Levy wrote: > > > > > > > > > On Thu, May 19, 2011 at 10:46 PM, Ohad Levy wrote: > > > > On Thu, May 19, 2011 at 10:37 PM, Jake - USPS wrote: > > > >> I had setup foreman to use puppet facts during my first attempt and > > >> everything was great. Now I'm going through the process again to > > >> package/document and am running into issues. Before I would have > > >> 'inventory data' from hosts when clicking on statistics, or when > > >> viewing hosts it would show their OS and whatnot. Now its not. > > >> However, I view the facts of a node from foreman and they exist. > > > >> I've readhttp://theforeman.org/projects/foreman/wiki/Puppet_Factsand > > >> am following it. I'm at a foreman version that has CHANGELOG entries > > >> through 2011-03-29. I have it using the same database as puppet > > >> storedconfigs. But where it says "Note: starting from version 0.2, > > >> this is no longer required. > > >> Foreman will automatically refresh the host facts once a puppet report > > >> comes in if you setup Foreman to use the same database as storeconfigs > > >> in the database.yml file." it does not seem to be doing this. If I > > >> run the command below in the wiki "rake puppet:migrate:populate_hosts > > >> RAILS_ENV=production" I get what I expect. > > > >> I don't remember having to do that before, but I could just have > > >> forgotten. Is there a way to check what version of foreman I am > > >> running to make sure this isn't a bug/feature that has already been > > >> addressed? Or is there a delay between when I host first uploads a > > >> report and its 'automatically' used by foreman? > > > > Are you running foreman and puppet on the same host? > > > > if you dont, foreman has straight forward way to auto detect that you > > > are actively using storeconfigs, therefore you would need to add an option > > > to your foreman settings file.. > > > I meant has no straight forward way.. > > > > and while looking at that code, i've noticed a missing feature :-) > > > > if you can, please edit config/initializers/foreman.rb and simply find the > > > line with > > > SETTINGS[:using_storeconfigs] = .. > > > and change it to: > > > SETTINGS[:using_storeconfigs] = true > > > > if it works, please open a new feature request to allow defining if are > > > using store configs or not... > > > when using a remote foreman server.. > > > > thanks! > > > Ohad

I did what was suggested earlier if not setting storeconfig in /etc/
puppet/puppet.conf (even though I am and it worked fine 2 times
earlier):

if you can, please edit config/initializers/foreman.rb and simply find
the
line with
SETTINGS[:using_storeconfigs] = …
and change it to:
SETTINGS[:using_storeconfigs] = true

so I changed:

SETTINGS[:using_storeconfigs] = !
Puppet.settings.instance_variable_get(:@values)[:master]
[:dbadapter].empty?

to

SETTINGS[:using_storeconfigs] = !

Puppet.settings.instance_variable_get(:@values)[:master]
[:dbadapter].empty?
SETTINGS[:using_storeconfigs] = true

I then had the system that was 'having issues' run and it now shows as
expected in foreman.

Looking at the code, it seems to check under [master] for dbadapter to
be set … it is:

cat /etc/puppet/puppet.conf
[main]
pluginsync = true
vardir = /var/lib/puppet
manifest = /etc/puppet/site.pp
modulepath = /etc/puppet/modules

[master]
reports = store, foreman
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
logdir = /var/lib/puppet/log
certname = <fqdn>
ca = false
ca_ttl = 100y
external_nodes = /etc/puppet/external_node.rb
node_terminus = exec
storeconfigs = true
dbadapter = mysql
dbuser = <user>
dbpassword = <pass>
dbserver = localhost
dbport = 9444
dbsocket = /var/lib/mysql/mysql.sock

[agent]

To be changed to a VIP

Actaully, leave this! ca_server will host main modules in

fileserver for deployment to masters!
server = <server_fqdn>
masterport = 9443
environment = development
report = true

[development]
manifest = /etc/puppet/development/site.pp
modulepath = /etc/puppet/development/modules

Not sure if this is 'case closed' or if you would like to to check on
some things or try something to troubleshoot this. This is just
testing still (for now), so let me know.

Thanks,
Jake

··· On May 19, 4:11 pm, Jake - USPS wrote: > OK, so this is now working and not working for me. > > I have 2 nodes that reported and show all the information. I then did > a 3rd node and its hostname shows up as the fqdn (others were just > their hostname) and it does not show its OS / ENV / Model in the hosts > page. All the facts exist though. > > So the first 2 nodes were: > Foremanserver (node a) > Puppetmaster (node b) > > The third node was a regular agent (node c). > > All 3 systems uses node b as the puppetmaster. And the puppetmaster > node b reports to foreman and sends the storedconfigs to foreman > server. > > Any ideas what I can check to troubleshoot why the third node process > is behaving differently? > > Also, I'm using thin_storeconfigs ... just want to verify that is OK. > > Thanks, > Jake > > On May 19, 3:08 pm, Jake - USPS wrote: > > > > > > > > > You guys are great! I have puppetmaster on the system, but I didn't > > have the storedconfig entry in /etc/puppet/puppet.conf yet. You are > > right that I have other puppetmasters that report remotely to this > > server and they were configured correctly. After adding the entries > > in /etc/puppet/puppet.conf, restarting apache and having an agent run/ > > report it showed up correctly. I must of had the entries needed the > > first time I did it. > > > As for the version, I'm still curious what I'm running. Using the > > status page didn't tell me though ... > > > {"status":200,"db_duration_ms":"1","result":"ok"} > > > So if there is another way to check let me know. But not a huge deal > > since this is working again now. > > > Thanks guys! > > Jake > > > On May 19, 2:57 pm, Ohad Levy wrote: > > > > On Thu, May 19, 2011 at 10:46 PM, Ohad Levy wrote: > > > > > On Thu, May 19, 2011 at 10:37 PM, Jake - USPS wrote: > > > > >> I had setup foreman to use puppet facts during my first attempt and > > > >> everything was great. Now I'm going through the process again to > > > >> package/document and am running into issues. Before I would have > > > >> 'inventory data' from hosts when clicking on statistics, or when > > > >> viewing hosts it would show their OS and whatnot. Now its not. > > > >> However, I view the facts of a node from foreman and they exist. > > > > >> I've readhttp://theforeman.org/projects/foreman/wiki/Puppet_Factsand > > > >> am following it. I'm at a foreman version that has CHANGELOG entries > > > >> through 2011-03-29. I have it using the same database as puppet > > > >> storedconfigs. But where it says "Note: starting from version 0.2, > > > >> this is no longer required. > > > >> Foreman will automatically refresh the host facts once a puppet report > > > >> comes in if you setup Foreman to use the same database as storeconfigs > > > >> in the database.yml file." it does not seem to be doing this. If I > > > >> run the command below in the wiki "rake puppet:migrate:populate_hosts > > > >> RAILS_ENV=production" I get what I expect. > > > > >> I don't remember having to do that before, but I could just have > > > >> forgotten. Is there a way to check what version of foreman I am > > > >> running to make sure this isn't a bug/feature that has already been > > > >> addressed? Or is there a delay between when I host first uploads a > > > >> report and its 'automatically' used by foreman? > > > > > Are you running foreman and puppet on the same host? > > > > > if you dont, foreman has straight forward way to auto detect that you > > > > are actively using storeconfigs, therefore you would need to add an option > > > > to your foreman settings file.. > > > > I meant has no straight forward way.. > > > > > and while looking at that code, i've noticed a missing feature :-) > > > > > if you can, please edit config/initializers/foreman.rb and simply find the > > > > line with > > > > SETTINGS[:using_storeconfigs] = .. > > > > and change it to: > > > > SETTINGS[:using_storeconfigs] = true > > > > > if it works, please open a new feature request to allow defining if are > > > > using store configs or not... > > > > when using a remote foreman server.. > > > > > thanks! > > > > Ohad