Commit graph

188 commits

Author SHA1 Message Date
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
Micah Anderson
6596641bb1 minor README fixups 2010-11-24 14:24:49 -05:00
intrigeri
2276147cc0 Bugfix 2010-11-21 21:54:17 +01:00
intrigeri
56340b780e Fix typo and rephrase. 2010-11-21 17:10:20 +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
f25a8a9109 Merge commit 'e2578c3b9820e9ff17f8a8881b8b22b5e241ee21'.
My branch already has support for defining custom APT mirrors location.
See $apt_debian_url, $apt_security_url, $apt_backports_url, $apt_volatile_url.
=> Discarding the addition of $main_apt_source.
2010-11-21 16:47:15 +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
71d42350d1 Merge commit '1b0bc415977c1c8b49390e0cdb1361769e0fdbae'.
Merging one more commit.

Conflicts:
	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 16:38:50 +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
5d54dfdd88 unfortunately no comments are allowed in that file 2010-10-28 22:44:13 +02:00
mh
ebb46ca200 fixing comments
apt preferences actually want // to comment, while sources are fine
to be commented with # ...
2010-10-28 22:27:28 +02:00
mh
4cff5ef63e Revert "remove comments as lenny apt doesn't like them"
This reverts commit 5de6431b89.

Actually the comments are just the wrong way...
2010-10-28 22:25:06 +02:00
mh
5de6431b89 remove comments as lenny apt doesn't like them
I got errors like:

E: Syntax error /etc/apt/apt.conf.d/03clean:4: Extra junk after value

Removing these comments fixed these problems.
2010-10-28 22:18:30 +02:00
mh
90c45cfe44 put the file at the right place & fix typos 2010-10-28 22:05:37 +02:00
Gabriel Filion
b5c504e19e Correct some errors in the README
Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 14:36:19 -04:00
Gabriel Filion
bd3b46ac07 Change "brought to you" into "managed" in headers
File headers are there to indicate that the files should not be touched
directly on the server. By changing the first sentence to "This file is
managed by Puppet", we reinforce the idea that it is already taken care
of by something else.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 14:19:58 -04:00
Gabriel Filion
8efc70cab8 Update the README
Include new classes and defines and move things around for a little bit
of consistency.
Also remove the now unused variables.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 14:19:58 -04: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
1b0bc41597 Add file headers for awareness of puppet presence
Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-10-25 01:13:44 -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