Commit graph

233 commits

Author SHA1 Message Date
mh
bdc2446671 Merge remote-tracking branch 'shared/master'
Conflicts:
	README
2012-04-15 13:19:45 +02:00
mh
56efade862 use correct references for new concat usage 2012-04-11 11:35:31 +02:00
mh
5173c71715 use the correct name 2012-04-11 11:35:31 +02:00
mh
8996d83489 migrate concatenated_file to the concat module 2012-04-11 11:35:31 +02:00
Gabriel Filion
a835369958 Force an apt-get update when changing an apt::sources_list
sources_list doesn't currently force puppet to run 'apt-get update'
after creating/modifying/removing files in sources.list.d.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2012-04-09 01:39:29 -04:00
Gabriel Filion
4d0ddd0057 Refactor: manage .d directories when using sources_list and apt_conf
The .d directories are only managed by the main 'apt' class. However,
both 'sources_list' and 'apt_conf' defines depend on those directories.
So in practice, the defines have an implicit need for those directories
to be somehow managed.

Let's turn this into an explicit relation, and include the directories
in the defines.

This makes it possible to use both defines without having to include the
main 'apt' class. (maybe when using puppet apply?)

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2012-04-09 01:38:30 -04:00
mh
7727549c02 use correct references for new concat usage 2011-08-05 11:22:05 +02:00
mh
2b7cfe52f7 use the correct name 2011-08-05 11:12:29 +02:00
mh
e99f7c8672 migrate concatenated_file to the concat module 2011-08-05 10:57:13 +02:00
mh
54932c9c21 fix unattended upgrades
as we use $lsbdistcodename as source we cannot name the sources
which should be used to update "stable". -> Fix it by deploying
a per lsbdistcodename configfile. This can also be used as a pre-
work for the #2681 shared modules bug.
2011-06-05 14:58:22 +02:00
intrigeri
d0f7e98ec5 Revert "apt::custom_sources_template to deploy custom sources.list.d/xyz.list"
This reverts commit 3c0499b78d.
This was already provided by sources_list.pp.
2011-04-25 22:50:53 +02:00
root
5964e90e33 Possibility to delpoy release related config file 2011-04-02 11:16:43 +00:00
root
63c7b5a643 Merge branch 'master' of git://labs.riseup.net/shared-apt 2011-04-02 07:53:38 +00:00
intrigeri
14cd91de33 apt::cron::dist-upgrade: silently keep old version of conffiles.
This makes this class' behaviour consistent with the apt::dist_upgrade one
and prevents stalled upgrades due to dpkg asking questions to a dumb robot.
2011-02-18 22:41:36 +01:00
root
13033f7d81 Merge branch 'master' of git://labs.riseup.net/shared-apt 2011-02-16 13:23:54 +00:00
varac
75f988242a preferences.pp for ubuntu maverick 2011-01-23 23:33:06 +01:00
nadir
3c0499b78d apt::custom_sources_template to deploy custom sources.list.d/xyz.list 2011-01-09 22:57:18 +01:00
intrigeri
d76f922dfb Make sources snippets world-readable.
Not doing this breaks big parts of functionality, such as aptitude why.
2011-01-08 19:39:10 +01:00
Micah Anderson
c5dc8ff5fc add -q to the apt-get invocation in upgrade_package.pp, also switch to using -y instead of --force-yes. this way we are acting in the same way as the dist_upgrade class 2010-12-18 15:47:11 -05:00
Micah Anderson
5fdadb955d switch aptitude to apt-get, since aptitude will sometimes automatically do things that are unrelated to the task at hand, such as deinstalling automatically installed packages, which can be undesirable behavior 2010-12-18 14:01:11 -05:00
intrigeri
575e4ab9cc Fix apt::upgrade_package when used multiple times. 2010-12-16 18:14:23 +01:00
intrigeri
bbe2c8aee9 New class: apt::dist_upgrade::initiator.
This implements the "update initiator" pattern suggested by
http://projects.puppetlabs.com/projects/puppet/wiki/Debian_Patterns.

