Sebastian Hempel
2010-Dec-09 10:24 UTC
[Puppet Users] Invalid parameter when assigning parameterized class to a node
Hello, I searched through the archive of the google group but did not found any solution or hint for my problem. I want to assign the following parameterized class to a node. class httpd($certMail, $certOU) { ... } This is the node statement to assign the class to a node. node "someserver" inherits basenode { class { httpd: certEMail => "an.email@address", certOU => "organizational unit"; } } When running puppet I get the following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter certEMail at /var/lib/puppet/abnahme/manifests/nodes.pp:118 on node someserver The line 118 contains the end bracket } of the class statement. I tried to use different names for the parameters - lower cases only, mixed upper / lower cases - but the error message is always the same. Do you have any idea what is wrong with my class definition / assignment? Best regards Sebastian -- *Sebastian Hempel* Veilchenweg 4 · 95195 Röslau · Germany eMail: sebastian@hempel-roeslau.de -- 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.
Daniel Pittman
2010-Dec-09 10:30 UTC
Re: [Puppet Users] Invalid parameter when assigning parameterized class to a node
On Thu, Dec 9, 2010 at 21:24, Sebastian Hempel <sebastian@hempel-roeslau.de> wrote:> Hello, > > I searched through the archive of the google group but did not found any > solution or hint for my problem. > > I want to assign the following parameterized class to a node. > > class httpd($certMail, $certOU) {Here you have cert *NO E* Mail, and later you use it with an E, so I suspect a simple typo.> I tried to use different names for the parameters - lower cases only, > mixed upper / lower cases - but the error message is always the same.Sometimes puppet can be strange about case, but if you tested all lower case I strongly suspect my invisible typo theory. (I know I can never see those things. :) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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.
Sebastian Hempel
2010-Dec-09 10:57 UTC
Re: [Puppet Users] Invalid parameter when assigning parameterized class to a node
Hi Daniel,> Here you have cert *NO E* Mail, and later you use it with an E, so I > suspect a simple typo.I changed that typo - thanks - and also changed all characters to lower case. But the error described did not disappear. Any ideas left? Best regards Sebastian -- *Sebastian Hempel* Veilchenweg 4 · 95195 Röslau · Germany eMail: sebastian@hempel-roeslau.de -- 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.
Daniel Pittman
2010-Dec-09 11:03 UTC
Re: [Puppet Users] Invalid parameter when assigning parameterized class to a node
On Thu, Dec 9, 2010 at 21:57, Sebastian Hempel <sebastian@hempel-roeslau.de> wrote:>> Here you have cert *NO E* Mail, and later you use it with an E, so I >> suspect a simple typo. > > I changed that typo - thanks - and also changed all characters to lower > case. But the error described did not disappear. > > Any ideas left?This works for me, as a local test: class httpd($certemail, $certou) { notice("email $certemail for ou $certou") } node "ea" { class { httpd: certemail => "an.email@address", certou => "organizational unit"; } } Can you verify that works for you? Obviously, change my node name to your test node name; I just wrote that to test.pp and ran ''puppet test.pp'' to verify. :) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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.
Felix Frank
2010-Dec-09 11:09 UTC
Re: [Puppet Users] Invalid parameter when assigning parameterized class to a node
On 12/09/2010 11:24 AM, Sebastian Hempel wrote:> Hello, > > I searched through the archive of the google group but did not found any > solution or hint for my problem. > > I want to assign the following parameterized class to a node. > > class httpd($certMail, $certOU) { > ... > } > > This is the node statement to assign the class to a node. > > node "someserver" inherits basenode { > class { httpd: > certEMail => "an.email@address", > certOU => "organizational unit"; > } > } > > When running puppet I get the following error: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Invalid parameter certEMail at > /var/lib/puppet/abnahme/manifests/nodes.pp:118 on node someserver > > The line 118 contains the end bracket } of the class statement. > > I tried to use different names for the parameters - lower cases only, > mixed upper / lower cases - but the error message is always the same. > > Do you have any idea what is wrong with my class definition / assignment?What are the versions of your master and client, btw? -- 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.
Sebastian Hempel
2010-Dec-09 12:32 UTC
Re: [Puppet Users] Invalid parameter when assigning parameterized class to a node
Hi Daniel,> Can you verify that works for you? Obviously, change my node name > to your test node name; I just wrote that to test.pp and ran ''puppet > test.pp'' to verify. :)I copied the class and node to a file test.pp and run ''puppet test.pp'' which successfully displayed the notice. The mechanism of parameterized classes works on the system. So I have to look at my module definition what makes puppet think that the parameters are not defined. Is it possible, that parameterized classes with class inheritance and nested classes might be the problem? The class with parameters is the base class of three other classes, that should be assigned to a node. class base($param1, $param2) { ... } class base { class first inherits base { } } Best regards Sebastian -- *Sebastian Hempel* Veilchenweg 4 · 95195 Röslau · Germany eMail: sebastian@hempel-roeslau.de -- 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.
Sebastian Hempel
2010-Dec-09 12:32 UTC
Re: [Puppet Users] Invalid parameter when assigning parameterized class to a node
Hi Felix,> What are the versions of your master and client, btw?I''m running the latest version 2.6.4 both on the master and the client / agent. Regards Sebastian -- *Sebastian Hempel* Veilchenweg 4 · 95195 Röslau · Germany eMail: sebastian@hempel-roeslau.de -- 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.
Felix Frank
2010-Dec-09 12:41 UTC
Re: [Puppet Users] Invalid parameter when assigning parameterized class to a node
> class base($param1, $param2) { > ... > } > > class base { > class first inherits base { > } > }Heh - this is not at all what you originally presented. There are two different definitions of class base? This can''t be right. Please try and illustrate the structure more pointedly. Otherwise, I believe I remember reading about issues with inheritance and class parameters. The two concepts may not mix. What exactly do you need class inheritance for in your case? You may be able to circumvent the inheritance using additional parameters. Regards, Felix -- 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.
Sebastian Hempel
2010-Dec-09 12:58 UTC
Re: [Puppet Users] Invalid parameter when assigning parameterized class to a node
Hi Frank,> Heh - this is not at all what you originally presented.That''s right. Old problem of a developer who diggs through the problem bit by bit and when asks a questions about a concrete detail.> There are two different definitions of class base? This can''t be > right. Please try and illustrate the structure more pointedly.I have a module (init.pp) with the definition of the base class, which is parameterized. class httpd($certEMail, $certOU) { hostCert { "$fqdn": certEMail => "$certEMail", certOU => "$certOU", require => Package["mod_ssl"] } The two parameters are handed to a define which creates a key and a certification request for the httpd server. The other ressources in the class are used to install the package, ensure that the service is started and that certain directories and files are created. For each virtual host I use a sub-class which installs the configuration file of the host and sets other necessary links and directories. class httpd { class virtual1 inherits httpd { ... } } As I write this I see, that you are right. There are two different definitions for the class base. Would it be correct to define the virtual1 class this way? class httpd::virtual1 inherits base { }> Otherwise, I believe I remember reading about issues with > inheritance and class parameters. The two concepts may not mix.I was thinking about this when I was searching for the "inheritance" of the class parameters from the base class.> What exactly do you need class inheritance for in your case? You may > be able to circumvent the inheritance using additional parameters.I want to assign the different virtual hosts to the nodes. By assigning the class for the virtual host I want to have the base configuration of the httpd daemon done automatically. A circumvent would be to assign the class with the configuration of the httpd daemon and separately assign the classes of the different virtual hosts. As I see, I should explain the whole problem and not the detail, that I think causes the problem. As already said: old problem of a developer. :-) Best regards Sebastian -- *Sebastian Hempel* Veilchenweg 4 · 95195 Röslau · Germany eMail: sebastian@hempel-roeslau.de -- 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.
Felix Frank
2010-Dec-09 13:49 UTC
Re: [Puppet Users] Invalid parameter when assigning parameterized class to a node
>> What exactly do you need class inheritance for in your case? You may >> be able to circumvent the inheritance using additional parameters. > > I want to assign the different virtual hosts to the nodes. By assigning > the class for the virtual host I want to have the base configuration of > the httpd daemon done automatically.You want to include httpd, not inherit it. Or are there any resource overrides in your vhost classes? I shouldn''t think so. HTH, Felix -- 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.
Sebastian Hempel
2010-Dec-09 14:57 UTC
Re: [Puppet Users] Invalid parameter when assigning parameterized class to a node
Hi Felix,> You want to include httpd, not inherit it. > > Or are there any resource overrides in your vhost classes? I > shouldn''t think so.You are right. There is no reason to override the httpd class with vhost classes. I now include the httpd class and after that include the neccessary vhost classes. Problem solved by using a better structure then before. Thanks! Regards Sebastian -- *Sebastian Hempel* Veilchenweg 4 · 95195 Röslau · Germany eMail: sebastian@hempel-roeslau.de -- 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.
Maybe Matching Threads
- How to ask for *fixed* number of distributions under parameterized Gaussian mixture model.
- Ruby DSL parameterized classes and defaults
- parameterized class precedences
- find_by_sql with named parameterized sql
- Parameterized ActiveRecord Associations: Any such thing?