더북(TheBook)
# /home/administrator/code/environments/production/modules/base/manifests/ssh.pp
# SSH 서버 운영
class base::ssh {

  package { 'openssh-server': 
    ensure => latest,
  }

  service { 'ssh': 
    ensure => running,
    require => Package['openssh-server'],
  }

  file { '.ssh': 
    ensure => 'directory',
    name => '/home/administrator/.ssh',
    owner => 'administrator',
    group => 'administrator',
    mode => '700',
  }

  file { 'authorized_keys': 
    name => '/home/administrator/.ssh/authorized_keys',
    owner => 'administrator',
    group => 'administrator',
    mode => '600',
    source => 'puppet:///modules/base/authorized_keys',
    require => File['.ssh'],
  }

  notify { "===== base::ssh =====\n": } 

}
신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.