|
54 | 54 | listen_on => $listen_on,
|
55 | 55 | }
|
56 | 56 |
|
57 |
| - if $ssh_kerberos_auth { |
58 |
| - $kerberos_pkg = "${foreman_proxy::params::ruby_package_prefix}net-ssh-krb" |
59 |
| - package { $kerberos_pkg: |
60 |
| - ensure => present, |
| 57 | + if $mode =~ /ssh/ { |
| 58 | + if $ssh_kerberos_auth { |
| 59 | + $kerberos_pkg = "${foreman_proxy::params::ruby_package_prefix}net-ssh-krb" |
| 60 | + package { $kerberos_pkg: |
| 61 | + ensure => present, |
| 62 | + } |
61 | 63 | }
|
62 |
| - } |
63 | 64 |
|
64 |
| - if $generate_keys { |
65 |
| - file { $ssh_identity_dir: |
66 |
| - ensure => directory, |
67 |
| - owner => $foreman_proxy::user, |
68 |
| - group => $foreman_proxy::user, |
69 |
| - mode => '0700', |
70 |
| - } |
71 |
| - -> exec { 'generate_ssh_key': |
72 |
| - command => "${ssh_keygen} -f ${ssh_identity_path} -N '' -m pem", |
73 |
| - user => $foreman_proxy::user, |
74 |
| - cwd => $ssh_identity_dir, |
75 |
| - creates => $ssh_identity_path, |
76 |
| - } |
77 |
| - if $install_key { |
78 |
| - # Ensure the .ssh directory exists with the right permissions |
79 |
| - file { '/root/.ssh': |
| 65 | + if $generate_keys { |
| 66 | + file { $ssh_identity_dir: |
80 | 67 | ensure => directory,
|
81 |
| - owner => 'root', |
82 |
| - group => 'root', |
| 68 | + owner => $foreman_proxy::user, |
| 69 | + group => $foreman_proxy::user, |
83 | 70 | mode => '0700',
|
84 | 71 | }
|
85 |
| - -> exec { 'install_ssh_key': |
86 |
| - path => '/usr/bin:/usr/sbin:/bin', |
87 |
| - command => "cat ${ssh_identity_path}.pub >> /root/.ssh/authorized_keys", |
88 |
| - unless => "grep -f ${ssh_identity_path}.pub /root/.ssh/authorized_keys", |
89 |
| - require => Exec['generate_ssh_key'], |
| 72 | + -> exec { 'generate_ssh_key': |
| 73 | + command => "${ssh_keygen} -f ${ssh_identity_path} -N '' -m pem", |
| 74 | + user => $foreman_proxy::user, |
| 75 | + cwd => $ssh_identity_dir, |
| 76 | + creates => $ssh_identity_path, |
| 77 | + } |
| 78 | + if $install_key { |
| 79 | + # Ensure the .ssh directory exists with the right permissions |
| 80 | + file { '/root/.ssh': |
| 81 | + ensure => directory, |
| 82 | + owner => 'root', |
| 83 | + group => 'root', |
| 84 | + mode => '0700', |
| 85 | + } |
| 86 | + -> exec { 'install_ssh_key': |
| 87 | + path => '/usr/bin:/usr/sbin:/bin', |
| 88 | + command => "cat ${ssh_identity_path}.pub >> /root/.ssh/authorized_keys", |
| 89 | + unless => "grep -f ${ssh_identity_path}.pub /root/.ssh/authorized_keys", |
| 90 | + require => Exec['generate_ssh_key'], |
| 91 | + } |
90 | 92 | }
|
91 | 93 | }
|
| 94 | + } elsif $mode == 'pull-mqtt' { |
| 95 | + include mosquitto |
92 | 96 | }
|
93 | 97 | }
|
0 commit comments