Hugo Rogg
2012-Nov-06 17:25 UTC
[Puppet Users] Newbie: puppetlabs-apache, modules and proxying
Hi, I''m quite new to puppet but feel like making some progress. :) Today I started using the puppetlabs-apache module. Two questions arose from that. I tried understanding by looking at the module''s code, but too much of that still looks like advanced wizardry to me. I hope this list is the right place to post my questions. 1) How can I enable custom modules? I try to enable proxy_ajp. Creating ''/etc/httpd/mod.d/proxy_ajp.load '' manually and puppet will remove the module, so I assume puppet knows about the module notice: /A2mod[proxy_ajp]/ensure: current_value present, should be absent (noop) How to tell puppet to actually activate the module? I''ve tried this in my node configuration: class {''apache::mod::proxy_ajp'': } as the same semantic worked for the proxy_http module, but now puppet complains: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class apache::mod::proxy_ajp 2) How to use a different proxy.conf template? In this module: puppetlabs-apache / manifests / mod / proxy.pp class apache::mod::proxy ( $proxy_requests = "Off" ) { apache::mod { ''proxy'': } # Template uses $proxy_requests file { "${apache::params::vdir}/proxy.conf": ensure => present, content => template(''apache/mod/proxy.conf.erb''), } } there''s a reference to the template proxy.conf.erb which is located in the modules folder. How can I override this in my node config (or anywhere else)? I want to use a template from a different location, because I believe the module should not be modified, just used. Thanks for pointing me in the right direction. Hugo -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Sd4v2NGth7kJ. 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.
Hugo Rogg
2012-Nov-08 17:05 UTC
[Puppet Users] Re: Newbie: puppetlabs-apache, modules and proxying
Meanwhile I figured out how to enable modules. In my case I added this to the node''s config. apache::mod { ''proxy_ajp'': } Can''t believe this is not documented or that I might have missed it. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/IyssAqizYjkJ. 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.
Hugo Rogg
2012-Nov-08 19:54 UTC
[Puppet Users] Re: Newbie: puppetlabs-apache, modules and proxying
Finally I''ve also solved my other issue. Don''t know though if it''s the right way but I''m overwriting the class. That''s what I have now added to my node config. class child_proxy inherits apache::mod::proxy { $proxy_requests = "Off" File [ "${apache::params::vdir}/proxy.conf"] { content => template(''/path/to/my/own/proxy.conf.erb''), } } class {''child_proxy'':} On Tuesday, November 6, 2012 6:25:17 PM UTC+1, Hugo Rogg wrote:> > Hi, > > I''m quite new to puppet but feel like making some progress. :) > Today I started using the puppetlabs-apache module. > > Two questions arose from that. I tried understanding by looking at the > module''s code, but too much of that still looks like advanced wizardry to > me. > I hope this list is the right place to post my questions. > > 1) How can I enable custom modules? > I try to enable proxy_ajp. > Creating ''/etc/httpd/mod.d/proxy_ajp.load '' manually and puppet will > remove the module, so I assume puppet knows about the module > notice: /A2mod[proxy_ajp]/ensure: current_value present, should be absent > (noop) > > How to tell puppet to actually activate the module? > I''ve tried this in my node configuration: > class {''apache::mod::proxy_ajp'': } > as the same semantic worked for the proxy_http module, but now puppet > complains: > Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error > ArgumentError: Could not find declared class apache::mod::proxy_ajp > > 2) How to use a different proxy.conf template? > In this module: > puppetlabs-apache / manifests / mod / proxy.pp > > class apache::mod::proxy ( > $proxy_requests = "Off" > ) { > apache::mod { ''proxy'': } > # Template uses $proxy_requests > file { "${apache::params::vdir}/proxy.conf": > ensure => present, > content => template(''apache/mod/proxy.conf.erb''), > } > > } > > there''s a reference to the template proxy.conf.erb which is located in the > modules folder. How can I override this in my node config (or anywhere > else)? I want to use a template from a different location, because I > believe the module should not be modified, just used. > > > Thanks for pointing me in the right direction. > Hugo > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/DGMXMlcXw3YJ. 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.
Jakov Sosic
2012-Nov-12 17:45 UTC
Re: [Puppet Users] Re: Newbie: puppetlabs-apache, modules and proxying
On 11/08/2012 06:05 PM, Hugo Rogg wrote:> Meanwhile I figured out how to enable modules. > In my case I added this to the node''s config. > > apache::mod { ''proxy_ajp'': } > > > > Can''t believe this is not documented or that I might have missed it.You can also do: include apache::mod::proxy_ajp, which would be a much cleaner way. The way you figured out is from parametrized classes and it is not the best way to use it. I just hope jcbollinger didn''t see it because he''ll get mad if he does :D -- 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.
jcbollinger
2012-Nov-13 20:16 UTC
Re: [Puppet Users] Re: Newbie: puppetlabs-apache, modules and proxying
On Monday, November 12, 2012 11:46:05 AM UTC-6, Jakov Sosic wrote:> > On 11/08/2012 06:05 PM, Hugo Rogg wrote: > > Meanwhile I figured out how to enable modules. > > In my case I added this to the node''s config. > > > > apache::mod { ''proxy_ajp'': } > > > > > > > > Can''t believe this is not documented or that I might have missed it. > > You can also do: > > include apache::mod::proxy_ajp, which would be a much cleaner way. The > way you figured out is from parametrized classes and it is not the best > way to use it. I just hope jcbollinger didn''t see it because he''ll get > mad if he does :D >I see you''ve been paying attention. :-) I haven''t actually been following this thread in any detail, but I would like to point out that apache::mod { ''proxy_ajp'': } is the declaration of a *resource* of type ''apache::mod'', named ''proxy_ajp''. Apache::mod is probably a defined type, though it could also be a custom native type. That''s not at all the same thing as include apache::mod::proxy_ajp which assigns a *class* named ''apache::mod::proxy_ajp'' to the node. It would be possible for the implementation of type apache::mod to make the two statements substantially equivalent, but they are not inherently so. Either way, no parametrized-class syntax is involved. For the record, I have no objection to custom and defined types. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/alGGf4mthTQJ. 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.
Jakov Sosic
2012-Nov-13 21:28 UTC
Re: [Puppet Users] Re: Newbie: puppetlabs-apache, modules and proxying
On 11/13/2012 09:16 PM, jcbollinger wrote:> I see you''ve been paying attention. :-)Yeah because I tend to read all the mails on this list. From time to time my unread queue tends to grow over 500 messages, but as soon as I get some spare time I tend to shrink it back to zero. It''s a nice way to get various ideas from other people, and avoid doing mistakes like defining parametrized classes as resources :) Or at least to be aware of the shortcomings of such approach.> I haven''t actually been following this thread in any detail, but I would > like to point out that > > apache::mod { ''proxy_ajp'': } > > is the declaration of a /resource/ of type ''apache::mod'', named > ''proxy_ajp''. Apache::mod is probably a defined type, though it could > also be a custom native type. That''s not at all the same thing as > > include apache::mod::proxy_ajp > > which assigns a /class/ named ''apache::mod::proxy_ajp'' to the node. It > would be possible for the implementation of type apache::mod to make the > two statements substantially equivalent, but they are not inherently > so. Either way, no parametrized-class syntax is involved.Yeah, you''re right... I''m using the same puppet module but like this: ... include apache::mod::status include apache::mod::proxy include apache::mod::proxy_http ... so I didn''t pay attention to details :) Now that I look at apache module from puppetlabs, apache::mod is indeed defined type: define apache::mod ( $package = undef ) { $mod = $name ... ... }> For the record, I have no objection to custom and defined types.I know :) -- Jakov Sosic www.srce.unizg.hr -- 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.