Replace legacy facts and use fact hash

... because the latest lint no longer allows usage of legacy facts and
top scope fact.

Change-Id: I54ecd455a380fcba65132bfc9723b6a1b6c7591e
This commit is contained in:
Takashi Kajinami 2023-03-03 12:54:29 +09:00
parent 612c802c76
commit 61b4cf5e96
5 changed files with 116 additions and 117 deletions

View File

@ -10,43 +10,43 @@
# #
# [*database_connection_recycle_time*] # [*database_connection_recycle_time*]
# (Optional) Timeout when db connections should be reaped. # (Optional) Timeout when db connections should be reaped.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*database_db_max_retries*] # [*database_db_max_retries*]
# (optional) Maximum retries in case of connection error or deadlock error # (optional) Maximum retries in case of connection error or deadlock error
# before error is raised. Set to -1 to specify an infinite retry count. # before error is raised. Set to -1 to specify an infinite retry count.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*database_max_retries*] # [*database_max_retries*]
# (Optional) Maximum number of database connection retries during startup. # (Optional) Maximum number of database connection retries during startup.
# Setting -1 implies an infinite retry count. # Setting -1 implies an infinite retry count.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*database_retry_interval*] # [*database_retry_interval*]
# (Optional) Interval between retries of opening a database connection. # (Optional) Interval between retries of opening a database connection.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*database_max_pool_size*] # [*database_max_pool_size*]
# (Optional)Maximum number of SQL connections to keep open in a pool. # (Optional)Maximum number of SQL connections to keep open in a pool.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*database_max_overflow*] # [*database_max_overflow*]
# (Optional) If set, use this value for max_overflow with sqlalchemy. # (Optional) If set, use this value for max_overflow with sqlalchemy.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*database_pool_timeout*] # [*database_pool_timeout*]
# (Optional) If set, use this value for pool_timeout with SQLAlchemy. # (Optional) If set, use this value for pool_timeout with SQLAlchemy.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
class {{cookiecutter.project_name}}::db ( class {{cookiecutter.project_name}}::db (
$database_connection = 'sqlite:////var/lib/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}.sqlite', $database_connection = 'sqlite:////var/lib/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}.sqlite',
$database_connection_recycle_time = $::os_service_default, $database_connection_recycle_time = $facts['os_service_default'],
$database_max_pool_size = $::os_service_default, $database_max_pool_size = $facts['os_service_default'],
$database_db_max_retries = $::os_service_default, $database_db_max_retries = $facts['os_service_default'],
$database_max_retries = $::os_service_default, $database_max_retries = $facts['os_service_default'],
$database_retry_interval = $::os_service_default, $database_retry_interval = $facts['os_service_default'],
$database_max_overflow = $::os_service_default, $database_max_overflow = $facts['os_service_default'],
$database_pool_timeout = $::os_service_default, $database_pool_timeout = $facts['os_service_default'],
) { ) {
include {{cookiecutter.project_name}}::deps include {{cookiecutter.project_name}}::deps

View File

@ -29,17 +29,17 @@
# #
# [*system_scope*] # [*system_scope*]
# (Optional) Scope for system operations # (Optional) Scope for system operations
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*insecure*] # [*insecure*]
# (Optional) If true, explicitly allow TLS without checking server cert # (Optional) If true, explicitly allow TLS without checking server cert
# against any certificate authorities. WARNING: not recommended. Use with # against any certificate authorities. WARNING: not recommended. Use with
# caution. # caution.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*auth_section*] # [*auth_section*]
# (Optional) Config Section from which to load plugin specific options # (Optional) Config Section from which to load plugin specific options
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*auth_type*] # [*auth_type*]
# (Optional) Authentication type to load # (Optional) Authentication type to load
@ -51,26 +51,26 @@
# #
# [*auth_version*] # [*auth_version*]
# (Optional) API version of the admin Identity API endpoint. # (Optional) API version of the admin Identity API endpoint.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*cache*] # [*cache*]
# (Optional) Env key for the swift cache. # (Optional) Env key for the swift cache.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*cafile*] # [*cafile*]
# (Optional) A PEM encoded Certificate Authority to use when verifying HTTPs # (Optional) A PEM encoded Certificate Authority to use when verifying HTTPs
# connections. # connections.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*certfile*] # [*certfile*]
# (Optional) Required if identity server requires client certificate # (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*delay_auth_decision*] # [*delay_auth_decision*]
# (Optional) Do not handle authorization requests within the middleware, but # (Optional) Do not handle authorization requests within the middleware, but
# delegate the authorization decision to downstream WSGI components. Boolean # delegate the authorization decision to downstream WSGI components. Boolean
# value # value
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*enforce_token_bind*] # [*enforce_token_bind*]
# (Optional) Used to control the use and type of token binding. Can be set # (Optional) Used to control the use and type of token binding. Can be set
@ -80,57 +80,57 @@
# type is unknown the token will be rejected. "required" any form of token # type is unknown the token will be rejected. "required" any form of token
# binding is needed to be allowed. Finally the name of a binding method that # binding is needed to be allowed. Finally the name of a binding method that
# must be present in tokens. String value. # must be present in tokens. String value.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*http_connect_timeout*] # [*http_connect_timeout*]
# (Optional) Request timeout value for communicating with Identity API # (Optional) Request timeout value for communicating with Identity API
# server. # server.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*http_request_max_retries*] # [*http_request_max_retries*]
# (Optional) How many times are we trying to reconnect when communicating # (Optional) How many times are we trying to reconnect when communicating
# with Identity API Server. Integer value # with Identity API Server. Integer value
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*include_service_catalog*] # [*include_service_catalog*]
# (Optional) Indicate whether to set the X-Service-Catalog header. If False, # (Optional) Indicate whether to set the X-Service-Catalog header. If False,
# middleware will not ask for service catalog on token validation and will # middleware will not ask for service catalog on token validation and will
# not set the X-Service-Catalog header. Boolean value. # not set the X-Service-Catalog header. Boolean value.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*keyfile*] # [*keyfile*]
# (Optional) Required if identity server requires client certificate # (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*memcache_pool_conn_get_timeout*] # [*memcache_pool_conn_get_timeout*]
# (Optional) Number of seconds that an operation will wait to get a memcached # (Optional) Number of seconds that an operation will wait to get a memcached
# client connection from the pool. Integer value # client connection from the pool. Integer value
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*memcache_pool_dead_retry*] # [*memcache_pool_dead_retry*]
# (Optional) Number of seconds memcached server is considered dead before it # (Optional) Number of seconds memcached server is considered dead before it
# is tried again. Integer value # is tried again. Integer value
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*memcache_pool_maxsize*] # [*memcache_pool_maxsize*]
# (Optional) Maximum total number of open connections to every memcached # (Optional) Maximum total number of open connections to every memcached
# server. Integer value # server. Integer value
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*memcache_pool_socket_timeout*] # [*memcache_pool_socket_timeout*]
# (Optional) Number of seconds a connection to memcached is held unused in # (Optional) Number of seconds a connection to memcached is held unused in
# the pool before it is closed. Integer value # the pool before it is closed. Integer value
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*memcache_pool_unused_timeout*] # [*memcache_pool_unused_timeout*]
# (Optional) Number of seconds a connection to memcached is held unused in # (Optional) Number of seconds a connection to memcached is held unused in
# the pool before it is closed. Integer value # the pool before it is closed. Integer value
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*memcache_secret_key*] # [*memcache_secret_key*]
# (Optional, mandatory if memcache_security_strategy is defined) This string # (Optional, mandatory if memcache_security_strategy is defined) This string
# is used for key derivation. # is used for key derivation.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*memcache_security_strategy*] # [*memcache_security_strategy*]
# (Optional) If defined, indicate whether token data should be authenticated # (Optional) If defined, indicate whether token data should be authenticated
@ -138,17 +138,17 @@
# HMAC) in the cache. If ENCRYPT, token data is encrypted and authenticated in the # HMAC) in the cache. If ENCRYPT, token data is encrypted and authenticated in the
# cache. If the value is not one of these options or empty, auth_token will # cache. If the value is not one of these options or empty, auth_token will
# raise an exception on initialization. # raise an exception on initialization.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*memcache_use_advanced_pool*] # [*memcache_use_advanced_pool*]
# (Optional) Use the advanced (eventlet safe) memcached client pool. The # (Optional) Use the advanced (eventlet safe) memcached client pool. The
# advanced pool will only work under python 2.x Boolean value # advanced pool will only work under python 2.x Boolean value
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*memcached_servers*] # [*memcached_servers*]
# (Optional) Optionally specify a list of memcached server(s) to use for # (Optional) Optionally specify a list of memcached server(s) to use for
# caching. If left undefined, tokens will instead be cached in-process. # caching. If left undefined, tokens will instead be cached in-process.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*manage_memcache_package*] # [*manage_memcache_package*]
# (Optional) Whether to install the python-memcache package. # (Optional) Whether to install the python-memcache package.
@ -156,13 +156,13 @@
# #
# [*region_name*] # [*region_name*]
# (Optional) The region in which the identity server can be found. # (Optional) The region in which the identity server can be found.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*token_cache_time*] # [*token_cache_time*]
# (Optional) In order to prevent excessive effort spent validating tokens, # (Optional) In order to prevent excessive effort spent validating tokens,
# the middleware caches previously-seen tokens for a configurable duration # the middleware caches previously-seen tokens for a configurable duration
# (in seconds). Set to -1 to disable caching completely. Integer value # (in seconds). Set to -1 to disable caching completely. Integer value
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*service_token_roles*] # [*service_token_roles*]
# (Optional) A choice of roles that must be present in a service token. # (Optional) A choice of roles that must be present in a service token.
@ -172,24 +172,24 @@
# here are applied as an ANY check so any role in this list # here are applied as an ANY check so any role in this list
# must be present. For backwards compatibility reasons this # must be present. For backwards compatibility reasons this
# currently only affects the allow_expired check. (list value) # currently only affects the allow_expired check. (list value)
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*service_token_roles_required*] # [*service_token_roles_required*]
# (Optional) For backwards compatibility reasons we must let # (Optional) For backwards compatibility reasons we must let
# valid service tokens pass that don't pass the service_token_roles # valid service tokens pass that don't pass the service_token_roles
# check as valid. Setting this true will become the default in # check as valid. Setting this true will become the default in
# a future release and should be enabled if possible. # a future release and should be enabled if possible.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*service_type*] # [*service_type*]
# (Optional) The name or type of the service as it appears in the service # (Optional) The name or type of the service as it appears in the service
# catalog. This is used to validate tokens that have restricted access rules. # catalog. This is used to validate tokens that have restricted access rules.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*interface*] # [*interface*]
# (Optional) Interface to use for the Identity API endpoint. Valid values are # (Optional) Interface to use for the Identity API endpoint. Valid values are
# "public", "internal" or "admin". # "public", "internal" or "admin".
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
class {{cookiecutter.project_name}}::keystone::authtoken( class {{cookiecutter.project_name}}::keystone::authtoken(
$password, $password,
@ -198,37 +198,37 @@ class {{cookiecutter.project_name}}::keystone::authtoken(
$project_name = 'services', $project_name = 'services',
$user_domain_name = 'Default', $user_domain_name = 'Default',
$project_domain_name = 'Default', $project_domain_name = 'Default',
$system_scope = $::os_service_default, $system_scope = $facts['os_service_default'],
$insecure = $::os_service_default, $insecure = $facts['os_service_default'],
$auth_section = $::os_service_default, $auth_section = $facts['os_service_default'],
$auth_type = 'password', $auth_type = 'password',
$www_authenticate_uri = 'http://localhost:5000', $www_authenticate_uri = 'http://localhost:5000',
$auth_version = $::os_service_default, $auth_version = $facts['os_service_default'],
$cache = $::os_service_default, $cache = $facts['os_service_default'],
$cafile = $::os_service_default, $cafile = $facts['os_service_default'],
$certfile = $::os_service_default, $certfile = $facts['os_service_default'],
$delay_auth_decision = $::os_service_default, $delay_auth_decision = $facts['os_service_default'],
$enforce_token_bind = $::os_service_default, $enforce_token_bind = $facts['os_service_default'],
$http_connect_timeout = $::os_service_default, $http_connect_timeout = $facts['os_service_default'],
$http_request_max_retries = $::os_service_default, $http_request_max_retries = $facts['os_service_default'],
$include_service_catalog = $::os_service_default, $include_service_catalog = $facts['os_service_default'],
$keyfile = $::os_service_default, $keyfile = $facts['os_service_default'],
$memcache_pool_conn_get_timeout = $::os_service_default, $memcache_pool_conn_get_timeout = $facts['os_service_default'],
$memcache_pool_dead_retry = $::os_service_default, $memcache_pool_dead_retry = $facts['os_service_default'],
$memcache_pool_maxsize = $::os_service_default, $memcache_pool_maxsize = $facts['os_service_default'],
$memcache_pool_socket_timeout = $::os_service_default, $memcache_pool_socket_timeout = $facts['os_service_default'],
$memcache_pool_unused_timeout = $::os_service_default, $memcache_pool_unused_timeout = $facts['os_service_default'],
$memcache_secret_key = $::os_service_default, $memcache_secret_key = $facts['os_service_default'],
$memcache_security_strategy = $::os_service_default, $memcache_security_strategy = $facts['os_service_default'],
$memcache_use_advanced_pool = $::os_service_default, $memcache_use_advanced_pool = $facts['os_service_default'],
$memcached_servers = $::os_service_default, $memcached_servers = $facts['os_service_default'],
$manage_memcache_package = false, $manage_memcache_package = false,
$region_name = $::os_service_default, $region_name = $facts['os_service_default'],
$token_cache_time = $::os_service_default, $token_cache_time = $facts['os_service_default'],
$service_token_roles = $::os_service_default, $service_token_roles = $facts['os_service_default'],
$service_token_roles_required = $::os_service_default, $service_token_roles_required = $facts['os_service_default'],
$service_type = $::os_service_default, $service_type = $facts['os_service_default'],
$interface = $::os_service_default, $interface = $facts['os_service_default'],
) { ) {
include {{cookiecutter.project_name}}::deps include {{cookiecutter.project_name}}::deps

View File

@ -6,27 +6,27 @@
# #
# [*debug*] # [*debug*]
# (Optional) Should the daemons log debug messages # (Optional) Should the daemons log debug messages
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*use_syslog*] # [*use_syslog*]
# (Optional) Use syslog for logging. # (Optional) Use syslog for logging.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*use_json*] # [*use_json*]
# (Optional) Use json for logging. # (Optional) Use json for logging.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*use_journal*] # [*use_journal*]
# (Optional) Use journal for logging. # (Optional) Use journal for logging.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*use_stderr*] # [*use_stderr*]
# (Optional) Use stderr for logging # (Optional) Use stderr for logging
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*syslog_log_facility*] # [*syslog_log_facility*]
# (Optional) Syslog facility to receive log lines. # (Optional) Syslog facility to receive log lines.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*log_dir*] # [*log_dir*]
# (Optional) Directory where logs should be stored. # (Optional) Directory where logs should be stored.
@ -39,38 +39,38 @@
# #
# [*watch_log_file*] # [*watch_log_file*]
# (Optional) Uses logging handler designed to watch file system (boolean value). # (Optional) Uses logging handler designed to watch file system (boolean value).
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*logging_context_format_string*] # [*logging_context_format_string*]
# (Optional) Format string to use for log messages with context. # (Optional) Format string to use for log messages with context.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\ # Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
# [%(request_id)s %(user_identity)s] %(instance)s%(message)s' # [%(request_id)s %(user_identity)s] %(instance)s%(message)s'
# #
# [*logging_default_format_string*] # [*logging_default_format_string*]
# (Optional) Format string to use for log messages without context. # (Optional) Format string to use for log messages without context.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\ # Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
# [-] %(instance)s%(message)s' # [-] %(instance)s%(message)s'
# #
# [*logging_debug_format_suffix*] # [*logging_debug_format_suffix*]
# (Optional) Formatted data to append to log format when level is DEBUG. # (Optional) Formatted data to append to log format when level is DEBUG.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# Example: '%(funcName)s %(pathname)s:%(lineno)d' # Example: '%(funcName)s %(pathname)s:%(lineno)d'
# #
# [*logging_exception_prefix*] # [*logging_exception_prefix*]
# (Optional) Prefix each line of exception output with this format. # (Optional) Prefix each line of exception output with this format.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s' # Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s'
# #
# [*log_config_append*] # [*log_config_append*]
# (Optional) The name of an additional logging configuration file. # (Optional) The name of an additional logging configuration file.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# See https://docs.python.org/2/howto/logging.html # See https://docs.python.org/2/howto/logging.html
# #
# [*default_log_levels*] # [*default_log_levels*]
# (Optional) Hash of logger (keys) and level (values) pairs. # (Optional) Hash of logger (keys) and level (values) pairs.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# Example: # Example:
# { 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN', # { 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
# 'sqlalchemy' => 'WARN', 'suds' => 'INFO', # 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
@ -82,11 +82,11 @@
# #
# [*publish_errors*] # [*publish_errors*]
# (Optional) Publish error events (boolean value). # (Optional) Publish error events (boolean value).
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*fatal_deprecations*] # [*fatal_deprecations*]
# (Optional) Make deprecations fatal (boolean value) # (Optional) Make deprecations fatal (boolean value)
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*instance_format*] # [*instance_format*]
# (optional) If an instance is passed with the log message, format it # (optional) If an instance is passed with the log message, format it
@ -97,35 +97,35 @@
# [*instance_uuid_format*] # [*instance_uuid_format*]
# (Optional) If an instance UUID is passed with the log message, format # (Optional) If an instance UUID is passed with the log message, format
# it like this (string value). # it like this (string value).
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# Example: instance_uuid_format='[instance: %(uuid)s] ' # Example: instance_uuid_format='[instance: %(uuid)s] '
# #
# [*log_date_format*] # [*log_date_format*]
# (Optional) Format string for %%(asctime)s in log records. # (Optional) Format string for %%(asctime)s in log records.
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# Example: 'Y-%m-%d %H:%M:%S' # Example: 'Y-%m-%d %H:%M:%S'
# #
class {{cookiecutter.project_name}}::logging( class {{cookiecutter.project_name}}::logging(
$use_syslog = $::os_service_default, $use_syslog = $facts['os_service_default'],
$use_json = $::os_service_default, $use_json = $facts['os_service_default'],
$use_journal = $::os_service_default, $use_journal = $facts['os_service_default'],
$use_stderr = $::os_service_default, $use_stderr = $facts['os_service_default'],
$syslog_log_facility = $::os_service_default, $syslog_log_facility = $facts['os_service_default'],
$log_dir = '/var/log/{{cookiecutter.project_name}}', $log_dir = '/var/log/{{cookiecutter.project_name}}',
$log_file = '/var/log/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}.log', $log_file = '/var/log/{{cookiecutter.project_name}}/{{cookiecutter.project_name}}.log',
$watch_log_file = $::os_service_default, $watch_log_file = $facts['os_service_default'],
$debug = $::os_service_default, $debug = $facts['os_service_default'],
$logging_context_format_string = $::os_service_default, $logging_context_format_string = $facts['os_service_default'],
$logging_default_format_string = $::os_service_default, $logging_default_format_string = $facts['os_service_default'],
$logging_debug_format_suffix = $::os_service_default, $logging_debug_format_suffix = $facts['os_service_default'],
$logging_exception_prefix = $::os_service_default, $logging_exception_prefix = $facts['os_service_default'],
$log_config_append = $::os_service_default, $log_config_append = $facts['os_service_default'],
$default_log_levels = $::os_service_default, $default_log_levels = $facts['os_service_default'],
$publish_errors = $::os_service_default, $publish_errors = $facts['os_service_default'],
$fatal_deprecations = $::os_service_default, $fatal_deprecations = $facts['os_service_default'],
$instance_format = $::os_service_default, $instance_format = $facts['os_service_default'],
$instance_uuid_format = $::os_service_default, $instance_uuid_format = $facts['os_service_default'],
$log_date_format = $::os_service_default, $log_date_format = $facts['os_service_default'],
) { ) {
include {{cookiecutter.project_name}}::deps include {{cookiecutter.project_name}}::deps

View File

@ -9,15 +9,14 @@ class {{cookiecutter.project_name}}::params {
$group = '{{cookiecutter.project_name}}' $group = '{{cookiecutter.project_name}}'
case $::osfamily { case $facts['os']['family'] {
'RedHat': { 'RedHat': {
} }
'Debian': { 'Debian': {
} }
default: { default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, \ fail("Unsupported osfamily: ${facts['os']['family']}")
module ${module_name} only support osfamily RedHat and Debian")
} }
} # Case $::osfamily } # Case $facts['os']['family']
} }

View File

@ -6,12 +6,12 @@
# #
# [*enforce_scope*] # [*enforce_scope*]
# (Optional) Whether or not to enforce scope when evaluating policies. # (Optional) Whether or not to enforce scope when evaluating policies.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*enforce_new_defaults*] # [*enforce_new_defaults*]
# (Optional) Whether or not to use old deprecated defaults when evaluating # (Optional) Whether or not to use old deprecated defaults when evaluating
# policies. # policies.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*policies*] # [*policies*]
# (Optional) Set of policies to configure for {{cookiecutter.project_name}} # (Optional) Set of policies to configure for {{cookiecutter.project_name}}
@ -34,11 +34,11 @@
# #
# [*policy_default_rule*] # [*policy_default_rule*]
# (Optional) Default rule. Enforced when a requested rule is not found. # (Optional) Default rule. Enforced when a requested rule is not found.
# Defaults to $::os_service_default. # Defaults to $facts['os_service_default'].
# #
# [*policy_dirs*] # [*policy_dirs*]
# (Optional) Path to the {{cookiecutter.project_name}} policy folder # (Optional) Path to the {{cookiecutter.project_name}} policy folder
# Defaults to $::os_service_default # Defaults to $facts['os_service_default']
# #
# [*purge_config*] # [*purge_config*]
# (optional) Whether to set only the specified policy rules in the policy # (optional) Whether to set only the specified policy rules in the policy
@ -46,12 +46,12 @@
# Defaults to false. # Defaults to false.
# #
class {{cookiecutter.project_name}}::policy ( class {{cookiecutter.project_name}}::policy (
$enforce_scope = $::os_service_default, $enforce_scope = $facts['os_service_default'],
$enforce_new_defaults = $::os_service_default, $enforce_new_defaults = $facts['os_service_default'],
$policies = {}, $policies = {},
$policy_path = '/etc/{{cookiecutter.project_name}}/policy.yaml', $policy_path = '/etc/{{cookiecutter.project_name}}/policy.yaml',
$policy_default_rule = $::os_service_default, $policy_default_rule = $facts['os_service_default'],
$policy_dirs = $::os_service_default, $policy_dirs = $facts['os_service_default'],
$purge_config = false, $purge_config = false,
) { ) {