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