Puppet Class: gpfs::gui::config

Defined in:
manifests/gui/config.pp

Summary

Manage GPFS GUI 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'manifests/gui/config.pp', line 3

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

  file { '/etc/sudoers.d/scalemgmt_sudoers':
    ensure => 'file',
    owner  => 'root',
    group  => 'root',
    mode   => '0440',
  }

  if $gpfs::gui::manage_firewall {
    shellvar { 'gpfsgui-UPDATE_IPTABLES':
      ensure   => 'present',
      target   => '/etc/sysconfig/gpfsgui',
      variable => 'UPDATE_IPTABLES',
      value    => 'false',
    }

    case $gpfs::gui::firewall_source {
      String: {
        firewall { "47443 ${gpfs::gui::firewall_source}:47443":
          ensure  => 'present',
          action  => 'accept',
          chain   => 'INPUT',
          ctstate => ['NEW'],
          dport   => '47443',
          proto   => 'tcp',
          source  => $gpfs::gui::firewall_source,
        }
        unless $gpfs::gui::firewall_https_only {
          firewall { "47080 ${gpfs::gui::firewall_source}:47080":
            ensure  => 'present',
            action  => 'accept',
            chain   => 'INPUT',
            ctstate => ['NEW'],
            dport   => '47080',
            proto   => 'tcp',
            source  => $gpfs::gui::firewall_source,
          }
        }
      }
      Array: {
        $gpfs::gui::firewall_source.each |$source| {
          firewall { "47443 ${source}:47443":
            ensure  => 'present',
            action  => 'accept',
            chain   => 'INPUT',
            ctstate => ['NEW'],
            dport   => '47443',
            proto   => 'tcp',
            source  => $source,
          }
          unless $gpfs::gui::firewall_https_only {
            firewall { "47080 ${source}:47080":
              ensure  => 'present',
              action  => 'accept',
              chain   => 'INPUT',
              ctstate => ['NEW'],
              dport   => '47080',
              proto   => 'tcp',
              source  => $source,
            }
          }
        }
      }
      false: {
        # Do nothing
      }
      default: {
        firewall { '47443 *:47443':
          ensure  => 'present',
          action  => 'accept',
          chain   => 'INPUT',
          ctstate => ['NEW'],
          dport   => '47443',
          proto   => 'tcp',
        }
        unless $gpfs::gui::firewall_https_only {
          firewall { '47080 *:47080':
            ensure  => 'present',
            action  => 'accept',
            chain   => 'INPUT',
            ctstate => ['NEW'],
            dport   => '47080',
            proto   => 'tcp',
          }
        }
      }
    }
    firewall { '443 PREROUTING REDIRECT TO 47443':
      ensure  => 'present',
      chain   => 'PREROUTING',
      dport   => '443',
      jump    => 'REDIRECT',
      proto   => 'tcp',
      table   => 'nat',
      toports => '47443',
    }
    firewall { '443 OUTPUT REDIRECT TO 47443':
      ensure   => 'present',
      chain    => 'OUTPUT',
      dport    => '443',
      jump     => 'REDIRECT',
      outiface => 'lo',
      proto    => 'tcp',
      table    => 'nat',
      toports  => '47443',
    }
    unless $gpfs::gui::firewall_https_only {
      firewall { '80 PREROUTING REDIRECT TO 47080':
        ensure  => 'present',
        chain   => 'PREROUTING',
        dport   => '80',
        jump    => 'REDIRECT',
        proto   => 'tcp',
        table   => 'nat',
        toports => '47080',
      }
      firewall { '80 OUTPUT REDIRECT TO 47080':
        ensure   => 'present',
        chain    => 'OUTPUT',
        dport    => '80',
        jump     => 'REDIRECT',
        outiface => 'lo',
        proto    => 'tcp',
        table    => 'nat',
        toports  => '47080',
      }
    }
  }
}