Hi all, I''ve got two classes. One installs and configures the web server lighttpd, and the other installs and configures Mailman. Both these classes need to copy configuration files into the same directory, but I can only get lighttpd''s files copied in, Mailman''s seem to be ignored. In my node''s configuration file I have "include mailman", so the fact that lighttpd''s config files are copied means the inheritance is working, which means it''s something to do with the way I''m appending the additional source line in the mailman class definition. What am I doing wrong? Many thanks, Adam. class lighttpd { file { "/etc/lighttpd/conf-enabled": source => "puppet:///files/lighttpd/$hostname/", recurse => true, ; "/etc/lighttpd/conf-enabled/10-accesslog.conf": ensure => symlink, target => "../conf-available/10-accesslog.conf", ; } package { "lighttpd": ensure => present } } class mailman inherits lighttpd { file { "/etc/mailman/mm_cfg.py": source => "puppet:///files/mailman/mm_cfg.py", owner => "root", group => "root", mode => 0644, ; } File["/etc/lighttpd/conf-enabled"] { source +> "puppet:///files/mailman/lighttpd/", recurse => true, require => Package["lighttpd"], } package { "mailman": ensure => present, # Don''t install until lighttpd is available or it will # pull in Apache require => Package["lighttpd"] } } -- 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.
Nigel Kersten
2011-Jan-08 16:23 UTC
Re: [Puppet Users] Inheriting doesn''t work with files?
On Sat, Jan 8, 2011 at 2:58 AM, Adam Nielsen <a.nielsen@shikadi.net> wrote:> Hi all, > > I''ve got two classes. One installs and configures the web server lighttpd, > and the other installs and configures Mailman. > > Both these classes need to copy configuration files into the same directory, > but I can only get lighttpd''s files copied in, Mailman''s seem to be ignored. > > In my node''s configuration file I have "include mailman", so the fact that > lighttpd''s config files are copied means the inheritance is working, which > means it''s something to do with the way I''m appending the additional source > line in the mailman class definition. > > What am I doing wrong?It looks to me that you''re going to end up with: source => ["puppet:///files/lighttpd/$hostname/", "puppet:///files/mailman/lighttpd/",] and the first one that exists will be used. I''m not sure you want to use plusignment in this case, don''t you want to replace the original source with the new one?> > Many thanks, > Adam. > > > class lighttpd { > > file { > "/etc/lighttpd/conf-enabled": > source => "puppet:///files/lighttpd/$hostname/", > recurse => true, > ; > > "/etc/lighttpd/conf-enabled/10-accesslog.conf": > ensure => symlink, > target => "../conf-available/10-accesslog.conf", > ; > } > > package { "lighttpd": ensure => present } > > } > > class mailman inherits lighttpd { > file { > "/etc/mailman/mm_cfg.py": > source => "puppet:///files/mailman/mm_cfg.py", > owner => "root", > group => "root", > mode => 0644, > ; > > } > > File["/etc/lighttpd/conf-enabled"] { > source +> "puppet:///files/mailman/lighttpd/", > recurse => true, > require => Package["lighttpd"], > } > > package { "mailman": > ensure => present, > # Don''t install until lighttpd is available or it will > # pull in Apache > require => Package["lighttpd"] > } > > } > > -- > 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. > >-- 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.
Adam Nielsen
2011-Jan-08 23:58 UTC
Re: [Puppet Users] Inheriting doesn''t work with files?
>> Both these classes need to copy configuration files into the same directory, >> but I can only get lighttpd''s files copied in, Mailman''s seem to be ignored. >> >> What am I doing wrong? > > It looks to me that you''re going to end up with: > > source => ["puppet:///files/lighttpd/$hostname/", > "puppet:///files/mailman/lighttpd/",] > > and the first one that exists will be used. I''m not sure you want to > use plusignment in this case, don''t you want to replace the original > source with the new one?No, I want the ''source'' line to be as you suggest - the contents of *both* paths should be copied into the same folder, as it''s a "conf.d" style directory. For example, the first path contains 10-main.conf and the second path contains 20-mailman.conf. Both these should be copied into the destination path so that when lighttpd runs, it sees all these files in the same folder and uses them all to read its configuration. Cheers, Adam. -- 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.
Stefan Schulte
2011-Jan-09 01:27 UTC
Re: [Puppet Users] Inheriting doesn''t work with files?
On Sun, Jan 09, 2011 at 09:58:01AM +1000, Adam Nielsen wrote:> >> Both these classes need to copy configuration files into the same directory, > >> but I can only get lighttpd''s files copied in, Mailman''s seem to be ignored. > >> > >> What am I doing wrong? > > > > It looks to me that you''re going to end up with: > > > > source => ["puppet:///files/lighttpd/$hostname/", > > "puppet:///files/mailman/lighttpd/",] > > > > and the first one that exists will be used. I''m not sure you want to > > use plusignment in this case, don''t you want to replace the original > > source with the new one? > > No, I want the ''source'' line to be as you suggest - the contents of *both* > paths should be copied into the same folder, as it''s a "conf.d" style > directory. For example, the first path contains 10-main.conf and the second > path contains 20-mailman.conf. Both these should be copied into the > destination path so that when lighttpd runs, it sees all these files in the > same folder and uses them all to read its configuration. >Then I guess sourceselect => all [1] is what you want [1] http://docs.puppetlabs.com/references/stable/type.html#sourceselect -Stefan -- 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.
Adam Nielsen
2011-Jan-09 04:06 UTC
Re: [Puppet Users] Inheriting doesn''t work with files?
>> No, I want the ''source'' line to be as you suggest - the contents of *both* >> paths should be copied into the same folder, as it''s a "conf.d" style >> directory. For example, the first path contains 10-main.conf and the second >> path contains 20-mailman.conf. Both these should be copied into the >> destination path so that when lighttpd runs, it sees all these files in the >> same folder and uses them all to read its configuration. >> > Then I guess sourceselect => all [1] is what you want > > [1] http://docs.puppetlabs.com/references/stable/type.html#sourceselectAhh, yes that''s exactly what I needed :-) Problem solved, many thanks! Cheers, Adam. -- 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.