| OLD | NEW |
| 1 class ssh( | 1 class ssh( |
| 2 $agent_forwarding = hiera('ssh::agent_forwarding', false), | 2 $agent_forwarding = hiera('ssh::agent_forwarding', false), |
| 3 $tcp_forwarding = hiera('ssh::tcp_forwarding', false), | 3 $tcp_forwarding = hiera('ssh::tcp_forwarding', false), |
| 4 ) { | 4 ) { |
| 5 | 5 |
| 6 ensure_packages([ | 6 ensure_packages([ |
| 7 'openssh-client', | 7 'openssh-client', |
| 8 'openssh-server', | 8 'openssh-server', |
| 9 ]) | 9 ]) |
| 10 | 10 |
| 11 package {['libssl1.0.0', 'openssl']: | 11 package {['libssl1.0.0', 'openssl']: |
| 12 ensure => 'latest', | 12 ensure => 'latest', |
| 13 } | 13 } |
| 14 | 14 |
| 15 concat {'sshd_config': | 15 concat {'sshd_config': |
| 16 path => '/etc/ssh/sshd_config', | 16 path => '/etc/ssh/sshd_config', |
| 17 owner => root, | 17 owner => root, |
| 18 group => root, | 18 group => root, |
| 19 mode => '0644', | 19 mode => '0644', |
| 20 require => Package['openssh-server'] | 20 require => Package['openssh-server'] |
| 21 } | 21 } |
| 22 | 22 |
| 23 concat::fragment {'sshd_config_template': | 23 concat::fragment {'sshd_config_template': |
| 24 target => 'sshd_config', | 24 target => 'sshd_config', |
| 25 content => template('ssh/sshd_config.erb'), | 25 content => template('ssh/sshd_config.erb'), |
| 26 order => '01', | 26 order => '01', |
| 27 } | 27 } |
| 28 | 28 |
| 29 # http://hub.eyeo.com/issues/4433 |
| 30 $sshd_configfragments = hiera_hash('ssh::sshd_configfragments', {}) |
| 31 |
| 32 create_resources('concat::fragment', $sshd_configfragments, { |
| 33 target => 'sshd_config', |
| 34 order => '10', |
| 35 }) |
| 36 |
| 29 file {'ssh_config': | 37 file {'ssh_config': |
| 30 content => template('ssh/ssh_config.erb'), | 38 content => template('ssh/ssh_config.erb'), |
| 31 group => 'root', | 39 group => 'root', |
| 32 mode => '0644', | 40 mode => '0644', |
| 33 owner => 'root', | 41 owner => 'root', |
| 34 path => '/etc/ssh/ssh_config', | 42 path => '/etc/ssh/ssh_config', |
| 35 require => Package['openssh-client'], | 43 require => Package['openssh-client'], |
| 36 } | 44 } |
| 37 | 45 |
| 38 service {'ssh': | 46 service {'ssh': |
| 39 ensure => running, | 47 ensure => running, |
| 40 enable => true, | 48 enable => true, |
| 41 hasstatus => true, | 49 hasstatus => true, |
| 42 hasrestart => true, | 50 hasrestart => true, |
| 43 subscribe => Concat['sshd_config'] | 51 subscribe => Concat['sshd_config'] |
| 44 } | 52 } |
| 45 | 53 |
| 46 Service['ssh'] <~ Package['libssl1.0.0'] | 54 Service['ssh'] <~ Package['libssl1.0.0'] |
| 47 Service['ssh'] <~ Package['openssl'] | 55 Service['ssh'] <~ Package['openssl'] |
| 48 } | 56 } |
| OLD | NEW |