diff --git a/manifests/notifier.pp b/manifests/notifier.pp index 017bdfc..82360af 100644 --- a/manifests/notifier.pp +++ b/manifests/notifier.pp @@ -5,42 +5,44 @@ # === Parameters # # [*type*] -# Type of notifier. Use local to run the notifier within the -# engine server. Use remote if the notifier is launched as -# a separate server to process events. +# (Optional) Type of notifier. Use local to run the notifier within +# the engine server. Use remote if the notifier is launched as a separate +# server to process events. # (string value) # Defaults to $::os_service_default. +# # [*host*] -# Name of the notifier node. This can be an opaque -# identifier. It is not necessarily a hostname, -# FQDN, or IP address. +# (Optional) Name of the notifier node. This can be an opaque identifier. +# It is not necessarily a hostname, FQDN, or IP address. # (string value) # Defaults to $::os_service_default. +# # [*topic*] -# The message topic that the notifier server listens on. +# (Optional) The message topic that the notifier server listens on. # (string value) # Defaults to $::os_service_default. +# # [*notify_publishers*] -# List of publishers to publish notification. +# (Optional) List of publishers to publish notification. # Note: This maps to the mistral config option `notify` but this is reserved # in Puppet. # (list of dicts) # Defaults to $::os_service_default. - +# class mistral::notifier( - $type = $::os_service_default, - $host = $::os_service_default, - $topic = $::os_service_default, - $notify_publishers = $::os_service_default, + $type = $::os_service_default, + $host = $::os_service_default, + $topic = $::os_service_default, + $notify_publishers = $::os_service_default, ) { include mistral::deps include mistral::params mistral_config { - 'notifier/type': value => $type; - 'notifier/host': value => $host; - 'notifier/topic': value => $topic; - 'notifier/notify': value => $notify_publishers; + 'notifier/type': value => $type; + 'notifier/host': value => $host; + 'notifier/topic': value => $topic; + 'notifier/notify': value => $notify_publishers; } } diff --git a/spec/classes/mistral_notifier_spec.rb b/spec/classes/mistral_notifier_spec.rb index 5fd1aad..6ab1880 100644 --- a/spec/classes/mistral_notifier_spec.rb +++ b/spec/classes/mistral_notifier_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'mistral::notifier' do - shared_examples_for 'mistral notifier' do + shared_examples_for 'mistral::notifier' do it 'configure notifier default params' do is_expected.to contain_mistral_config('notifier/type').with_value('') is_expected.to contain_mistral_config('notifier/host').with_value('') @@ -12,9 +12,9 @@ describe 'mistral::notifier' do context 'with specific parameters' do let :params do - { :type => "remote", - :host => "localhost", - :topic => "mistral-event-stream", + { :type => "remote", + :host => "localhost", + :topic => "mistral-event-stream", :notify_publishers => "[{'type': 'noop'}]", } end @@ -36,7 +36,7 @@ describe 'mistral::notifier' do facts.merge!(OSDefaults.get_facts()) end - it_configures 'mistral notifier' + it_configures 'mistral::notifier' end end