Puppet Class: gpfs::client::config

Defined in:
manifests/client/config.pp

Summary

Manage GPFS client config

Overview



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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'manifests/client/config.pp', line 3

class gpfs::client::config {
  assert_private()

  $_ssh_authorized_key_defaults = {
    'type' => 'ssh-rsa',
    'user' => $gpfs::client::ssh_user,
  }

  if $gpfs::client::manage_ssh_authorized_keys {
    create_resources('ssh_authorized_key', $gpfs::client::ssh_authorized_keys, $_ssh_authorized_key_defaults)
  }

  $bin_paths = $gpfs::client::bin_paths
  if ! empty($bin_paths) {
    $gpfs_sh_ensure = 'file'
  } else {
    $gpfs_sh_ensure = 'absent'
  }
  file { '/etc/profile.d/gpfs-client.sh':
    ensure  => $gpfs_sh_ensure,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('gpfs/gpfs.sh.profile.erb'),
  }

  file { '/var/mmfs/ccr':
    ensure => 'directory',
    owner  => 'root',
    group  => 'root',
    mode   => '0755',
  }

  file { '/var/mmfs/ccr/committed':
    ensure => 'directory',
    owner  => 'root',
    group  => 'root',
    mode   => '0755',
  }

  file { '/var/mmfs/etc':
    ensure => 'directory',
    owner  => 'root',
    group  => 'root',
    mode   => '0755',
  }

  concat { '/var/mmfs/etc/RKM.conf':
    ensure    => 'present',
    owner     => 'root',
    group     => 'root',
    mode      => '0600',
    show_diff => false,
    require   => File['/var/mmfs/etc'],
  }

  concat::fragment { 'RKM.conf.header':
    target  => '/var/mmfs/etc/RKM.conf',
    content => template('gpfs/RKM.conf.header.erb'),
    order   => '01',
  }

  create_resources('gpfs::client::rkm', $gpfs::client::rkms)

  # Hack to properly install systemd service
  if $facts['service_provider'] == 'systemd' and $gpfs::client::manage_service_files {
    file { '/usr/lib/systemd/system/gpfs.service':
      ensure => 'file',
      owner  => 'root',
      group  => 'root',
      mode   => '0444',
      source => 'file:///usr/lpp/mmfs/lib/systemd/gpfs.service',
    }
    file { '/etc/systemd/system/gpfs.service':
      ensure => 'absent',
      notify => Exec['gpfs-systemctl-daemon-reload'],
    }
    exec { 'gpfs-systemctl-daemon-reload':
      path        => '/usr/bin:/bin:/usr/sbin:/sbin',
      command     => 'systemctl daemon-reload',
      refreshonly => true,
      notify      => Exec['gpfs-fix-systemd-enable'],
    }
    exec { 'gpfs-fix-systemd-enable':
      path        => '/usr/bin:/bin:/usr/sbin:/sbin',
      command     => 'systemctl disable gpfs ; systemctl enable gpfs',
      onlyif      => 'systemctl is-enabled gpfs',
      refreshonly => true,
    }
  }
}