Newbie Foreman trying to create manifest actions from foreman

Setup foreman, seems to be working but I'm still figuring some things
out.

I created several 'Host Groups', spun up a new VM image and connected
it to puppet where it loaded all of the 'default classes' just fine.

Using Foreman, I 'Edit' the new 'host' and assign this host to Web -
Nginx group whereupon it should at least install nginx (and all the
prerequisites) but when I run the puppet agent on this system, it acts
as if no changes were made (which of course don't exist in nodes.pp
but only in the foreman host).

What am I doing wrong?

> Setup foreman, seems to be working but I'm still figuring some things
> out.
>
> I created several 'Host Groups', spun up a new VM image and connected
> it to puppet where it loaded all of the 'default classes' just fine.
>
> Using Foreman, I 'Edit' the new 'host' and assign this host to Web -
> Nginx group whereupon it should at least install nginx (and all the
> prerequisites) but when I run the puppet agent on this system, it acts
> as if no changes were made (which of course don't exist in nodes.pp
> but only in the foreman host).
>
> What am I doing wrong?
>
Are you using foreman as your external node classifier? does the yaml
output seems correct (show host/click on yaml)
if it does, double check your external nodes setup on the puppet side.

Ohad

··· On Thu, Jul 14, 2011 at 12:41 AM, Craig White wrote:


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.

>
>
> Setup foreman, seems to be working but I'm still figuring some things
> out.
>
> I created several 'Host Groups', spun up a new VM image and connected
> it to puppet where it loaded all of the 'default classes' just fine.
>
> Using Foreman, I 'Edit' the new 'host' and assign this host to Web -
> Nginx group whereupon it should at least install nginx (and all the
> prerequisites) but when I run the puppet agent on this system, it acts
> as if no changes were made (which of course don't exist in nodes.pp
> but only in the foreman host).
>
> What am I doing wrong?
> Are you using foreman as your external node classifier? does the yaml output seems correct (show host/click on yaml)
> if it does, double check your external nodes setup on the puppet side.

··· On Jul 14, 2011, at 1:51 AM, Ohad Levy wrote: > On Thu, Jul 14, 2011 at 12:41 AM, Craig White wrote: ---- OK - I didn't realize that this was required (ENC)

I had it set up about 2 weeks ago using LDAP but it didn’t seem to offer enough value to maintain it.

The thing I guess I will have to figure out (and I suppose this is a puppet issue and not a foreman issue) is how to set it up so that foreman’s GUI has write access to LDAP to create the ‘puppetClass’ attributes.

I’ll keep plugging away

Thanks

Craig

>
>
> >
> >
> > Setup foreman, seems to be working but I'm still figuring some things
> > out.
> >
> > I created several 'Host Groups', spun up a new VM image and connected
> > it to puppet where it loaded all of the 'default classes' just fine.
> >
> > Using Foreman, I 'Edit' the new 'host' and assign this host to Web -
> > Nginx group whereupon it should at least install nginx (and all the
> > prerequisites) but when I run the puppet agent on this system, it acts
> > as if no changes were made (which of course don't exist in nodes.pp
> > but only in the foreman host).
> >
> > What am I doing wrong?
> > Are you using foreman as your external node classifier? does the yaml
> output seems correct (show host/click on yaml)
> > if it does, double check your external nodes setup on the puppet side.
> ----
> OK - I didn't realize that this was required (ENC)
>
> I had it set up about 2 weeks ago using LDAP but it didn't seem to offer
> enough value to maintain it.

> The thing I guess I will have to figure out (and I suppose this is a puppet
> issue and not a foreman issue) is how to set it up so that foreman's GUI has
> write access to LDAP to create the 'puppetClass' attributes.
>

Note sure that I follow of why you want to use ldap in this case, but you
could always have a script to import the yaml data (which includes the
classes) and create them in your ldap… or you could simply let puppet
query foreman directly.

Ohad

··· On Thu, Jul 14, 2011 at 6:15 PM, Craig White wrote: > On Jul 14, 2011, at 1:51 AM, Ohad Levy wrote: > > On Thu, Jul 14, 2011 at 12:41 AM, Craig White > wrote:

I’ll keep plugging away

Thanks

Craig


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.

>
>
>
>
> >
> >
> > Setup foreman, seems to be working but I'm still figuring some things
> > out.
> >
> > I created several 'Host Groups', spun up a new VM image and connected
> > it to puppet where it loaded all of the 'default classes' just fine.
> >
> > Using Foreman, I 'Edit' the new 'host' and assign this host to Web -
> > Nginx group whereupon it should at least install nginx (and all the
> > prerequisites) but when I run the puppet agent on this system, it acts
> > as if no changes were made (which of course don't exist in nodes.pp
> > but only in the foreman host).
> >
> > What am I doing wrong?
> > Are you using foreman as your external node classifier? does the yaml output seems correct (show host/click on yaml)
> > if it does, double check your external nodes setup on the puppet side.
> ----
> OK - I didn't realize that this was required (ENC)
>
> I had it set up about 2 weeks ago using LDAP but it didn't seem to offer enough value to maintain it.
>
> The thing I guess I will have to figure out (and I suppose this is a puppet issue and not a foreman issue) is how to set it up so that foreman's GUI has write access to LDAP to create the 'puppetClass' attributes.
>
> Note sure that I follow of why you want to use ldap in this case, but you could always have a script to import the yaml data (which includes the classes) and create them in your ldap… or you could simply let puppet query foreman directly.

