Puppet Class: scaleio::sdc

Defined in:
manifests/sdc.pp

Overview

manage a sdc



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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'manifests/sdc.pp', line 2

class scaleio::sdc {
  include ::scaleio

  # only do a new installation of the package
  package_verifiable{'EMC-ScaleIO-sdc':
    version        => $scaleio::version,
    manage_package => !$package_emc_scaleio_sdc_version,
    tag            => 'scaleio-install',
    require        => Package['numactl'],
  }

  if $::scaleio::mdms {
    $mdm_ips_joined = join(scaleio_get_all_mdm_ips($::scaleio::mdms, 'ips'), ',')

    service{'scini':
      ensure  => running,
      enable  => true,
      require => Package_verifiable['EMC-ScaleIO-sdc'],
      before  => Exec['scaleio::sdc_add_mdm'],
    }

    # add at first time MDM, if no one is defined
    exec{'scaleio::sdc_add_mdm':
      command => "/bin/emc/scaleio/drv_cfg --add_mdm --ip ${mdm_ips_joined} --file /bin/emc/scaleio/drv_cfg.txt",
      unless  => "grep -qE '^mdm ' /bin/emc/scaleio/drv_cfg.txt",
    }->

    # replace or add MDM definition
    exec{'scaleio::sdc_mod_mdm':
      command => "/bin/emc/scaleio/drv_cfg --mod_mdm_ip --ip $(grep -E '^mdm' /bin/emc/scaleio/drv_cfg.txt |awk '{print \$2}' |awk -F ',' '{print \$1}') --new_mdm_ip ${mdm_ips_joined} --file /bin/emc/scaleio/drv_cfg.txt",
      unless  => "grep -qE '^mdm ${mdm_ips_joined}$' /bin/emc/scaleio/drv_cfg.txt",
    }
  }

  if $::scaleio::lvm {
    file_line { 'scaleio_lvm_types':
      ensure => present,
      path   => '/etc/lvm/lvm.conf',
      line   => '    types = [ "scini", 16 ]',
      match  => 'types\s*=\s*\[',
    }
  }

}