Puppet Class: mofed

Defined in:
manifests/init.pp

Summary

Manage Mellanox OFED

Overview

Examples:

Basic usage using local yum repo for MOFED

class { 'mofed':
  repo_baseurl => 'http://example.com/mlnx/$releasever/3.4-2.0.0.0-rhel7.3/'
  repo_gpgkey  => 'http://example.com/mlnx/$releasever/3.4-2.0.0.0-rhel7.3/RPM-GPG-KEY-Mellanox',
}

Parameters:

  • manage_repo (Boolean) (defaults to: true)

    Boolean to set if MOFED repo should be managed

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

    The baseurl of the yumrepo resource

  • repo_gpgcheck (Enum['1','0']) (defaults to: '1')

    The gpgcheck of the yumrepo resource

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

    The gpgkey of the yumrepo resource

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

    The exclude of the yumrepo resource

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

    The priority of the yumrepo resource

  • manage_packages (Boolean) (defaults to: true)

    Boolean to determine if packages should be managed

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

    The package ensure property

  • package_name (String) (defaults to: 'mlnx-ofed-basic')

    The MOFED package name to install

  • extra_packages (Optional[Array]) (defaults to: undef)

    An array of additional packages to install

  • extra_packages_hiera_merge (Boolean) (defaults to: false)

    Boolean that sets if extra_packages should have values merged from hiera

  • manage_service (Boolean) (defaults to: true)

    Boolean that determines if the openibd service should be managed

  • restart_service (Boolean) (defaults to: false)

    Boolean that sets of openibd should be restarted

  • openibd_service_name (String) (defaults to: 'openibd')

    Name of the openibd service

  • openibd_service_ensure (String) (defaults to: 'running')

    openibd service ensure property

  • openibd_service_enable (Boolean) (defaults to: true)

    openibd service enable property

  • openibd_service_hasstatus (Boolean) (defaults to: true)

    openibd service hasstatus property

  • openibd_service_hasrestart (Boolean) (defaults to: true)

    openibd service hasrestart property

  • manage_config (Boolean) (defaults to: true)

    Boolean that sets if configs should be managed

  • openib_config_path (Stdlib::Absolutepath) (defaults to: '/etc/infiniband/openib.conf')

    Path to openib.conf

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

    Hash of shellvar resources

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

    Hash of mofed::interface resources



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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
# File 'manifests/init.pp', line 54

class mofed (
  Boolean $manage_repo                      = true,
  Optional[String] $repo_baseurl            = undef,
  Enum['1','0'] $repo_gpgcheck              = '1',
  Optional[String] $repo_gpgkey             = undef,
  Optional[String] $repo_exclude            = undef,
  Optional[String] $repo_priority           = undef,
  Boolean $manage_packages                  = true,
  String $package_ensure                    = 'present',
  String $package_name                      = 'mlnx-ofed-basic',
  Optional[Array] $extra_packages           = undef,
  Boolean $extra_packages_hiera_merge       = false,
  Boolean $manage_service                   = true,
  Boolean $restart_service                  = false,
  String $openibd_service_name              = 'openibd',
  String $openibd_service_ensure            = 'running',
  Boolean $openibd_service_enable           = true,
  Boolean $openibd_service_hasstatus        = true,
  Boolean $openibd_service_hasrestart       = true,
  Boolean $manage_config                    = true,
  Stdlib::Absolutepath $openib_config_path  = '/etc/infiniband/openib.conf',
  Hash $openib_shellvars                    = {},
  Hash $interfaces                          = {}
) {

  $osfamily = $facts.dig('os', 'family')
  $osmajor = $facts.dig('os', 'release', 'major')
  $supported = ['RedHat-6','RedHat-7','RedHat-8']
  $os = "${osfamily}-${osmajor}"
  if ! ($os in $supported) {
    fail("Unsupported OS: ${osfamily}, module ${module_name} only supports RedHat 6, 7, and 8")
  }

  if $restart_service {
    $openib_shellvar_notify = Service['openibd']
  } else {
    $openib_shellvar_notify = undef
  }

  contain mofed::repo
  contain mofed::install
  contain mofed::config
  contain mofed::service

  Class['mofed::repo']
  -> Class['mofed::install']
  -> Class['mofed::config']
  -> Class['mofed::service']

  create_resources('mofed::interface', $interfaces)

}