··· On Jul 14, 2011, at 9:48 AM, Ohad Levy wrote: > On Thu, Jul 14, 2011 at 6:15 PM, Craig White wrote: > On Jul 14, 2011, at 1:51 AM, Ohad Levy wrote: > > On Thu, Jul 14, 2011 at 12:41 AM, Craig White wrote: ---- the configuration shows in YAML using foreman but of course puppet doesn't know anything about it.

How do I ‘simply let puppet query foreman directly?’

Craig

>
>
> >
> >
> >
> >
> > >
> > >
> > > Setup foreman, seems to be working but I'm still figuring some things
> > > out.
> > >
> > > I created several 'Host Groups', spun up a new VM image and connected
> > > it to puppet where it loaded all of the 'default classes' just fine.
> > >
> > > Using Foreman, I 'Edit' the new 'host' and assign this host to Web -
> > > Nginx group whereupon it should at least install nginx (and all the
> > > prerequisites) but when I run the puppet agent on this system, it acts
> > > as if no changes were made (which of course don't exist in nodes.pp
> > > but only in the foreman host).
> > >
> > > What am I doing wrong?
> > > Are you using foreman as your external node classifier? does the yaml
> output seems correct (show host/click on yaml)
> > > if it does, double check your external nodes setup on the puppet side.
> > ----
> > OK - I didn't realize that this was required (ENC)
> >
> > I had it set up about 2 weeks ago using LDAP but it didn't seem to offer
> enough value to maintain it.
> >
> > The thing I guess I will have to figure out (and I suppose this is a
> puppet issue and not a foreman issue) is how to set it up so that foreman's
> GUI has write access to LDAP to create the 'puppetClass' attributes.
> >
> > Note sure that I follow of why you want to use ldap in this case, but you
> could always have a script to import the yaml data (which includes the
> classes) and create them in your ldap… or you could simply let puppet
> query foreman directly.
> ----
> the configuration shows in YAML using foreman but of course puppet doesn't
> know anything about it.
>
> How do I 'simply let puppet query foreman directly?'
>

Ohad

··· On Thu, Jul 14, 2011 at 8:07 PM, Craig White wrote: > On Jul 14, 2011, at 9:48 AM, Ohad Levy wrote: > > On Thu, Jul 14, 2011 at 6:15 PM, Craig White > wrote: > > On Jul 14, 2011, at 1:51 AM, Ohad Levy wrote: > > > On Thu, Jul 14, 2011 at 12:41 AM, Craig White > wrote:

Craig


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.

>
>
>
> > Note sure that I follow of why you want to use ldap in this case, but you could always have a script to import the yaml data (which includes the classes) and create them in your ldap… or you could simply let puppet query foreman directly.
> ----
> the configuration shows in YAML using foreman but of course puppet doesn't know anything about it.
>
> How do I 'simply let puppet query foreman directly?'
>
> External Nodes - Foreman

··· On Jul 15, 2011, at 6:19 AM, Ohad Levy wrote: > On Thu, Jul 14, 2011 at 8:07 PM, Craig White wrote: ---- I probably should have been more specific because I had already seen that page and have tried setting up puppet.conf to use 'foreman-node.rb' as the 'exec' for ENC but the directory /var/lib/puppet/yaml/foreman is empty and it appears that foreman keeps the data in MySQL but doesn't export the data to this directory for puppet to use.

perhaps I am dense but I don’t understand how puppet can derive ENC info from an empty directory

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node ubuntu5.ttinet: Failed to find ubuntu5.ttinet via exec: Execution of ‘/etc/puppet/node.rb ubuntu5.ttinet’ returned 1: Unable to read from Cache file: No such file or directory - /var/lib/puppet/yaml/foreman/ubuntu5.ttinet.yaml

but now it seems the error has morphed…

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node ubuntu5.ttinet: Failed to find ubuntu5.ttinet via exec: Execution of ‘/etc/puppet/node.rb ubuntu5.ttinet’ returned 1: Error retrieving node ubuntu5.ttinet: Net::HTTPNotFound

Craig

>
>
> >
> >
> >
> > > Note sure that I follow of why you want to use ldap in this case, but
> you could always have a script to import the yaml data (which includes the
> classes) and create them in your ldap… or you could simply let puppet
> query foreman directly.
> > ----
> > the configuration shows in YAML using foreman but of course puppet
> doesn't know anything about it.
> >
> > How do I 'simply let puppet query foreman directly?'
> >
> >
> External Nodes - Foreman
> ----
> I probably should have been more specific because I had already seen that
> page and have tried setting up puppet.conf to use 'foreman-node.rb' as the
> 'exec' for ENC but the directory /var/lib/puppet/yaml/foreman is empty and
> it appears that foreman keeps the data in MySQL but doesn't export the data
> to this directory for puppet to use.
>

