Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing examples for 'removed' functionality #483

Merged
merged 7 commits into from
Mar 27, 2015
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion examples/backports.pp
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
# TODO
$location = $::apt::distcodename ? {
'squeeze' => 'http://backports.debian.org/debian-backports',
'wheezy' => 'http://ftp.debian.org/debian/',
default => 'http://us.archive.ubuntu.com/ubuntu',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use archive.ubuntu.com, without the us. prefix. That should give people a geographically more desirable mirror.

}

if $::apt::distid == 'debian' {
$repos = 'main contrib non-free'
$key = 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553'
$release = $::apt::distcodename
} else {
$repos = 'main universe multiverse restricted'
$key = '630239CC130E1A7FD81A27B140976EAF437D05B5'
$release = $::apt::distcodename
}

# set up the actual backports
apt::pin { 'backports':
before => Apt::Source['backports'],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed. pin uses setting which by default will notify apt::update. The order here isn't really important. Doesn't really hurt either though. Arguably we should keep it because a lot of people do Apt::Source <||> -> Package <||> but we would also need all the pins to be in place too for that to work out correctly.

The default should more likely be something like:

Apt::Setting <||> -> Package <||>
Apt::Key <||> -> Package <||>

setting will match source, conf and pin too since they use that underneath.

We need to put something about this in the docs, that people need to make sure to have apt::pin's in place before they install packages otherwise they risk package installation to not be configured correctly.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm almost starting to consider pulling backports back in, just not providing a pin facility and letting people always manage that separately. What do you think?

Maybe have a pin parameter that allows them to pass in the reference to a pin?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an aside, pin's are immediately reflected in apt, they do not require an apt-get update so we should alter apt::pin to not notify apt-get update as to not needlessly refresh things on a run.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erm, I mean, I think the reason we pulled this out in the first place is it's really just wrapping an apt::source and an apt::pin. The logic above that is just figuring things out based on your env. Idunno. No strong feelings either way 😐

release => "${release}-backports",
priority => 200,
}

apt::source { 'backports':
location => $location,
release => "${release}-backports",
repos => $repos,
key => {
id => $key,
server => 'pgp.mit.edu',
},
}
5 changes: 5 additions & 0 deletions examples/disable_keys.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Note: This is generally a bad idea. You should not disable keys.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not disabling keys, disabling verifying repository signatures / allowing installation of packages from unsigned / unverified sources.

apt::conf { 'unauth':
priority => 99,
content => 'APT::Get::AllowUnauthenticated 1;'
}
4 changes: 4 additions & 0 deletions examples/fancy_progress.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apt::conf { 'progressbar':
priority => 99,
content => 'Dpkg::Progress-Fancy "1";',
}
30 changes: 28 additions & 2 deletions examples/force.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# force.pp
# TODO: Update
#if you need to specify a release
$rel_string = "-t ${release}"
#else
$rel_string = ''

#if you need to specify a version
$ensure = $version
#else
$ensure = installed

#if overwrite existing cfg files
$config_files = '-o Dpkg::Options::="--force-confnew"'
#elsif force use of old files
$config_files = '-o Dpkg::Options::="--force-confold"'
#elsif update only unchanged files
$config_files = '-o Dpkg::Options::="--force-confdef"'
#else
$config_files = ''

#if install missing configuration files for the package
$config_missing = '-o Dpkg::Options::="--force-confmiss"'
#else
$config_missing = ''

package { $package:
ensure => $ensure,
install_options => "${config_files} ${config_missing} ${release_string}",
}
1 change: 0 additions & 1 deletion examples/proxy.pp

This file was deleted.