-package{ 'glusterfs-server':
+package { 'glusterfs-server':
install_options => 'build-dep',
}
package { 'debian-keyring':
- ensure => present
+ ensure => present,
}
package { 'debian-archive-keyring':
- ensure => present
+ ensure => present,
}
apt::source { 'debian_testing':
package { 'debian-keyring':
- ensure => present
+ ensure => present,
}
package { 'debian-archive-keyring':
- ensure => present
+ ensure => present,
}
apt::source { 'debian_unstable':
#Note: This is generally a bad idea. You should not disable verifying repository signatures.
apt::conf { 'unauth':
priority => 99,
- content => 'APT::Get::AllowUnauthenticated 1;'
+ content => 'APT::Get::AllowUnauthenticated 1;',
}
class { 'apt': }
# Example declaration of an Apt PPA
-apt::ppa{ 'ppa:openstack-ppa/bleeding-edge': }
+apt::ppa { 'ppa:openstack-ppa/bleeding-edge': }
Optional[String] $release = undef,
Optional[String] $repos = undef,
Optional[Variant[String, Hash]] $key = undef,
- Optional[Variant[Integer, String, Hash]] $pin = 200,
- Optional[Variant[Hash]] $include = {},
+ Variant[Integer, String, Hash] $pin = 200,
+ Variant[Hash] $include = {},
) {
include apt
Variant[String, Integer] $priority = 50,
Optional[Boolean] $notify_update = undef,
) {
-
unless $ensure == 'absent' {
unless $content {
fail('Need to pass in content parameter')
Hash $settings = $apt::params::settings,
Boolean $manage_auth_conf = $apt::params::manage_auth_conf,
Array[Apt::Auth_conf_entry]
- $auth_conf_entries = $apt::params::auth_conf_entries,
+ $auth_conf_entries = $apt::params::auth_conf_entries,
String $auth_conf_owner = $apt::params::auth_conf_owner,
String $root = $apt::params::root,
String $sources_list = $apt::params::sources_list,
}
) inherits apt::params {
-
if $facts['os']['family'] != 'Debian' {
fail('This module only works on Debian or derivatives like Ubuntu')
}
$_perhost = {}
}
- $_proxy = merge($apt::proxy_defaults, $proxy, { 'perhost' => $_perhost } )
+ $_proxy = merge($apt::proxy_defaults, $proxy, { 'perhost' => $_perhost })
$confheadertmp = epp('apt/_conf_header.epp')
- $proxytmp = epp('apt/proxy.epp', {'proxies' => $_proxy})
+ $proxytmp = epp('apt/proxy.epp', { 'proxies' => $_proxy })
$updatestamptmp = epp('apt/15update-stamp.epp')
if $_proxy['ensure'] == 'absent' or $_proxy['host'] {
true => nil,
default => undef,
}
- }
- else
- {
+ } else {
$sources_list_ensure = $_purge['sources.list'] ? {
true => file,
default => file,
Boolean $weak_ssl = false,
Optional[String] $options = $::apt::key_options,
) {
-
case $ensure {
/^(refreshed|present)$/: {
- if defined(Anchor["apt_key ${id} absent"]){
+ if defined(Anchor["apt_key ${id} absent"]) {
fail("key with id ${id} already ensured as absent")
}
Apt::Key<| title == $title |>
}
}
- default: { }
+ default: {
+ # Nothing in here
+ }
}
}
}
absent: {
- if defined(Anchor["apt_key ${id} present"]){
+ if defined(Anchor["apt_key ${id} present"]) {
fail("key with id ${id} already ensured as present")
}
- if !defined(Anchor["apt_key ${id} absent"]){
+ if !defined(Anchor["apt_key ${id} absent"]) {
apt_key { $title:
ensure => $ensure,
id => $id,
unless => $unless_cmd,
}
}
-
# @api private
#
class apt::params {
-
if $facts['os']['family'] != 'Debian' {
fail('This module only works on Debian or derivatives like Ubuntu')
}
'list' => {
'path' => $sources_list_d,
'ext' => '.list',
- }
+ },
}
$update_defaults = {
'src' => false,
}
- case $facts['os']['name']{
+ case $facts['os']['name'] {
'Debian': {
$backports = {
'location' => 'http://deb.debian.org/debian',
# @param label
# Names the label of the packages in the directory tree of the Release file.
#
-define apt::pin(
- Optional[Enum['file', 'present', 'absent']] $ensure = present,
+define apt::pin (
+ Enum['file', 'present', 'absent'] $ensure = present,
Optional[String] $explanation = undef,
Variant[Integer] $order = 50,
Variant[String, Array] $packages = '*',
Optional[String] $originator = '', # o=
Optional[String] $label = '', # l=
) {
-
if $explanation {
$_explanation = $explanation
} else {
# @param package_manage
# Specifies whether Puppet should manage the package that provides `apt-add-repository`.
#
-define apt::ppa(
+define apt::ppa (
String $ensure = 'present',
Optional[String] $options = $::apt::ppa_options,
Optional[String] $release = fact('os.distro.codename'),
#
define apt::setting (
Variant[String, Integer, Array] $priority = 50,
- Optional[Enum['file', 'present', 'absent']] $ensure = file,
+ Enum['file', 'present', 'absent'] $ensure = file,
Optional[String] $source = undef,
Optional[String] $content = undef,
Boolean $notify_update = true,
) {
-
if $content and $source {
fail('apt::setting cannot have both content and source')
}
# @param notify_update
# Specifies whether to trigger an `apt-get update` run.
#
-define apt::source(
+define apt::source (
Optional[String] $location = undef,
String $comment = $name,
String $ensure = present,
Optional[String] $release = undef,
String $repos = 'main',
- Optional[Variant[Hash]] $include = {},
+ Variant[Hash] $include = {},
Optional[Variant[String, Hash]] $key = undef,
Optional[Stdlib::AbsolutePath] $keyring = undef,
Optional[Variant[Hash, Numeric, String]] $pin = undef,
Boolean $allow_insecure = false,
Boolean $notify_update = true,
) {
-
include ::apt
$_before = Apt::Setting["list-${title}"]
$sourcelist = epp('apt/source.list.epp', {
'comment' => $comment,
'includes' => $includes,
- 'options' => delete_undef_values({
- 'arch' => $architecture,
- 'trusted' => $allow_unsigned ? {true => 'yes', false => undef},
- 'allow-insecure' => $allow_insecure ? {true => 'yes', false => undef},
- 'signed-by' => $keyring,
- }),
+ 'options' => delete_undef_values( {
+ 'arch' => $architecture,
+ 'trusted' => $allow_unsigned ? { true => 'yes', false => undef },
+ 'allow-insecure' => $allow_insecure ? { true => 'yes', false => undef },
+ 'signed-by' => $keyring,
+ },
+ ),
'location' => $_location,
'release' => $_release,
'repos' => $repos,
refreshonly => $_refresh,
timeout => $::apt::_update['timeout'],
tries => $::apt::_update['tries'],
- try_sleep => 1
+ try_sleep => 1,
}
}