This feature is useful when one does not want to setup a fully automated upgrade
process but still needs a way to manually trigger full upgrades of any number of
systems at scheduled times.
2010-12-16 13:03:08 +01:00
intrigeri
4765a02564 New class: apt::dist_upgrade. 2010-12-16 13:02:28 +01:00
intrigeri
2d4f6d3522 Fix 5237f9da. 2010-12-15 22:11:34 +01:00
intrigeri
7ffedbad6b Merge remote branch 'riseup/master' 2010-12-15 22:01:34 +01:00
Micah Anderson
5237f9dab0 change $listchanges_* to $apt_listchanges, not nice to clutter up the namespace like that 2010-12-15 14:49:34 -05:00
intrigeri
75cf15b7c7 Fix packages dependency. 2010-12-15 15:18:16 +01:00
intrigeri
a084ac642c Use line define instead of append_if_no_such_line.
The latter is only a wrapper around the former and it seems we want to remove
the latter from our shared common module.
2010-12-15 10:44:14 +01:00
intrigeri
a06bf5f71b apt::upgrade_package: explicitly depend on needed packages.
This define was previously broken unless dctrl-tools and apt-show-versions were
installed.
2010-12-15 10:00:47 +01:00
intrigeri
af8ecf1e9f Repair Exec['update_apt'] to run apt-get update when needed.
Move this Exec to a dedicated class that is not included by default i.e. we
default not to "apt-get update" on every Puppet run.

We now make use of this class in the apt::upgrade_package define to make sure
APT indexes are up-to-date before attempting package upgrades.

One may now use the following to ensure current packages are installed by
Package resources:

  include apt::update
  Package { require => Exec[apt_updated] }
2010-12-15 09:47:57 +01:00
intrigeri
4979889584 (ugly workaround warning) Update packages lists before upgrading a package.
... because Exec[update_apt] is currently never run since we set it refreshonly.
Better solutions are being thought of, but in the meantime the least we can do
is somehow repair apt::upgrade_package.
2010-12-14 22:04:05 +01:00
intrigeri
1ae3fdfeb5 Make consistent the use of absolute path to apt-get. 2010-12-14 21:56:36 +01:00
intrigeri
5846da98ce Factorize. 2010-12-14 21:39:50 +01:00
intrigeri
4625afacae apt::reboot_required_notify: take into account the random sleep time. 2010-12-13 10:08:47 +01:00
intrigeri
4195a91773 Merge remote branch 'riseup/master' 2010-12-13 09:54:37 +01:00
Micah Anderson
f855a5a0ad switch default frontend to 'mail' instead of pager, as most things are done non-interactively 2010-12-12 21:41:21 -05:00
intrigeri
4103a27054 Additionally use version number in Lenny default pinning.
Lenny's APT does not support pinning like this:

  Pin: release o=Debian,n=<%= codename %>

We therefore switched (in commit ef2ebdffd) to:

  Pin: release o=Debian,a=<%= release %>

With such a pinning setup, when Squeeze is released, systems using this module
with $apt_use_next_release set to true would immediately switch to prefer
packages from Squeeze. If an automated upgrade process is setup, they would be
automatically upgraded to Squeeze.

This does not sound safe to me, so let's use the release version number as an
additional selection criterion to prevent upgrades to Squeeze to happen behind
our back:

  Pin: release o=Debian,a=<%= release %>,v=<%= release_version %>*

Note that the trailing '*' is intentional and necessary to match stable
point-releases.
2010-12-12 09:57:42 +01:00
intrigeri
fad111e036 Allow running cron-apt more than once a day. 2010-12-11 15:17:41 +01:00
intrigeri
874da52745 New class: apt::reboot_required_notify
This class installs a daily cronjob that checks if a package upgrade
requires the system to be rebooted; if so, cron sends a notification
email to root.
2010-12-11 14:50:16 +01:00
Micah Anderson
9223dfc186 Merge remote branch 'lelutin/master' 2010-12-09 09:44:00 -05:00
Micah Anderson
d61a64b394 fix syntax error 2010-12-08 22:32:00 -05:00
Micah Anderson
8944374bf2 fix confusion over lsbrelease / lsbdistcodename 2010-12-08 22:27:13 -05:00
Micah Anderson
13bf7d0623 add apt-listchanges support. this is a nice compliment to using the upgrade_package functionality, because you get an email when the package has been upgraded. 2010-12-08 22:25:09 -05:00
Micah Anderson
fbb291ed19 add apticron support.
Why apticron, when we have cron-apt already? Some people have different preferences, we use apticron along with the upgrade_package functionality in this module. I know someone who uses cron-apt to run the upgrades, but apticron for notifications, because apticron's notifications are much nicer (cron-apt just gives you the output of apt-get upgrade)
2010-12-08 22:24:24 -05:00
Micah Anderson
d9ccf2a99b provide an "03clean" alias for the 03clean_vserver to satisfy dependencies 2010-12-08 09:57:02 -05:00
Micah Anderson
72bb7b5ccb fix typo 2010-12-08 00:02:15 -05:00
Micah Anderson
36c4873f87 multiple sources for templates are not allowed (see #1818), so revert it to a single source referenced by the README, and clarify the README to indicate how you can pass the preseed contents directly 2010-12-07 23:57:25 -05:00
Micah Anderson
ee21742cf8 change the name of the custom_keys exec to be "custom_keys" instead of using the alias metaparameter.
the reason for this change was because the Exec override was not able to find the exec through its alias
2010-12-07 23:06:11 -05:00
Micah Anderson
dd0552dce1 update apt::preseeded_package template sources to use $lsbdistcodename instead of $debian_release, also expand it to allow for site-apt sources 2010-12-07 23:04:46 -05:00
Micah Anderson
e15283b781 format standardization 2010-12-07 13:18:41 -05:00
Micah Anderson
bb03c32b45 switch the default $debian_url to use the Debian CDN mirror address.
The CDN checks your IP and uses the Max-Mind geoIP DB to determine your location and then uses your local country Debian Mirror, or if your local country doesn't have a debian mirror, it uses the local continent. It automatically checks and prunes dead mirrors. the technology for the Debian CDN setup is still improving, I believe that ASN-number associations are the next step to attempt to make more informed, finer-grained choices.

This is more useful than using ftp.debian.org because that is just a round-robin DNS entry that could get you any mirror anywhere.
2010-12-07 12:46:37 -05:00
Micah Anderson
2ee70ab5e0 Set dselect DSelect::Clean to 'pre-auto' by default for hosts that are vservers.
Before you only had the choice of setting a 03clean apt configuration for either
all hosts, or every single host. Setting it to have the recommended settings for
vservers for all hosts meant that you were setting it for non-vservers as well
as vservers. The other option you had was to set it per host. This was a bit
annoying if you have any more than one vserver because you would need to create
a 03clean for every single vserver guest.

This change auto-detects if the node is a vserver, and if it is it automatically
installs the 03clean_vserver file, with the recommended DSelect::Clean settings,
and allows you to override this for all of your vservers, or for specific hosts.
2010-12-07 12:20:14 -05:00
Gabriel Filion
52ebb41690 apt_conf: change mode to 644
Current mode (600) makes it impossible to use apt-cache to search for
package names and info, since it tries to read all configuration files
in /etc/apt/apt.conf.d before executing.

Change configuration file mode to 644 so that search tasks can be made
without root priviledge.
2010-11-29 13:37:53 -05:00
intrigeri
2276147cc0 Bugfix 2010-11-21 21:54:17 +01:00
intrigeri
10c7939f65 Merge remote branch 'immerda/master'.
Conflicts:
	README
	files/preferences
	templates/Debian/sources.list.deb-src.erb
	templates/Debian/sources.list.volatile.erb
	templates/Ubuntu/sources.list.backports.erb
	templates/Ubuntu/sources.list.deb-src.erb
2010-11-21 17:03:57 +01:00
intrigeri
3de76e7b05 Merge commit '92aa5a51e95d74604a40318558aa98f70fcf7720'.
A bunch of painlessly merged commits.

Conflicts:
	manifests/init.pp
2010-11-21 16:50:43 +01:00
intrigeri
9ab979897f Merge commit '3c88b19dd33b4da1f37e2c08c981ccbcbe5a45a8'.
Conflicts:
	manifests/init.pp
2010-11-21 16:44:05 +01:00
intrigeri
f22861e820 Merge commit '27d5808299045ebd6f428e7d8131d11d9ab37712'.
One more painless merge commit.

Conflicts:
	manifests/init.pp
2010-11-21 16:41:56 +01:00
intrigeri
d30069c178 Merge commit 'd97a49b7b2c020c2c43df6524236f50a421789ee'.
Going on merging immerda changes.

Incompatible change: I do prefer my own generic apt/preferences template to
shipping a static file that only supports Lenny. My own template supports
security, backports, volatile, next release etc.

Conflicts:
	files/preferences
	manifests/init.pp
	manifests/preferences.pp
2010-11-21 16:31:42 +01:00
intrigeri
ee6d13d1e4 Merge commit 'ac76a5d52df78aec919f08334ca5b140902a9298'
(Starting to merge changes from immerda.)

Conflicts:
	manifests/default_sources_list.pp
	manifests/init.pp
2010-11-21 16:24:57 +01:00
intrigeri
06a2957f9f Do not refresh APT lists on every run.
Let's set refreshonly on the 'update_apt' Exec (aliased to 'apt_updated')
instead of removing it for backward compatibility: it may be in use at some
places to trigger updates.
2010-11-10 14:44:01 +01:00
intrigeri
2cd9496999 Merge remote branch 'nadir/master'
Conflicts:
	README
	manifests/custom_sources.pp
	manifests/default_preferences.pp
	manifests/init.pp
	manifests/unattended_upgrades.pp
	templates/Debian/sources.list.volatile.erb
2010-11-10 10:19:06 +01:00
mh
90c45cfe44 put the file at the right place & fix typos 2010-10-28 22:05:37 +02:00
Gabriel Filion
92aa5a51e9 Ensure presence of sources.list.d and watch it
Add a file resource on the apt/sources.list.d directory to ensure that
it is created as a directory and watch it for modifications to
automatically refresh the apt cache.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 14:15:52 -04:00
Gabriel Filion
aaf3bd6adb Remove $apt_unattended_upgrades
Unattended upgrades are not always necessary. Including the
apt::unattended_upgrades class through the main apt class is not
appropriate. It is better to make nodes include the
apt::unattended_upgrades class explicitly.

Remove the $apt_unattended_upgrades variable along with the include in
the 'apt' class.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 14:15:52 -04:00
Gabriel Filion
4ebb7d463e Fix apt::preferences::absent
Currently, setting the $custom_preferences variable to false fails
because of the /etc/apt/preferences concatenated_file being re-defined.

Fix this by setting dependencies on the resource only when we expect to
create the /etc/apt/preferences file. Also, since there is no "ensure"
parameter to concatenated_file, use a simple file resource to ensure
that it is removed.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 14:15:12 -04:00
Gabriel Filion
26714ae4d2 Include the protocol in the proxy URL
The current proxy_client template makes it possible to communicate with
the proxy only via HTTP. Add the protocol to the variable so that it's
possible to change the protocol.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 14:14:26 -04:00
Gabriel Filion
e2578c3b98 Add $main_apt_source
Currently, it's either we use the default source that's hardcoded in the
sources.list template or we redefine entirely this template.

Make it easier to just change the URL of the apt source while using the
rest of the default template by adding a $main_apt_source variable.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 14:12:18 -04:00
Gabriel Filion
3c88b19dd3 Remove the now unused $apt_clean variable
This variable was deprecated in favor of using a list of file sources.
to change the value of the 'clean' property, you can either define a
file '03clean' in a site-apt module, or a per-host '$fqdn/03clean' file
in the same site-apt module.

Also, move the moduledir stuff below nearer to where it's actually used.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 11:44:41 -04:00
Gabriel Filion
27d5808299 rename things for easier understanding
remove the use of _snippet in names (except for preferences_snippet) so
that they represent directly a resource name.

rename custom_sources_template to sources_list.

modify sources_list to make it more flexible (gives the opportunity to
provide sources or content). this changes its behaviour in that the name
is now the name of the file in sources.list.d

rename proxy-client to proxy_client to use the same standard for its
name as the other classes.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 01:44:04 -04:00
Gabriel Filion
d97a49b7b2 refactor: simplify and remove inline content
Simplifications: make apt_conf_snippet repeat less code, make code that
generates sources.list more concise.

Remove all inline content in favor of templates and static files.
The ability to include sources for static files was needed for
the main 'preferences' file, so it was added to the preferences_snippet
define.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 00:14:33 -04:00
Gabriel Filion
ac76a5d52d Add apt_conf_snippet and use it where possible
With the new define, it's easy to add an apt.conf snippet in apt.conf.d
It accepts either 'sources' to get a static file or 'content' to define
content inline or with the help of a template.

Put it to use where we create files in apt.conf.d

Finally, fix the dependancy to the apt_config file (however, I don't see
the need for this dependancy)

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-24 09:17:09 -04:00
Gabriel Filion
e22029433a Move default_sources_list into apt class
The contents of the file default_sources_list.pp is used in only one
place. Remove the file and move its contents inside the apt class in
order to have one less useless depth level.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-24 07:37:29 -04:00
nadir
5bf01f148d notify => Exec['refresh_apt'] 2010-10-22 19:18:12 +02:00
nadir
851d20a7b6 merged with immerda/master 2010-10-22 19:17:57 +02:00
mh
e2ac1b3d8d Merge remote branch 'lelutin/master'
Integrate no custom preference into our new
way to manage the preferences.

Conflicts:
	README
	manifests/default_preferences.pp
	manifests/init.pp
2010-10-21 01:59:41 +02:00
Gabriel Filion
4dbcd09281 Make it possible to ensure preferences is absent
The current code makes it mandatory to have a file /etc/apt/preferences
present. In the event that this file is empty or contains a space,
apt-get update cannot execute.

Add a case with the special value "false" that ensures the file does not
exist.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-18 01:51:16 -04:00
Gabriel Filion
9736578481 Remove unnecessary exec
When $custom_key_dir has not been assigned any value, a useless exec of
/bin/true is run. Remove this by using 'if' instead of 'case'.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-18 01:43:24 -04:00
Gabriel Filion
8175bff077 Add a proxy-client class
The module currently doesn't have a handy way of making a server get its
packages via a proxy. Add a "proxy-client" class that makes this easy.

$apt_proxy declares the proxy server's fqdn
$apt_proxy_port declares the port used for connection

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-17 20:42:09 -04:00
Gabriel Filion
ebcda455df Make $apt_clean effective in all cases
The file "/etc/apt/apt.conf.d/from_puppet" is currently only defined
when $custom_sources_list is not used (it is declared in
default_preferences).

Bring this file up in the apt class so that using custom sources doesn't
remove its addition.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-17 20:36:45 -04:00
Gabriel Filion
296593bcbd Merge remote branch 'riseup/master'
Conflicts:
	manifests/init.pp
2010-10-17 20:35:35 -04:00
intrigeri
c43bfac6b8 Ensure apt-listbugs is absent in dist-upgrade mode.
Else it will crash automatic upgrades.
2010-10-17 17:44:19 +02:00
intrigeri
8a9bea09e9 Need to update APT lists after apt.conf.d changes. 2010-10-17 16:47:38 +02:00
intrigeri
e0e1b80c4e No need to update APT lists when pinning changes (bis). 2010-10-17 16:46:55 +02:00
intrigeri
3f20c7823e Fix one more relationship. 2010-10-17 16:43:56 +02:00
intrigeri
20b67058ab No need to refresh APT lists after changes to pinning preferences. 2010-10-17 16:43:04 +02:00
intrigeri
487855daf2 Fix indentation. 2010-10-17 16:42:15 +02:00
intrigeri
7b9ba44340 Fix relationships. 2010-10-17 16:41:40 +02:00
mh
e19c94dcd2 minor improvements, especially do not refresh apt every run 2010-10-17 15:18:08 +02:00
mh
b497ed88ef empty line between snippets 2010-10-17 14:40:27 +02:00
mh
68842b2f96 fix header file 2010-10-17 14:36:28 +02:00
mh
80ad2d086e fix classname 2010-10-17 14:29:01 +02:00
mh
b989192dfd fix modules directory stuff 2010-10-17 14:27:27 +02:00
mh
822d482f4d improve prefrences snippet 2010-10-17 14:13:02 +02:00
mh
4d28e6668f introduce preferences snippet
Now, we have the possibility to externally add snippes, so that
we can preferences for packages that are for example only in backports
or unstable.
2010-10-17 13:58:59 +02:00
intrigeri
e42b54af40 Support choosing a custom Ubuntu mirror. 2010-10-17 10:51:06 +02:00
intrigeri
2d75cda2db Use append_if_no_such_line instead of line. 2010-10-17 02:54:20 +02:00
intrigeri
7a0dc9a37a Migrate config file to line-editing.
This allows other modules to add lines there too.
2010-10-17 02:30:28 +02:00
intrigeri
8ce3c34be5 Backward compatibility: ensure old renamed file is absent. 2010-10-17 02:13:59 +02:00
intrigeri
e3c8c1b6af Bring /etc/apt/apt.conf.d/99from_puppet to init.
APT configuration has (unfortunately) nothing to do with APT preferences.
2010-10-17 02:11:41 +02:00