I''m building apt source files in /etc/apt/sources.list.d on Ubuntu based on a recipe on the puppet site. This does have a few problems though. Some apps expect /etc/apt/sources.list to exist and get upset if it doesn''t. I''d rather combine the individual files into one file that replaces / etc/apt/sources.list. Is there an easy way to do that? Thanks. Jeff --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi. You could create an empty /etc/apt/sources.list Or you could use the file_splice method: http://reductivelabs.com/trac/puppet/wiki/BracketEditor We do have the standard distribution repositories in /etc/apt/ sources.list and additional contrib repositories in /etc/apt/ sources.list.d This works pretty well for us, since we create sources.list via template: #sources.list.debian.erb <% downloadmirror.each do |mirror| -%> deb <%= mirror %>/debian unstable main contrib non-free deb <%= mirror %>/debian testing main contrib non-free deb <%= mirror %>/debian stable main contrib non-free #deb <%= mirror %>/debian-non-US stable main contrib non-free ### Security updates deb <%= mirror %>/debian-security stable/updates main contrib non-free deb <%= mirror %>/debian-security testing/updates main contrib non-free <% end -%> You only need to define an array called downloadmirror with all or one of the mirrors you want to have. Then you can use this template for / etc/apt/sources.list bye, udo. On 20.06.2009, at 04:36, jchonig wrote:> > I''m building apt source files in /etc/apt/sources.list.d on Ubuntu > based on a recipe on the puppet site. This does have a few problems > though. Some apps expect /etc/apt/sources.list to exist and get upset > if it doesn''t. > > I''d rather combine the individual files into one file that replaces / > etc/apt/sources.list. Is there an easy way to do that? > > Thanks. > > Jeff > > --~--~---------~--~----~------------~-------~--~----~ > 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 > -~----------~----~----~----~------~----~------~--~--- >-- :: udo waechter - root@zoide.net :: N 52º16''30.5" E 8º3''10.1" :: genuine input for your ears: http://auriculabovinari.de :: your eyes: http://ezag.zoide.net :: your brain: http://zoide.net
On Jun 20, 4:28 pm, Udo Waechter <udo.waech...@uni-osnabrueck.de> wrote:> Hi. > > You could create an empty /etc/apt/sources.listI would actually like this file to be build from the contents I provide. I have local mirrors of the Ubuntu repositories (for binaries), so I want to override this file. Plus, if it is correct, more things work properly.> Or you could use the file_splice method:http://reductivelabs.com/trac/puppet/wiki/BracketEditorI''ll take a look at this. I think I could do what I wanted by building a bunch of files into a temp directory and then cattting them to /etc/apt/sources.list. But I''m wondring if there is an easier way. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sunday 21 June 2009 14:53:14 jchonig wrote:> I think I could do what I wanted by building a bunch of files into a > temp directory and then cattting them to /etc/apt/sources.list. But > I''m wondring if there is an easier way.Put files into /etc/apt/sources.d? Apt does support wildcard includes for sources. -- Robin <robin@kallisti.net.nz> JabberID: <eythian@jabber.kallisti.net.nz> http://www.kallisti.net.nz/blog ||| http://identi.ca/eythian PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D
jchonig wrote:> I think I could do what I wanted by building a bunch of files into a > temp directory and then cattting them to /etc/apt/sources.list. But > I''m wondring if there is an easier way. >David Schmitt wrote a recipe for this, check out his `common'' module (hint: look for concatenated_file) -scott --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I think this basically does what you want: http://reductivelabs.com/trac/puppet/wiki/Recipes/BuildingMultipartFiles You would use file numbering for ordering and a sort | cat combination in the exec to get an ordered file if you need one. Trevor On Fri, Jun 19, 2009 at 22:36, jchonig <jchonig@gmail.com> wrote:> > I''m building apt source files in /etc/apt/sources.list.d on Ubuntu > based on a recipe on the puppet site. This does have a few problems > though. Some apps expect /etc/apt/sources.list to exist and get upset > if it doesn''t. > > I''d rather combine the individual files into one file that replaces / > etc/apt/sources.list. Is there an easy way to do that? > > Thanks. > > Jeff > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
''lo, You an also try http://nephilim.ml.org/~rip/puppet/concatfile/ It''s a bit more flexible than the one on that recipe. ----- "Trevor Vaughan" <peiriannydd@gmail.com> wrote:> I think this basically does what you want: > http://reductivelabs.com/trac/puppet/wiki/Recipes/BuildingMultipartFiles > > You would use file numbering for ordering and a sort | cat combination > in the exec to get an ordered file if you need one. > > Trevor > > > On Fri, Jun 19, 2009 at 22:36, jchonig < jchonig@gmail.com > wrote: > > > > I''m building apt source files in /etc/apt/sources.list.d on Ubuntu > based on a recipe on the puppet site. This does have a few problems > though. Some apps expect /etc/apt/sources.list to exist and get upset > if it doesn''t. > > I''d rather combine the individual files into one file that replaces / > etc/apt/sources.list. Is there an easy way to do that? > > Thanks. > > Jeff > > > > >-- R.I.Pienaar --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Scott Smith wrote:> jchonig wrote: >> I think I could do what I wanted by building a bunch of files into a >> temp directory and then cattting them to /etc/apt/sources.list. But >> I''m wondring if there is an easier way. >> > > David Schmitt wrote a recipe for this, check out his `common'' module > (hint: look for concatenated_file) >http://git.black.co.at/?p=module-common;a=blob;f=manifests/defines/concatenated_file.pp;hb=HEAD Regards, DavidS --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Schmitt
2009-Jun-23 11:33 UTC
BracketEditor (was: Re: [Puppet Users] Re: Making a file out of fragments)
Udo Waechter wrote:> Hi. > > You could create an empty /etc/apt/sources.list > > Or you could use the file_splice method: > http://reductivelabs.com/trac/puppet/wiki/BracketEditorPlease don''t. That was just a hack for the then-ongoing design discussions. I''d rather have that page deleted. Regards, DavidS --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks for all the pointers! Currently I build all the files with a derivation of the Apt_Repository recipe (http://reductivelabs.com/trac/puppet/wiki/ Recipes/Apt_Repositories). So I would need to write these files to a temp dir on the client and run concat on them. Is there a way to concatenate a set of apt_repository rule outputs into one data set that I can write to a file and skip the temporary files? One of the reasons I want a single sources.list is that a live upgrade wants to re-write this file. I also currently have the problem if that I change the manifest to remove a repository, the old files do not get removed. On Jun 23, 7:29 am, David Schmitt <da...@dasz.at> wrote:> Scott Smith wrote: > > jchonig wrote: > >> I think I could do what I wanted by building a bunch of files into a > >> temp directory and then cattting them to /etc/apt/sources.list. But > >> I''m wondring if there is an easier way. > > > David Schmitt wrote a recipe for this, check out his `common'' module > > (hint: look for concatenated_file) > > http://git.black.co.at/?p=module-common;a=blob;f=manifests/defines/co... > > Regards, DavidS--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi> Currently I build all the files with a derivation of the > Apt_Repository recipe (http://reductivelabs.com/trac/puppet/wiki/ > Recipes/Apt_Repositories). So I would need to write these files to a > temp dir on the client and run concat on them.this is a working solution.> Is there a way to concatenate a set of apt_repository rule outputs > into one data set that I can write to a file and skip the temporary > files?writing a custom provider with parsedfile might be solution. have a look for example at the existing host provider. another solution might be to use augeas [1] for it. cheers pete [1] http://reductivelabs.com/trac/puppet/wiki/TypeReference#augeas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks for all your suggestions. The simple solution was to put the files in a temporary directory and concat them into /etc/apt/ sources.list. I already create a local directory: /etc/local, so I put sources.list.d dir under that. Thanks again. Jeff On Jun 19, 10:36 pm, jchonig <jcho...@gmail.com> wrote:> I''m building apt source files in /etc/apt/sources.list.d on Ubuntu > based on a recipe on the puppet site. This does have a few problems > though. Some apps expect /etc/apt/sources.list to exist and get upset > if it doesn''t. > > I''d rather combine the individual files into one file that replaces / > etc/apt/sources.list. Is there an easy way to do that? > > Thanks. > > Jeff--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---