Puppet Class: nginx::package

Inherits:
::nginx::params
Defined in:
manifests/package.pp

Overview

Class: nginx::package

This module manages NGINX package installation

Parameters:

There are no default parameters for this class.

Actions:

Requires:

Sample Usage:

This class file is not called directly

Parameters:

  • package_name (Any) (defaults to: $::nginx::params::package_name)
  • package_source (Any) (defaults to: 'nginx')
  • package_ensure (Any) (defaults to: 'present')
  • package_flavor (Any) (defaults to: undef)
  • manage_repo (Any) (defaults to: $::nginx::params::manage_repo)


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'manifests/package.pp', line 16

class nginx::package(
  $package_name   = $::nginx::params::package_name,
  $package_source = 'nginx',
  $package_ensure = 'present',
  $package_flavor = undef,
  $manage_repo    = $::nginx::params::manage_repo,
) inherits ::nginx::params {

  anchor { 'nginx::package::begin': }
  anchor { 'nginx::package::end': }

  case $::osfamily {
    'redhat': {
      class { '::nginx::package::redhat':
        manage_repo    => $manage_repo,
        package_source => $package_source,
        package_ensure => $package_ensure,
        package_name   => $package_name,
        require        => Anchor['nginx::package::begin'],
        before         => Anchor['nginx::package::end'],
      }
    }
    'debian': {
      class { '::nginx::package::debian':
        package_name   => $package_name,
        package_source => $package_source,
        package_ensure => $package_ensure,
        manage_repo    => $manage_repo,
        require        => Anchor['nginx::package::begin'],
        before         => Anchor['nginx::package::end'],
      }
    }
    'Solaris': {
      # $package_name needs to be specified. SFEnginx,CSWnginx depending on
      # where you get it.
      if $package_name == undef {
        fail('You must supply a value for $package_name on Solaris')
      }

      package { 'nginx':
        ensure => $package_ensure,
        name   => $package_name,
        source => $package_source,
      }
    }
    'OpenBSD': {
      package { $package_name:
        ensure => $package_ensure,
        flavor => $package_flavor,
      }
    }
    default: {
      package { $package_name:
        ensure => $package_ensure,
      }
    }
  }
}