Puppet Class: aix_tidy::hosts_equiv

Defined in:
manifests/hosts_equiv.pp

Overview

Aix_tidy::hosts_equiv

Disable all hosts.equiv entries by commenting them out



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'manifests/hosts_equiv.pp', line 4

class aix_tidy::hosts_equiv {

  # no sed -i on AIX so must move manually..sigh
  $fix_cmd = 'sed \'s/\(^[^#].*$\)/# \1/\' /etc/hosts.equiv  > /etc/hosts.equiv.work && mv hosts.equiv.work hosts.equiv '
  $test_cmd = 'grep ^[^#] /etc/hosts.equiv'

  exec { "fix_hosts_equiv":
    command => $fix_cmd,
    onlyif  => $test_cmd,
    path    => ['/usr/bin','/bin'],
  }

  file { "/etc/hosts.equiv":
    ensure  => file,
    owner   => "root",
    group   => "system",
    mode    => "0644",
    require => Exec[fix_hosts_equiv],
  }
}