Let me try explaining the way it works:

  1. puppet client called fqdn starts its puppet run
  2. puppetmaster is configured using enc to query foreman (assuming you put
    the right foreman address), execute the external nodes script:
    ./node fqdn
  3. foreman is searching for a host called fqdn (note its the full fqdn).
  4. if the host exists, the puppet now knows which classes to apply etc
  5. the node script stores a cache in /var/lib/puppet/yaml/foreman in case
    foreman is unreachable

>
> perhaps I am dense but I don't understand how puppet can derive ENC info
> from an empty directory
>
> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Failed when searching for node ubuntu5.ttinet: Failed to find ubuntu5.ttinet
> via exec: Execution of '/etc/puppet/node.rb ubuntu5.ttinet' returned 1:
> Unable to read from Cache file: No such file or directory -
> /var/lib/puppet/yaml/foreman/ubuntu5.ttinet.yaml
>

probably the script was not configured to ask the right foreman server (your
foreman url might have been wrong).
it then tried to look for a cache file, but couldnt find it either…

>
> but now it seems the error has morphed…
>
> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Failed when searching for node ubuntu5.ttinet: Failed to find ubuntu5.ttinet
> via exec: Execution of '/etc/puppet/node.rb ubuntu5.ttinet' returned 1:
> Error retrieving node ubuntu5.ttinet: Net::HTTPNotFound
>

that means that you dont have a host named ubuntu5.ttinet in foreman…

hope this helps,
Ohad

··· On Fri, Jul 15, 2011 at 7:46 PM, Craig White wrote: > On Jul 15, 2011, at 6:19 AM, Ohad Levy wrote: > > On Thu, Jul 14, 2011 at 8:07 PM, Craig White > wrote:

Craig


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.

>
>
>
>
> >
> >
> >
> > > Note sure that I follow of why you want to use ldap in this case, but you could always have a script to import the yaml data (which includes the classes) and create them in your ldap… or you could simply let puppet query foreman directly.
> > ----
> > the configuration shows in YAML using foreman but of course puppet doesn't know anything about it.
> >
> > How do I 'simply let puppet query foreman directly?'
> >
> > External Nodes - Foreman
> ----
> I probably should have been more specific because I had already seen that page and have tried setting up puppet.conf to use 'foreman-node.rb' as the 'exec' for ENC but the directory /var/lib/puppet/yaml/foreman is empty and it appears that foreman keeps the data in MySQL but doesn't export the data to this directory for puppet to use.
>
> Let me try explaining the way it works:
>
> 1. puppet client called fqdn starts its puppet run
> 2. puppetmaster is configured using enc to query foreman (assuming you put the right foreman address), execute the external nodes script:
> ./node fqdn
> 3. foreman is searching for a host called fqdn (note its the full fqdn).
> 4. if the host exists, the puppet now knows which classes to apply etc
> 5. the node script stores a cache in /var/lib/puppet/yaml/foreman in case foreman is unreachable
>
>
> perhaps I am dense but I don't understand how puppet can derive ENC info from an empty directory
>
> err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node ubuntu5.ttinet: Failed to find ubuntu5.ttinet via exec: Execution of '/etc/puppet/node.rb ubuntu5.ttinet' returned 1: Unable to read from Cache file: No such file or directory - /var/lib/puppet/yaml/foreman/ubuntu5.ttinet.yaml
>
> probably the script was not configured to ask the right foreman server (your foreman url might have been wrong).
> it then tried to look for a cache file, but couldnt find it either…
>
> but now it seems the error has morphed…
>
> err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node ubuntu5.ttinet: Failed to find ubuntu5.ttinet via exec: Execution of '/etc/puppet/node.rb ubuntu5.ttinet' returned 1: Error retrieving node ubuntu5.ttinet: Net::HTTPNotFound
>
> that means that you dont have a host named ubuntu5.ttinet in foreman…
>
> hope this helps,
> Ohad

··· On Jul 15, 2011, at 11:55 AM, Ohad Levy wrote: > On Fri, Jul 15, 2011 at 7:46 PM, Craig White wrote: > On Jul 15, 2011, at 6:19 AM, Ohad Levy wrote: > > On Thu, Jul 14, 2011 at 8:07 PM, Craig White wrote: ---- it seemed to fix itself a little while ago - I had been restarting apache (I'm using passenger) but I think my problem was that I had done so much editing in puppetdir as root that too much was owned by root:root and so I did a chown on the entire subdirectory and it seemed to fix things (including foreman's external-node.rb).

I think I had the URL right all along and now the /var/lib/puppet/yaml/foreman/ directory is populated too so I am good

I do have another question though but I will start a new thread - thanks

Craig