2014-07-04 11:17:39 +02:00
|
|
|
# == Class: trove::guestagent
|
|
|
|
#
|
|
|
|
# Manages trove guest agent package and service
|
|
|
|
#
|
|
|
|
# === Parameters:
|
|
|
|
#
|
|
|
|
# [*enabled*]
|
|
|
|
# (optional) Whether to enable the trove guest agent service
|
2022-03-17 13:27:53 +09:00
|
|
|
# Defaults to false
|
2014-07-04 11:17:39 +02:00
|
|
|
#
|
|
|
|
# [*manage_service*]
|
|
|
|
# (optional) Whether to start/stop the service
|
|
|
|
# Defaults to true
|
|
|
|
#
|
2017-03-09 09:25:07 +08:00
|
|
|
# [*package_ensure*]
|
2014-07-04 11:17:39 +02:00
|
|
|
# (optional) The state of the trove guest agent package
|
|
|
|
# Defaults to 'present'
|
|
|
|
#
|
|
|
|
# [*debug*]
|
|
|
|
# (optional) Rather to log the trove guest agent service at debug level.
|
|
|
|
# Default: false
|
|
|
|
#
|
|
|
|
# [*log_file*]
|
|
|
|
# (optional) The path of file used for logging
|
2023-03-02 12:41:41 +09:00
|
|
|
# If set to $facts['os_service_default'], it will not log to any file.
|
2016-05-25 14:04:16 -04:00
|
|
|
# Default: /var/log/trove/trove-guestagent.log
|
2014-07-04 11:17:39 +02:00
|
|
|
#
|
|
|
|
# [*log_dir*]
|
|
|
|
# (optional) directory to which trove logs are sent.
|
2023-03-02 12:41:41 +09:00
|
|
|
# If set to $facts['os_service_default'], it will not log to any directory.
|
2014-07-04 11:17:39 +02:00
|
|
|
# Defaults to '/var/log/trove'
|
|
|
|
#
|
2016-05-31 11:50:45 -03:00
|
|
|
# [*use_syslog*]
|
|
|
|
# (optional) Use syslog for logging.
|
2023-03-02 12:41:41 +09:00
|
|
|
# Defaults to $facts['os_service_default']
|
2016-05-31 11:50:45 -03:00
|
|
|
#
|
2014-07-04 11:17:39 +02:00
|
|
|
# [*log_facility*]
|
|
|
|
# (optional) Syslog facility to receive log lines.
|
|
|
|
# Defaults to 'LOG_USER'.
|
|
|
|
#
|
|
|
|
# [*swift_url*]
|
2016-05-09 15:45:43 -06:00
|
|
|
# (optional) Swift URL. If this is unset in the class, Trove will
|
|
|
|
# lookup the URL using the Keystone catalog.
|
2023-03-02 12:41:41 +09:00
|
|
|
# Defaults to $facts['os_service_default'].
|
2014-07-04 11:17:39 +02:00
|
|
|
#
|
2016-10-11 16:28:44 +03:00
|
|
|
# [*swift_service_type*]
|
|
|
|
# (optional) Service type to use when searching catalog
|
2023-03-02 12:41:41 +09:00
|
|
|
# Defaults to $facts['os_service_default'].
|
2016-10-11 16:28:44 +03:00
|
|
|
#
|
2016-11-08 16:03:31 -07:00
|
|
|
# [*default_transport_url*]
|
|
|
|
# (optional) A URL representing the messaging driver to use and its full
|
|
|
|
# configuration. Transport URLs take the form:
|
|
|
|
# transport://user:pass@host1:port[,hostN:portN]/virtual_host
|
|
|
|
# Defaults to $::trove::default_transport_url
|
2016-05-04 11:53:25 -06:00
|
|
|
#
|
2016-05-25 16:34:29 -04:00
|
|
|
# [*rabbit_use_ssl*]
|
|
|
|
# (optional) Connect over SSL for RabbitMQ
|
|
|
|
# Defaults to the value set in the trove class.
|
|
|
|
# The default can generally be left unless the
|
|
|
|
# guests need to talk to the rabbit cluster via
|
|
|
|
# a different ssl connection option.
|
2016-06-01 10:47:05 -04:00
|
|
|
#
|
2016-05-26 20:08:35 +08:00
|
|
|
# [*root_grant*]
|
|
|
|
# (optional) Permissions to grant "root" user.
|
2023-03-02 12:41:41 +09:00
|
|
|
# Defaults to $facts['os_service_default'].
|
2016-05-26 20:08:35 +08:00
|
|
|
#
|
|
|
|
# [*root_grant_option*]
|
|
|
|
# (optional) Permissions to grant "root" user option.
|
2023-03-02 12:41:41 +09:00
|
|
|
# Defaults to $facts['os_service_default'].
|
2016-05-26 20:08:35 +08:00
|
|
|
#
|
2023-02-20 13:56:40 +09:00
|
|
|
# [*container_registry*]
|
|
|
|
# (optional) URL to the registry.
|
2023-03-02 12:41:41 +09:00
|
|
|
# Defaults to $facts['os_service_default'].
|
2023-02-20 13:56:40 +09:00
|
|
|
#
|
|
|
|
# [*container_registry_username*]
|
|
|
|
# (optional) The registry username.
|
2023-03-02 12:41:41 +09:00
|
|
|
# Defaults to $facts['os_service_default'].
|
2023-02-20 13:56:40 +09:00
|
|
|
#
|
|
|
|
# [*container_registry_password*]
|
|
|
|
# (optional) The plaintext registry password.
|
2023-03-02 12:41:41 +09:00
|
|
|
# Defaults to $facts['os_service_default'].
|
2023-02-20 13:56:40 +09:00
|
|
|
#
|
2020-05-04 21:48:45 +09:00
|
|
|
# DEPRECATED PARAMETERS
|
|
|
|
#
|
2023-02-20 20:04:07 +09:00
|
|
|
# [*default_password_length*]
|
|
|
|
# (optional) Default password Length for root password.
|
|
|
|
# Defaults to undef
|
|
|
|
#
|
2022-03-17 10:40:39 +09:00
|
|
|
# [*backup_aes_cbc_key*]
|
|
|
|
# (optional) Default OpenSSL aes_cbc key
|
|
|
|
# Defaults to undef
|
|
|
|
#
|
2014-07-04 11:17:39 +02:00
|
|
|
class trove::guestagent(
|
2023-06-21 07:20:36 +09:00
|
|
|
Boolean $enabled = false,
|
|
|
|
Boolean $manage_service = true,
|
2023-02-20 13:56:40 +09:00
|
|
|
$package_ensure = 'present',
|
2023-03-02 12:41:41 +09:00
|
|
|
$debug = $facts['os_service_default'],
|
2023-02-20 13:56:40 +09:00
|
|
|
$log_file = '/var/log/trove/trove-guestagent.log',
|
|
|
|
$log_dir = '/var/log/trove',
|
2023-03-02 12:41:41 +09:00
|
|
|
$use_syslog = $facts['os_service_default'],
|
|
|
|
$log_facility = $facts['os_service_default'],
|
|
|
|
$swift_url = $facts['os_service_default'],
|
|
|
|
$swift_service_type = $facts['os_service_default'],
|
2023-02-20 13:56:40 +09:00
|
|
|
$default_transport_url = $::trove::default_transport_url,
|
|
|
|
$rabbit_use_ssl = $::trove::rabbit_use_ssl,
|
2023-03-02 12:41:41 +09:00
|
|
|
$root_grant = $facts['os_service_default'],
|
|
|
|
$root_grant_option = $facts['os_service_default'],
|
|
|
|
$container_registry = $facts['os_service_default'],
|
|
|
|
$container_registry_username = $facts['os_service_default'],
|
|
|
|
$container_registry_password = $facts['os_service_default'],
|
2022-09-29 08:52:46 +09:00
|
|
|
# DEPRECATED PARAMETERS
|
2023-02-20 20:04:07 +09:00
|
|
|
$default_password_length = undef,
|
2023-02-20 13:56:40 +09:00
|
|
|
$backup_aes_cbc_key = undef,
|
2022-03-17 10:37:45 +09:00
|
|
|
) inherits trove {
|
2014-07-04 11:17:39 +02:00
|
|
|
|
2019-12-08 23:24:12 +01:00
|
|
|
include trove::deps
|
|
|
|
include trove::params
|
2020-05-04 21:48:45 +09:00
|
|
|
include trove::guestagent::service_credentials
|
2014-07-04 11:17:39 +02:00
|
|
|
|
2022-03-17 10:40:39 +09:00
|
|
|
if $backup_aes_cbc_key != undef {
|
|
|
|
warning('The parameter backup_aes_cbc_key is deprecated for removal')
|
|
|
|
}
|
|
|
|
|
2014-07-04 11:17:39 +02:00
|
|
|
# basic service config
|
|
|
|
trove_guestagent_config {
|
2016-10-11 16:28:44 +03:00
|
|
|
'DEFAULT/swift_url': value => $swift_url;
|
|
|
|
'DEFAULT/swift_service_type': value => $swift_service_type;
|
|
|
|
'DEFAULT/root_grant': value => $root_grant;
|
|
|
|
'DEFAULT/root_grant_option': value => $root_grant_option;
|
2023-03-02 12:41:41 +09:00
|
|
|
'DEFAULT/default_password_length': value => pick($default_password_length, $facts['os_service_default']);
|
|
|
|
'DEFAULT/backup_aes_cbc_key': value => pick($backup_aes_cbc_key, $facts['os_service_default']);
|
2016-05-07 14:10:18 +08:00
|
|
|
}
|
|
|
|
|
2016-05-10 07:53:10 -06:00
|
|
|
oslo::messaging::default { 'trove_guestagent_config':
|
2017-02-08 10:54:48 +08:00
|
|
|
transport_url => $default_transport_url,
|
|
|
|
control_exchange => $::trove::control_exchange,
|
|
|
|
rpc_response_timeout => $::trove::rpc_response_timeout,
|
2014-07-04 11:17:39 +02:00
|
|
|
}
|
|
|
|
|
2016-04-19 15:11:20 +00:00
|
|
|
oslo::messaging::notifications { 'trove_guestagent_config':
|
2016-06-01 10:47:05 -04:00
|
|
|
transport_url => $::trove::notification_transport_url,
|
|
|
|
driver => $::trove::notification_driver,
|
|
|
|
topics => $::trove::notification_topics
|
2015-07-11 05:08:26 +08:00
|
|
|
}
|
|
|
|
|
2017-07-27 12:14:53 -04:00
|
|
|
oslo::messaging::rabbit {'trove_guestagent_config':
|
2018-02-09 15:05:28 +08:00
|
|
|
rabbit_use_ssl => $rabbit_use_ssl,
|
|
|
|
rabbit_ha_queues => $::trove::rabbit_ha_queues,
|
2019-08-21 14:21:01 +08:00
|
|
|
heartbeat_in_pthread => $::trove::rabbit_heartbeat_in_pthread,
|
2018-02-09 15:05:28 +08:00
|
|
|
kombu_reconnect_delay => $::trove::kombu_reconnect_delay,
|
|
|
|
kombu_failover_strategy => $::trove::kombu_failover_strategy,
|
|
|
|
amqp_durable_queues => $::trove::amqp_durable_queues,
|
|
|
|
kombu_ssl_ca_certs => $::trove::kombu_ssl_ca_certs,
|
|
|
|
kombu_ssl_certfile => $::trove::kombu_ssl_certfile,
|
|
|
|
kombu_ssl_keyfile => $::trove::kombu_ssl_keyfile,
|
|
|
|
kombu_ssl_version => $::trove::kombu_ssl_version
|
2017-07-27 12:14:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
oslo::messaging::amqp { 'trove_guestagent_config':
|
2020-11-02 14:42:04 +08:00
|
|
|
server_request_prefix => $::trove::amqp_server_request_prefix,
|
|
|
|
broadcast_prefix => $::trove::amqp_broadcast_prefix,
|
|
|
|
group_request_prefix => $::trove::amqp_group_request_prefix,
|
|
|
|
container_name => $::trove::amqp_container_name,
|
|
|
|
idle_timeout => $::trove::amqp_idle_timeout,
|
|
|
|
trace => $::trove::amqp_trace,
|
|
|
|
ssl_ca_file => $::trove::amqp_ssl_ca_file,
|
|
|
|
ssl_cert_file => $::trove::amqp_ssl_cert_file,
|
|
|
|
ssl_key_file => $::trove::amqp_ssl_key_file,
|
|
|
|
ssl_key_password => $::trove::amqp_ssl_key_password,
|
|
|
|
sasl_mechanisms => $::trove::amqp_sasl_mechanisms,
|
|
|
|
sasl_config_dir => $::trove::amqp_sasl_config_dir,
|
|
|
|
sasl_config_name => $::trove::amqp_sasl_config_name,
|
|
|
|
username => $::trove::amqp_username,
|
|
|
|
password => $::trove::amqp_password,
|
2014-07-04 11:17:39 +02:00
|
|
|
}
|
|
|
|
|
2016-05-12 16:07:56 +03:00
|
|
|
oslo::log { 'trove_guestagent_config':
|
|
|
|
debug => $debug,
|
|
|
|
log_file => $log_file,
|
|
|
|
log_dir => $log_dir,
|
2016-05-31 11:50:45 -03:00
|
|
|
use_syslog => $use_syslog,
|
2016-05-12 16:07:56 +03:00
|
|
|
syslog_log_facility => $log_facility
|
2014-07-04 11:17:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
trove::generic_service { 'guestagent':
|
|
|
|
enabled => $enabled,
|
|
|
|
manage_service => $manage_service,
|
|
|
|
package_name => $::trove::params::guestagent_package_name,
|
|
|
|
service_name => $::trove::params::guestagent_service_name,
|
2018-03-29 12:01:15 +08:00
|
|
|
package_ensure => $package_ensure,
|
2014-07-04 11:17:39 +02:00
|
|
|
}
|
|
|
|
|
2023-02-20 13:56:40 +09:00
|
|
|
trove_guestagent_config {
|
|
|
|
'guest_agent/container_registry': value => $container_registry;
|
|
|
|
'guest_agent/container_registry_username': value => $container_registry_username;
|
|
|
|
'guest_agent/container_registry_password': value => $container_registry_password, secret => true;
|
|
|
|
}
|
|
|
|
|
2014-07-04 11:17:39 +02:00
|
|
|
}
|