Puppet Class: confdroid_ssh::main::files

Inherits:
confdroid_ssh::params
Defined in:
manifests/main/files.pp

Summary

Class manages files

Overview

confdroid_ssh::main::files.pp Module name: confdroid_ssh Author: 12ww1160 (12ww1160@confdroid.com)



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
# File 'manifests/main/files.pp', line 6

class confdroid_ssh::main::files (
) inherits confdroid_ssh::params {
  require confdroid_ssh::main::dirs

  file { $sshd_config_path:
    ensure   => file,
    path     => $sshd_config_path,
    owner    => $sshd_user,
    group    => $sshd_user,
    mode     => '0640',
    selrange => s0,
    selrole  => object_r,
    seltype  => etc_t,
    seluser  => system_u,
    content  => template($sshd_config_erb),
    notify   => Service[$sshd_service],
  }

  if $ssh_manage_config {
    file { $sshd_custom_conf:
      ensure   => file,
      path     => $sshd_custom_conf,
      owner    => $sshd_user,
      group    => $sshd_user,
      mode     => '0640',
      selrange => s0,
      selrole  => object_r,
      seltype  => etc_t,
      seluser  => system_u,
      content  => template($sshd_custom_erb),
      notify   => Service[$sshd_service],
    }
    # we want the default root login setting to be managed by the custom conf, 
    # so we remove the default file if it exists
    file { $sshd_root_login_file:
      ensure => absent,
      path   => $sshd_root_login_file,
      notify => Service[$sshd_service],
    }
  }
}