|
4 | 4 | # |
5 | 5 | # === Parameters: |
6 | 6 | # |
7 | | -# $mode:: Operation Mode of the plugin. |
| 7 | +# $mode:: Operation Mode of the plugin. |
8 | 8 | # |
9 | | -# $cockpit_integration:: Enables/disables Cockpit integration |
| 9 | +# $cockpit_integration:: Enables/disables Cockpit integration |
10 | 10 | # |
11 | 11 | # === SSH parameters: |
12 | 12 | # |
13 | | -# $generate_keys:: Automatically generate SSH keys |
| 13 | +# $generate_keys:: Automatically generate SSH keys |
14 | 14 | # |
15 | | -# $install_key:: Automatically install generated SSH key to root authorized keys |
16 | | -# which allows managing this host through Remote Execution |
| 15 | +# $install_key:: Automatically install generated SSH key to root authorized keys which allows managing this host through Remote Execution |
17 | 16 | # |
18 | | -# $ssh_identity_dir:: Directory where SSH keys are stored |
| 17 | +# $ssh_identity_dir:: Directory where SSH keys are stored |
19 | 18 | # |
20 | | -# $ssh_identity_file:: Provide an alternative name for the SSH keys |
| 19 | +# $ssh_identity_file:: Provide an alternative name for the SSH keys |
21 | 20 | # |
22 | | -# $ssh_keygen:: Location of the ssh-keygen binary |
| 21 | +# $ssh_user_ca_public_key_file:: Public key file for the SSH CA certificate |
23 | 22 | # |
24 | | -# $ssh_kerberos_auth:: Enable kerberos authentication for SSH |
| 23 | +# $ssh_host_ca_public_key:: Trusted host CA public key |
25 | 24 | # |
26 | | -# $local_working_dir:: Local working directory on the smart proxy |
| 25 | +# $ssh_keygen:: Location of the ssh-keygen binary |
27 | 26 | # |
28 | | -# $remote_working_dir:: Remote working directory on clients |
| 27 | +# $ssh_kerberos_auth:: Enable kerberos authentication for SSH |
29 | 28 | # |
30 | | -# $ssh_log_level:: Configure ssh client LogLevel |
| 29 | +# $local_working_dir:: Local working directory on the smart proxy |
| 30 | +# |
| 31 | +# $remote_working_dir:: Remote working directory on clients |
| 32 | +# |
| 33 | +# $ssh_log_level:: Configure ssh client LogLevel |
31 | 34 | # |
32 | 35 | # === Advanced parameters: |
33 | 36 | # |
34 | | -# $enabled:: Enables/disables the plugin |
| 37 | +# $enabled:: Enables/disables the plugin |
35 | 38 | # |
36 | | -# $listen_on:: Proxy feature listens on https, http, or both |
| 39 | +# $listen_on:: Proxy feature listens on https, http, or both |
37 | 40 | # |
38 | | -# $mqtt_ttl:: Time interval in seconds given to the host to pick up the job before considering the job undelivered. |
| 41 | +# $mqtt_ttl:: Time interval in seconds given to the host to pick up the job before considering the job undelivered. |
39 | 42 | # |
40 | | -# $mqtt_rate_limit:: Number of jobs that are allowed to run at the same time |
| 43 | +# $mqtt_rate_limit:: Number of jobs that are allowed to run at the same time |
41 | 44 | # |
42 | | -# $mqtt_resend_interval:: Time interval in seconds at which the notification should be re-sent to the host until the job is picked up or canceleld |
| 45 | +# $mqtt_resend_interval:: Time interval in seconds at which the notification should be re-sent to the host until the job is picked up or canceleld |
43 | 46 | # |
44 | 47 | class foreman_proxy::plugin::remote_execution::script ( |
45 | 48 | Boolean $enabled = true, |
|
48 | 51 | Boolean $install_key = false, |
49 | 52 | Stdlib::Absolutepath $ssh_identity_dir = '/var/lib/foreman-proxy/ssh', |
50 | 53 | String $ssh_identity_file = 'id_rsa_foreman_proxy', |
| 54 | + Optional[Stdlib::Absolutepath] $ssh_user_ca_public_key_file = undef, |
| 55 | + Optional[String] $ssh_host_ca_public_key = undef, |
51 | 56 | String $ssh_keygen = '/usr/bin/ssh-keygen', |
52 | 57 | Stdlib::Absolutepath $local_working_dir = '/var/tmp', |
53 | 58 | Stdlib::Absolutepath $remote_working_dir = '/var/tmp', |
|
59 | 64 | Optional[Integer] $mqtt_rate_limit = undef, |
60 | 65 | Optional[Integer] $mqtt_resend_interval = undef, |
61 | 66 | ) { |
| 67 | + $ssh_ca_known_hosts_file = "${ssh_identity_dir}/foreman_known_hosts_ca" |
62 | 68 | $ssh_identity_path = "${ssh_identity_dir}/${ssh_identity_file}" |
63 | 69 |
|
64 | 70 | include foreman_proxy |
|
87 | 93 | ssl_key => $foreman_proxy::ssl_key, |
88 | 94 | } |
89 | 95 |
|
| 96 | + if $ssh_host_ca_public_key { |
| 97 | + file { $ssh_ca_known_hosts_file: |
| 98 | + ensure => file, |
| 99 | + owner => $foreman_proxy::user, |
| 100 | + group => $foreman_proxy::group, |
| 101 | + mode => '0600', |
| 102 | + content => "@cert-autority * ${ssh_host_ca_public_key}\n", |
| 103 | + } |
| 104 | + } else { |
| 105 | + file { $ssh_ca_known_hosts_file: |
| 106 | + ensure => absent, |
| 107 | + } |
| 108 | + } |
| 109 | + |
90 | 110 | Class['foreman_proxy::config'] ~> Class['foreman_proxy::plugin::remote_execution::mosquitto'] |
91 | 111 | } |
0 commit comments