Maxym Pendyshchuk
2012-Dec-18 18:03 UTC
[Puppet Users] adding repositories to sources.list
Dear puppet community! I need to add some repositories to sources.list to be able to install sun jdk: deb-src http://security.debian.org/ lenny/updates main non-free deb http://security.debian.org/ lenny/updates main non-free deb-src http://mirrors.kernel.org/debian/ lenny main non-free deb http://mirrors.kernel.org/debian/ lenny main non-free I was looking for the best approach for it and decided to try puppetlabs/apt module. Eventually I came out with the following script: class repositories { include apt apt::source { ''sun_java'': location => "http://security.debian.org/", release => "squeeze/update", repos => "main non-free", include_src => true, } apt::source { ''sun_java2'': location => "http://mirrors.kernel.org/debian/", repos => "main non-free", include_src => true, } package { ''sun_java'': ensure => installed, require => [ Apt::Source[''sun_java''], Apt::Source[''sun_java2''] ], } } include repositories the questions are: 1) how can I added all repositories using one apt::source? 2) I had to write specific release ("squeeze/update").. Is here a way to tell just updates and apt module will generate ${os_version}/update release? (it depends on Debian version, can be lenny/updates...) 3) seems that after adding new repositories puppet tries to install package sun-java... I do not know why, but I get the following error: "Unable to locate package sun-java".. why it happens? should I just ignore it, or there is a way to control? 4) any other improvements (best practices?) can you suggest? -- 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/-/yuuHr903EAAJ. 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.
windowsrefund
2012-Dec-18 20:41 UTC
[Puppet Users] Re: adding repositories to sources.list
Generally speaking, you should be managing files in the sources.list.d directory instead of managing lines in a single file. also (generally speaking), you can apt::source { foo: ensure => present; bar: ensure => absent; } The "style guide" frowns upon this syntax but it is far superior due to the manifest''s reduced size and cleaner organization. -- 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/-/WqObe01aP0AJ. 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.
Maxym Pendyshchuk
2012-Dec-18 21:13 UTC
[Puppet Users] Re: adding repositories to sources.list
thanks for reply and another way to write it. And yes, in result I get two files in sources.list.d directory. Is here any way to make it 1? I tried something like: apt::source { foo: location => [ ''first_location'', ''second_location'' ] ... } but it does not work... I know that in my case it actually won''t work because I have 2 different releases (squeeze/update and squeeze), but in general? Maybe everything I can do is just following your advice about writing style... On Tuesday, December 18, 2012 10:41:14 PM UTC+2, windowsrefund wrote:> > Generally speaking, you should be managing files in the sources.list.d > directory instead of managing lines in a single file. > > also (generally speaking), you can > > apt::source { > foo: > ensure => present; > bar: > ensure => absent; > } > > The "style guide" frowns upon this syntax but it is far superior due to > the manifest''s reduced size and cleaner organization. >-- 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/-/9o4SB8wozxAJ. 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.