apt: Parameterize apt::sources
This commit is contained in:
parent
7f28f80995
commit
a7f94e1060
2 changed files with 28 additions and 68 deletions
|
@ -75,31 +75,35 @@ define apt::ppa($ensure = "present") {
|
|||
|
||||
# Configure /etc/apt/sources.list
|
||||
#
|
||||
# === Global variables
|
||||
# === Parameters
|
||||
#
|
||||
# $apt_archive_url:
|
||||
# Base URL of archive repository. Defaults to http://archive.ubuntu.com/ubuntu/.
|
||||
# $apt_security_url:
|
||||
# Base URL of security repository. Defaults to http://security.ubuntu.com/ubuntu/.
|
||||
# $archive_url:
|
||||
# Base URL of archive repository.
|
||||
# Defaults to "mirror://mirrors.ubuntu.com/mirrors.txt".
|
||||
#
|
||||
class apt::sources {
|
||||
# $security_url:
|
||||
# Base URL of security repository.
|
||||
# Defaults to "mirror://mirrors.ubuntu.com/mirrors.txt".
|
||||
#
|
||||
# $backports:
|
||||
# Boolean for enabling the backports repositories.
|
||||
# Defaults to true.
|
||||
#
|
||||
class apt::sources(
|
||||
$archive_url="mirror://mirrors.ubuntu.com/mirrors.txt",
|
||||
$security_url="mirror://mirrors.ubuntu.com/mirrors.txt",
|
||||
$backports=true
|
||||
) {
|
||||
|
||||
tag("bootstrap")
|
||||
|
||||
include apt
|
||||
|
||||
if !$apt_archive_url {
|
||||
$apt_archive_url = "http://archive.ubuntu.com/ubuntu/"
|
||||
}
|
||||
if !$apt_security_url {
|
||||
$apt_security_url = "http://security.ubuntu.com/ubuntu/"
|
||||
}
|
||||
|
||||
file { "/etc/apt/sources.list":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
owner => root,
|
||||
group => root,
|
||||
owner => "root",
|
||||
group => "root",
|
||||
content => template("apt/sources.list.erb"),
|
||||
notify => Exec["apt-get-update"],
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue