CraftyTech
2010-Sep-21 14:04 UTC
[Puppet Users] Exported resource Host[fqdn] cannot override local resource
Hello All, So, I realize this is a common issue, but still can''t identify the problem here. Even after reading similar posts... Essentially, I''m exporting / collecting hosts via stored configs.. Here''s my export class: class basic::export{ @@host { $fqdn: ip => $ipaddress, host_aliases => $hostname, tag => "${func_group}"} } } Here''s how I''m collecting them: Host<<| tag == "${func_group}" |>> **func_group is defined in the external node classifier (Foreman: I''m not sure it makes a difference). func_group= "test" Why am I getting exported resource conflict? fqdn is unique to each host, so there are no duplicates... What do you guys think? Cheers, Henry -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Patrick
2010-Sep-21 14:58 UTC
Re: [Puppet Users] Exported resource Host[fqdn] cannot override local resource
On Sep 21, 2010, at 7:04 AM, CraftyTech wrote:> Hello All, > > So, I realize this is a common issue, but still can''t identify > the problem here. Even after reading similar posts... Essentially, > I''m exporting / collecting hosts via stored configs.. > Here''s my export class: > > class basic::export{ > @@host { $fqdn: ip => $ipaddress, host_aliases => $hostname, tag > => "${func_group}"} > } > } > > Here''s how I''m collecting them: > Host<<| tag == "${func_group}" |>> > > **func_group is defined in the external node classifier (Foreman: I''m > not sure it makes a difference). > func_group= "test" > > Why am I getting exported resource conflict? fqdn is unique to each > host, so there are no duplicates... > > What do you guys think?I''ve never done this, but I would assume that it''s host_aliases. Try removing that and see what happens. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
CraftyTech
2010-Sep-21 15:09 UTC
[Puppet Users] Re: Exported resource Host[fqdn] cannot override local resource
Thanks for your response, but host_aliases is part of the host type. See below: http://docs.puppetlabs.com/references/0.25.5/type.html#host : host Installs and manages host entries. For most systems, these entries will just be in /etc/hosts, but some systems (notably OS X) will have different solutions. Parameters ENSURE The basic property that the resource should be in. Valid values are present, absent. HOST_ALIASES Any aliases the host might have. Multiple values must be specified as an array. Note that this property is not the same as the “alias” metaparam; use this property to add aliases to a host on disk, and “alias” to aliases for use in your Puppet scripts. IP The host’s IP address, IPv4 or IPv6. NAME namevar The host name. PROVIDER The specific backend for provider to use. You will seldom need to specify this – Puppet will usually discover the appropriate provider for your platform. Available providers are: parsed: TARGET The file in which to store service information. Only used by those providers that write to disk. On Sep 21, 10:58 am, Patrick <kc7...@gmail.com> wrote:> On Sep 21, 2010, at 7:04 AM, CraftyTech wrote: > > > > > > > Hello All, > > > So, I realize this is a common issue, but still can''t identify > > the problem here. Even after reading similar posts... Essentially, > > I''m exporting / collecting hosts via stored configs.. > > Here''s my export class: > > > class basic::export{ > > @@host { $fqdn: ip => $ipaddress, host_aliases => $hostname, tag > > => "${func_group}"} > > } > > } > > > Here''s how I''m collecting them: > > Host<<| tag == "${func_group}" |>> > > > **func_group is defined in the external node classifier (Foreman: I''m > > not sure it makes a difference). > > func_group= "test" > > > Why am I getting exported resource conflict? fqdn is unique to each > > host, so there are no duplicates... > > > What do you guys think? > > I''ve never done this, but I would assume that it''s host_aliases. Try removing that and see what happens.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jeff McCune
2010-Sep-21 16:51 UTC
Re: [Puppet Users] Exported resource Host[fqdn] cannot override local resource
On Tue, Sep 21, 2010 at 7:04 AM, CraftyTech <hmmedina@gmail.com> wrote: [snip]> Why am I getting exported resource conflict? fqdn is unique to each > host, so there are no duplicates...Are you absolutely sure? What host is complaining about the duplicate? Do you have any "plain" host type declarations outside of the collected resource which may be conflicting? -- Jeff McCune http://www.puppetlabs.com/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
CraftyTech
2010-Sep-21 17:17 UTC
[Puppet Users] Re: Exported resource Host[fqdn] cannot override local resource
Hello Jeff, This is the "only" class(s) I''m running on this host: class basics{ include basics::collect @@host { "$fqdn": ip => $ipaddress, host_aliases => $hostname, tag => "${application}"} class basics::collect { require basics Host<<| tag == "${application}" |>> } } This is what the host file looks like: # HEADER: This file was autogenerated at Tue Sep 21 12:51:18 -0400 2010 # HEADER: by puppet. While it can still be managed manually, it # HEADER: is definitely not recommended. 127.0.0.1 localhost.localdomain localhost There are no other hosts declarations. i.e, grep -iR "host {" /etc/puppet/ /etc/puppet/modules/basics/manifests/init.pp: @@host { "$fqdn": ip => $ipaddress, host_aliases => $hostname} /etc/puppet/modules/basic/manifests/hosts.pp_bak: host { ''test_host_for_puppet'': /etc/puppet/modules/basic/manifests/init.pp: @@host { "$fqdn": ip => $ipaddress, host_aliases => $hostname, tag => "${func_group}"} Only basic has another host export / collection... but I''m not using that one right now, just "basics". It''s pretty confusing, as now I can''t even do the collection without any filtering. i.e, class basics{ include basics::collect @@host { "$fqdn": ip => $ipaddress, host_aliases => $hostname} class basics::collect { require basics Host<<| |>> } } err: Could not retrieve catalog from remote server: Error 400 on SERVER: Exported resource Host[fqdn] cannot override local resource on node node.dev.domain.com Thanks, On Sep 21, 12:51 pm, Jeff McCune <j...@puppetlabs.com> wrote:> On Tue, Sep 21, 2010 at 7:04 AM, CraftyTech <hmmed...@gmail.com> wrote: > > [snip] > > > Why am I getting exported resource conflict? fqdn is unique to each > > host, so there are no duplicates... > > Are you absolutely sure? What host is complaining about the duplicate? > > Do you have any "plain" host type declarations outside of the > collected resource which may be conflicting? > > -- > Jeff McCunehttp://www.puppetlabs.com/-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jeff McCune
2010-Sep-21 18:38 UTC
Re: [Puppet Users] Re: Exported resource Host[fqdn] cannot override local resource
On Tue, Sep 21, 2010 at 10:17 AM, CraftyTech <hmmedina@gmail.com> wrote: [snip]> This is what the host file looks like: > # HEADER: This file was autogenerated at Tue Sep 21 12:51:18 -0400 > 2010 > # HEADER: by puppet. While it can still be managed manually, it > # HEADER: is definitely not recommended. > 127.0.0.1 localhost.localdomain localhost > > There are no other hosts declarations. i.e, > > grep -iR "host {" /etc/puppet/ > /etc/puppet/modules/basics/manifests/init.pp: @@host { "$fqdn": > ip => $ipaddress, host_aliases => $hostname} > /etc/puppet/modules/basic/manifests/hosts.pp_bak: host > { ''test_host_for_puppet'': > /etc/puppet/modules/basic/manifests/init.pp: @@host { "$fqdn": ip > => $ipaddress, host_aliases => $hostname, tag => "${func_group}"} >What does the output of the following commands return? facter fqdn facter hostname facter ipaddress It looks like your hostname is localhost.localdomain, and puppet is refusing to change the entry you already have for localhost.localdomain from 127.0.0.1 to whatever the ipaddress fact returns. Cheers, -- Jeff McCune http://www.puppetlabs.com/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
CraftyTech
2010-Sep-21 18:54 UTC
[Puppet Users] Re: Exported resource Host[fqdn] cannot override local resource
client ~ $ facter fqdn; facter hostname; facter ipaddress client.dev.domain.com client 172.20.19.191 server ad # facter fqdn; facter hostname; facter ipaddress server.dev.domain.com server 172.17.19.175 also very strange.. the collection goes through twice ! Even thought I have it setup once.. i.e, debug: Scope(Class[basics]): Collected 2 Host resources in 0.01 seconds debug: Scope(Class[basics]): Collected 0 Host resources in 0.00 seconds Thanks, On Sep 21, 2:38 pm, Jeff McCune <j...@puppetlabs.com> wrote:> On Tue, Sep 21, 2010 at 10:17 AM, CraftyTech <hmmed...@gmail.com> wrote: > > [snip] > > > > > > > This is what the host file looks like: > > # HEADER: This file was autogenerated at Tue Sep 21 12:51:18 -0400 > > 2010 > > # HEADER: by puppet. While it can still be managed manually, it > > # HEADER: is definitely not recommended. > > 127.0.0.1 localhost.localdomain localhost > > > There are no other hosts declarations. i.e, > > > grep -iR "host {" /etc/puppet/ > > /etc/puppet/modules/basics/manifests/init.pp: @@host { "$fqdn": > > ip => $ipaddress, host_aliases => $hostname} > > /etc/puppet/modules/basic/manifests/hosts.pp_bak: host > > { ''test_host_for_puppet'': > > /etc/puppet/modules/basic/manifests/init.pp: @@host { "$fqdn": ip > > => $ipaddress, host_aliases => $hostname, tag => "${func_group}"} > > What does the output of the following commands return? > > facter fqdn > facter hostname > facter ipaddress > > It looks like your hostname is localhost.localdomain, and puppet is > refusing to change the entry you already have for > localhost.localdomain from 127.0.0.1 to whatever the ipaddress fact > returns. > > Cheers, > -- > Jeff McCunehttp://www.puppetlabs.com/-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jeff McCune
2010-Sep-21 19:23 UTC
Re: [Puppet Users] Re: Exported resource Host[fqdn] cannot override local resource
On Tue, Sep 21, 2010 at 11:54 AM, CraftyTech <hmmedina@gmail.com> wrote: [snip]> also very strange.. the collection goes through twice ! Even thought I > have it setup once.. > i.e, > debug: Scope(Class[basics]): Collected 2 Host resources in 0.01 > seconds > debug: Scope(Class[basics]): Collected 0 Host resources in 0.00 > secondsI''d take a look at the database tables, looks like two resources may have the same IP address property or some other conflict. -- Jeff McCune http://www.puppetlabs.com/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
CraftyTech
2010-Sep-22 15:25 UTC
[Puppet Users] Re: Exported resource Host[fqdn] cannot override local resource
I purged the entire database and things are working again. I did lose some valuable settings from Foreman, but restarting with a clean slate was worth the hassle. I''ll look into integrating some DB snapshots into my setup. That way I''ll be able to revert to a previous database snapshot if need be. Thanks for your help. Henry On Sep 21, 3:23 pm, Jeff McCune <j...@puppetlabs.com> wrote:> On Tue, Sep 21, 2010 at 11:54 AM, CraftyTech <hmmed...@gmail.com> wrote: > > [snip] > > > also very strange.. the collection goes through twice ! Even thought I > > have it setup once.. > > i.e, > > debug: Scope(Class[basics]): Collected 2 Host resources in 0.01 > > seconds > > debug: Scope(Class[basics]): Collected 0 Host resources in 0.00 > > seconds > > I''d take a look at the database tables, looks like two resources may > have the same IP address property or some other conflict. > > -- > Jeff McCunehttp://www.puppetlabs.com/-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.