Puppet Class: samba

Defined in:
manifests/init.pp

Overview

Class: samba

Main class that includes all other classes for the samba module.

Parameters:

  • config_dir (Stdlib::Absolutepath) (defaults to: '/etc/samba')

    Specifies the configuration directory.

  • config_file (String) (defaults to: 'smb.conf')

    Specifies the name of the configuraiton file.

  • global_config (Hash) (defaults to: {})

    Hash containing the global/special section configuration parameters.

  • global_config_template (String) (defaults to: 'samba/global.erb')

    Specifies the template to use for the samba global/special sections.

  • package_ensure (String) (defaults to: 'present')

    Whether to install the samba package, and/or what version. Values: 'present', 'latest', or a specific version number.

  • package_name (String) (defaults to: 'samba')

    Specifies the name of the package to install.

  • service_nmb_enable (Boolean) (defaults to: false)

    Whether to enable the nmb service at boot.

  • service_nmb_ensure (Enum['running', 'stopped']) (defaults to: 'stopped')

    Whether the nmb service should be running.

  • service_nmb_name (String) (defaults to: 'nmb')

    Specifies the name of the service to manage.

  • service_smb_enable (Boolean) (defaults to: true)

    Whether to enable the smb service at boot.

  • service_smb_ensure (Enum['running', 'stopped']) (defaults to: 'running')

    Whether the smb service should be running.

  • service_smb_name (String) (defaults to: 'smb')

    Specifies the name of the service to manage.

  • shares_definitions (Hash) (defaults to: {})

    Hash containing the shares to be created.

  • shares_template (String) (defaults to: 'samba/shares.erb')

    Specifies the template to use to construct the shares concat fragment.



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
# File 'manifests/init.pp', line 21

class samba (
  Stdlib::Absolutepath       $config_dir             = '/etc/samba',
  String                     $config_file            = 'smb.conf',
  Hash                       $global_config          = {},
  String                     $global_config_template = 'samba/global.erb',
  String                     $package_ensure         = 'present',
  String                     $package_name           = 'samba',
  Boolean                    $service_nmb_enable     = false,
  Enum['running', 'stopped'] $service_nmb_ensure     = 'stopped',
  String                     $service_nmb_name       = 'nmb',
  Boolean                    $service_smb_enable     = true,
  Enum['running', 'stopped'] $service_smb_ensure     = 'running',
  String                     $service_smb_name       = 'smb',
  Hash                       $shares_definitions     = {},
  String                     $shares_template        = 'samba/shares.erb',
  ) {
  case $::operatingsystem {
    'RedHat', 'CentOS': {
      contain samba::install
      contain samba::config
      contain samba::service

      Class['samba::install']
      -> Class['samba::config']
      ~> Class['samba::service']
    }
    default: {
      fail("${::operatingsystem} not supported")
    }
  }
}