Puppet Class: mongodb::globals

Inherited by:
mongodb::client
mongodb::mongos
mongodb::server
Defined in:
manifests/globals.pp

Summary

Class for setting cross-class global overrides.

Overview

Examples:

Use a specific MongoDB version to install from the community repository.


class {'mongodb::globals':
  manage_package_repo => true,
  repo_version        => '6.0',
}
-> class {'mongodb::client': }
-> class {'mongodb::server': }

Use a specific MongoDB version to install from the enterprise repository.


class {'mongodb::globals':
  manage_package_repo => true,
  repo_version        => '6.0',
  use_enterprise_repo => true,
}
-> class {'mongodb::client': }
-> class {'mongodb::server': }

Use a custom MongoDB apt repository.


class {'mongodb::globals':
  manage_package_repo => true,
  repo_location       => 'https://example.com/repo',
  keyring_location    => 'https://example.com/keyring.asc'
}
-> class {'mongodb::client': }
-> class {'mongodb::server': }

To disable managing of repository, but still enable managing packages.


class {'mongodb::globals':
  manage_package_repo => false,
}
-> class {'mongodb::server': }
-> class {'mongodb::client': }

Parameters:

  • version (Optional[String[1]]) (defaults to: undef)

    The version of MonogDB to install/manage. If not specified, the module will ensure packages with ‘present`.

  • client_version (Optional[String[1]]) (defaults to: undef)

    The version of MongoDB Shell to install/manage. If not specified, the module will ensure packages with ‘present`.

  • manage_package_repo (Boolean) (defaults to: true)

    Whether to manage MongoDB software repository.

  • repo_version (String[1]) (defaults to: '5.0')

    The version of the package repo.

  • use_enterprise_repo (Boolean) (defaults to: false)

    When manage_package_repo is set to true, this setting indicates if it will use the Community Edition (false, the default) or the Enterprise one (true).

  • repo_location (Optional[String]) (defaults to: undef)

    This setting can be used to override the default MongoDB repository location. If not specified, the module will use the default repository for your OS distro.

  • repo_proxy (Optional[String]) (defaults to: undef)

    This will allow you to set a proxy for your repository in case you are behind a corporate firewall. Currently this is only supported with yum repositories

  • keyring_location (Optional[String]) (defaults to: undef)

    When ‘repo_location` is used for an apt repository this setting can be used for the keyring file to download.

  • proxy_username (Optional[String]) (defaults to: undef)

    This sets the username for the proxyserver, should authentication be required.

  • proxy_password (Optional[String]) (defaults to: undef)

    This sets the password for the proxyserver, should authentication be required



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'manifests/globals.pp', line 76

class mongodb::globals (
  Optional[String[1]] $version        = undef,
  Optional[String[1]] $client_version = undef,
  Boolean $manage_package_repo        = true,
  String[1] $repo_version             = '5.0',
  Boolean $use_enterprise_repo        = false,
  Optional[String] $repo_location     = undef,
  Optional[String] $keyring_location  = undef,
  Optional[String] $repo_proxy        = undef,
  Optional[String] $proxy_username    = undef,
  Optional[String] $proxy_password    = undef,
) {
  if $use_enterprise_repo {
    $edition = 'enterprise'
  } else {
    $edition = 'org'
  }

  # Setup of the repo only makes sense globally, so we are doing it here.
  if $manage_package_repo {
    class { 'mongodb::repo':
      ensure              => present,
      version             => $repo_version,
      use_enterprise_repo => $use_enterprise_repo,
      repo_location       => $repo_location,
      keyring_location    => $keyring_location,
      proxy               => $repo_proxy,
      proxy_username      => $proxy_username,
      proxy_password      => $proxy_password,
    }
  }
}