Puppet Class: mongodb::repo::apt

Inherits:
mongodb::repo
Defined in:
manifests/repo/apt.pp

Overview

PRIVATE CLASS: do not use directly



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'manifests/repo/apt.pp', line 2

class mongodb::repo::apt inherits mongodb::repo {
  # we try to follow/reproduce the instruction
  # from http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

  include apt

  if($mongodb::repo::ensure == 'present' or $mongodb::repo::ensure == true) {
    apt::source { 'mongodb':
      location => $mongodb::repo::location,
      release  => $mongodb::repo::release,
      repos    => $mongodb::repo::repos,
      key      => {
        'id'      => $mongodb::repo::key,
        'server'  => $mongodb::repo::key_server,
        'options' => $mongodb::repo::aptkey_options,
      },
    }

    Apt::Source['mongodb'] -> Class['apt::update'] -> Package<| tag == 'mongodb_package' |>
  }
  else {
    apt::source { 'mongodb':
      ensure => absent,
    }
  }
}