Defined Type: apt::conf

Defined in:
modules/apt/manifests/conf.pp

Overview

Parameters:

  • key (String)
  • value (Variant[String, Integer, Boolean])
  • priority (Variant[String, Integer]) (defaults to: '20')
  • ensure (Enum['present', 'absent']) (defaults to: present)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'modules/apt/manifests/conf.pp', line 1

define apt::conf(
    String $key,
    Variant[String, Integer, Boolean] $value,
    Variant[String, Integer] $priority = '20',
    Enum['present', 'absent'] $ensure  = present,
) {
    if $value !~ Integer {
      $content = "${key} \"${value}\";\n"
    } else {
      $content = "${key} ${value};\n"
    }

    file { "/etc/apt/apt.conf.d/${priority}${name}":
        ensure  => $ensure,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => $content,
        notify  => Exec['apt-get update'],
    }
}