So let me try this again. Here is the full init.pp and spec file being used. The setup is very simple. Likewise it does't matter if the *$sshd_hostkey_rhel_cent_7 *is setup as a smart parameter or set inside the module itself, the error "*Evaluation Error: Error while evaluating a Function Call, no implicit conversion of Hash into String at line 2:1 on node*" persists relative to where the array is defined.
*Note: I attached the templates/sshd_config.erb* *for brevity.* I find this quite perplexing as the array is defined properly and when I run t on a CentOS 7 / RHEL 7 box, via puppet apply, I have no errors. This happens on my dev Foreman/Puppet 4 server and on a stand-along VM spun up just to verify this behavior persists on a clean install of the puppet agent and gems to do spec testing. (*Output of puppet apply the end of the post)* *manifests/init.pp (ssh)* # Class: ssh # # This module manages ssh # # Parameters: none # # Actions: # # Requires: see Modulefile # # Sample Usage: # class ssh () { } class ssh::sshd_config ( # Hostkey setting for CentOS / RHEL 7 $sshd_hostkey_rhel_cent_7 = [ '# HostKey for protocol version 1', '#HostKey /etc/ssh/ssh_host_key', '# HostKeys for protocol version 2', 'HostKey /etc/ssh/ssh_host_rsa_key', '#HostKey /etc/ssh/ssh_host_dsa_key', 'HostKey /etc/ssh/ssh_host_ecdsa_key', 'HostKey /etc/ssh/ssh_host_ed25519_key', ] ) { # Setup sshd_config file for SUSE, RedHat, CentOS include ssh # Get OS Major version as it differs from facter versions # and lsbdist pacakges not installed on RedHat by default $osver = split($::operatingsystemrelease, '[.]') $osmajver = $osver[0] case $::facts['operatingsystem'] { 'RHEL', 'CentOS', 'RedHat' : { $sshd_sftp_subsystem = "/usr/libexec/openssh/sftp-server" $sshd_syslogfacility = "SyslogFacility AUTHPRIV" if $::facts['$operatingsystemrelease'] >= "7" { # CentOS / RedHat 7 + $sshd_hostkey = $sshd_hostkey_rhel_cent_7 } else { $sshd_hostkey = "# Hostkey not set in RH/CentOS under version 7" } } # RHEL, CENTOS 'SLES' : { $sshd_hostkey = "# HostKey not set in SUSE" $sshd_sftp_subsystem = "/usr/lib64/ssh/sftp-server" $sshd_syslogfacility = "# SyslogFacility not set in SUSE" } default : { $sshd_sftp_subsystem = "/usr/libexec/openssh/sftp-server" $sshd_syslogfacility = "SyslogFacility AUTHPRIV" $sshd_hostkey = "# Hostkey not set in Default section of case statement" } } file { "sshdconfig": ensure => present, path => "/etc/ssh/sshd_config", owner => "root", group => "root", mode => "0600", content => template("ssh/sshd_config.erb"), before => Service['sshd'], } service { "sshd": ensure => running, name => "sshd", enable => true, subscribe => File["sshdconfig"], } } *spec/classes/init_spec.rb* require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-utils' require 'hiera-puppet-helper' require 'spec_helper' require 'facter' describe 'ssh::sshd_config' do let :facts do { :operatingsystemrelease => "7.3.1611s" } end it { is_expected.to contain_file('sshdconfig') } it { is_expected.to contain_service('sshd') } end *spec/spec_helper:* require 'puppetlabs_spec_helper/module_spec_helper' ---------------------------------------------- So if in manifests/init.pp I comment out lines 18-26 and 44: class ssh::sshd_config ( # Hostkey setting for CentOS / RHEL 7 *# $sshd_hostkey_rhel_cent_7 = [* *# '# HostKey for protocol version 1',* *# '#HostKey /etc/ssh/ssh_host_key',* *# '# HostKeys for protocol version 2',* *# 'HostKey /etc/ssh/ssh_host_rsa_key',* *# '#HostKey /etc/ssh/ssh_host_dsa_key',* *# 'HostKey /etc/ssh/ssh_host_ecdsa_key',* *# 'HostKey /etc/ssh/ssh_host_ed25519_key',* *# ]* * ) {* # Setup sshd_config file for SUSE, RedHat, CentOS include ssh ... # CentOS / RedHat 7 + * # $sshd_hostkey = $sshd_hostkey_rhel_cent_7* ... Then run *rake spec* I get: /usr/bin/ruby -I/usr/local/share/gems/gems/rspec-core-3.6.0/lib:/usr/local/share/gems/gems/rspec-support-3.6.0/lib /usr/local/share/gems/gems/rspec-core-3.6.0/exe/rspec --pattern spec/\{aliases,classes,defines,unit,functions,hosts,integration,type_aliases,types\}/\*\*/\*_spec.rb --color ssh::sshd_config should contain File[sshdconfig] should contain Service[sshd] Finished in 0.78541 seconds (files took 1.7 seconds to load) 2 examples, 0 failures ----------------------------- If I run the original init.pp above, i get the following when I run *rake spec* # rake spec I, [2017-08-18T09:22:52.855739 #30964] INFO -- : Creating symlink from spec/fixtures/modules/ssh to /etc/puppetlabs/code/environments/aspera/modules/ssh Notice: Preparing to install into /etc/puppetlabs/code/environments/aspera/modules/ssh/spec/fixtures/modules ... Notice: Downloading from https://forgeapi.puppet.com ... Notice: Installing -- do not interrupt ... /etc/puppetlabs/code/environments/aspera/modules/ssh/spec/fixtures/modules └── puppetlabs-stdlib (v4.17.1) /usr/bin/ruby -I/usr/local/share/gems/gems/rspec-core-3.6.0/lib:/usr/local/share/gems/gems/rspec-support-3.6.0/lib /usr/local/share/gems/gems/rspec-core-3.6.0/exe/rspec --pattern spec/\{aliases,classes,defines,unit,functions,hosts,integration,type_aliases,types\}/\*\*/\*_spec.rb --color ssh::sshd_config should contain File[sshdconfig] (FAILED - 1) should contain Service[sshd] (FAILED - 2) Failures: 1) ssh::sshd_config should contain File[sshdconfig] Failure/Error: it { is_expected.to contain_file('sshdconfig') } Puppet::PreformattedError: *Evaluation Error: Error while evaluating a Function Call, no implicit conversion of Hash into String at line 2:1 on node mynode.example.com* # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:213:in `initialize' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:213:in `new' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:213:in `global_hiera_config_path' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/invocation.rb:224:in `global_hiera_config_path' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/global_data_provider.rb:71:in `configuration_path' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/configured_data_provider.rb:16:in `config' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/global_data_provider.rb:13:in `unchecked_key_lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/data_provider.rb:41:in `block in key_lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/invocation.rb:90:in `check' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/data_provider.rb:41:in `key_lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:76:in `lookup_global' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:316:in `block in global_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:316:in `catch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:316:in `global_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:325:in `env_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:291:in `block (2 levels) in retrieve_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/invocation.rb:129:in `with' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:287:in `block in retrieve_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/invocation.rb:75:in `lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:286:in `retrieve_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:181:in `lookup_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:166:in `lookup_merge_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:58:in `block in lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/invocation.rb:75:in `lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:50:in `lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup.rb:76:in `search_and_merge' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:401:in `block (2 levels) in inject_external_parameters' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:400:in `catch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:400:in `block in inject_external_parameters' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:396:in `each' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:396:in `inject_external_parameters' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:363:in `set_resource_parameters' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:171:in `evaluate_code' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/resource.rb:81:in `block in evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler/around_profiler.rb:58:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler.rb:51:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/resource.rb:73:in `evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:395:in `each' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:395:in `evaluate_classes' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/loader/../../../puppet/functions/include.rb:16:in `include' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/dispatch.rb:60:in `invoke' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/dispatcher.rb:43:in `block in dispatch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/dispatcher.rb:42:in `catch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/dispatcher.rb:42:in `dispatch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/function.rb:46:in `block in call' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/function.rb:45:in `catch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/function.rb:45:in `call' # :2:in `block in call_function' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/runtime3_support.rb:313:in `eval' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/runtime3_support.rb:313:in `block in call_function' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler/around_profiler.rb:58:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler.rb:51:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/runtime3_support.rb:311:in `call_function' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/evaluator_impl.rb:941:in `call_function_with_block' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/evaluator_impl.rb:910:in `eval_CallNamedFunctionExpression' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/visitor.rb:48:in `block in visit_this' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/visitor.rb:42:in `each' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/visitor.rb:42:in `visit_this' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/visitor.rb:71:in `visit_this_1' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/evaluator_impl.rb:82:in `evaluate' # :in `stack' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/puppet_stack.rb:30:in `eval' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/puppet_stack.rb:30:in `stack' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/evaluator_impl.rb:715:in `eval_Program' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/visitor.rb:48:in `block in visit_this' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/visitor.rb:42:in `each' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/visitor.rb:42:in `visit_this' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/visitor.rb:71:in `visit_this_1' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/evaluator_impl.rb:82:in `evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/parser/evaluating_parser.rb:63:in `evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/ast/pops_bridge.rb:132:in `evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/ast.rb:31:in `safeevaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:184:in `evaluate_code' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/resource.rb:81:in `block in evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler/around_profiler.rb:58:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler.rb:51:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/resource.rb:73:in `evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:635:in `evaluate_main' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:174:in `block (2 levels) in compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler/around_profiler.rb:58:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler.rb:51:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:174:in `block in compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/context.rb:65:in `override' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet.rb:306:in `override' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:162:in `compile' # /usr/local/share/gems/gems/hiera-puppet-helper-1.0.1/lib/hiera-puppet-helper/puppet.rb:16:in `compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:33:in `compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/indirector/catalog/compiler.rb:268:in `block (2 levels) in compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler/around_profiler.rb:58:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler.rb:51:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/indirector/catalog/compiler.rb:266:in `block in compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util.rb:224:in `block in benchmark' # /usr/share/ruby/benchmark.rb:296:in `realtime' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util.rb:223:in `benchmark' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/indirector/catalog/compiler.rb:264:in `compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/indirector/catalog/compiler.rb:55:in `find' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/indirector/indirection.rb:194:in `find' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/adapters.rb:83:in `catalog' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/adapters.rb:161:in `catalog' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:354:in `build_catalog_without_cache' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:375:in `block in build_catalog' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/cache.rb:17:in `call' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/cache.rb:17:in `get' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:374:in `build_catalog' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:75:in `block in load_catalogue' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:319:in `with_vardir' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:69:in `load_catalogue' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/example/class_example_group.rb:7:in `catalogue' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:10:in `block in subject' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/matchers/create_generic.rb:84:in `call' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/matchers/create_generic.rb:84:in `matches?' # ./spec/classes/init_spec.rb:12:in `block (2 levels) in <top (required)>' 2) ssh::sshd_config should contain Service[sshd] Failure/Error: it { is_expected.to contain_service('sshd') } Puppet::PreformattedError: * Evaluation Error: Error while evaluating a Function Call, no implicit conversion of Hash into String at line 2:1 on node mynode.example.com* # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:213:in `initialize' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:213:in `new' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:213:in `global_hiera_config_path' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/invocation.rb:224:in `global_hiera_config_path' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/global_data_provider.rb:71:in `configuration_path' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/configured_data_provider.rb:16:in `config' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/global_data_provider.rb:13:in `unchecked_key_lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/data_provider.rb:41:in `block in key_lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/invocation.rb:90:in `check' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/data_provider.rb:41:in `key_lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:76:in `lookup_global' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:316:in `block in global_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:316:in `catch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:316:in `global_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:325:in `env_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:291:in `block (2 levels) in retrieve_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/invocation.rb:129:in `with' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:287:in `block in retrieve_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/invocation.rb:75:in `lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:286:in `retrieve_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:181:in `lookup_lookup_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:166:in `lookup_merge_options' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:58:in `block in lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/invocation.rb:75:in `lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup/lookup_adapter.rb:50:in `lookup' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/lookup.rb:76:in `search_and_merge' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:401:in `block (2 levels) in inject_external_parameters' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:400:in `catch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:400:in `block in inject_external_parameters' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:396:in `each' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:396:in `inject_external_parameters' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:363:in `set_resource_parameters' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:171:in `evaluate_code' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/resource.rb:81:in `block in evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler/around_profiler.rb:58:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler.rb:51:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/resource.rb:73:in `evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:395:in `each' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:395:in `evaluate_classes' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/loader/../../../puppet/functions/include.rb:16:in `include' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/dispatch.rb:60:in `invoke' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/dispatcher.rb:43:in `block in dispatch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/dispatcher.rb:42:in `catch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/dispatcher.rb:42:in `dispatch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/function.rb:46:in `block in call' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/function.rb:45:in `catch' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/functions/function.rb:45:in `call' # :2:in `block in call_function' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/runtime3_support.rb:313:in `eval' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/runtime3_support.rb:313:in `block in call_function' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler/around_profiler.rb:58:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler.rb:51:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/runtime3_support.rb:311:in `call_function' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/evaluator_impl.rb:941:in `call_function_with_block' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/evaluator_impl.rb:910:in `eval_CallNamedFunctionExpression' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/visitor.rb:69:in `visit_this_1' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/evaluator_impl.rb:82:in `evaluate' # :in `stack' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/puppet_stack.rb:30:in `eval' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/puppet_stack.rb:30:in `stack' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/evaluator_impl.rb:715:in `eval_Program' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/visitor.rb:69:in `visit_this_1' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/evaluator/evaluator_impl.rb:82:in `evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/pops/parser/evaluating_parser.rb:63:in `evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/ast/pops_bridge.rb:132:in `evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/ast.rb:31:in `safeevaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/resource/type.rb:184:in `evaluate_code' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/resource.rb:81:in `block in evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler/around_profiler.rb:58:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler.rb:51:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/resource.rb:73:in `evaluate' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:635:in `evaluate_main' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:174:in `block (2 levels) in compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler/around_profiler.rb:58:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler.rb:51:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:174:in `block in compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/context.rb:65:in `override' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet.rb:306:in `override' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:162:in `compile' # /usr/local/share/gems/gems/hiera-puppet-helper-1.0.1/lib/hiera-puppet-helper/puppet.rb:16:in `compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/parser/compiler.rb:33:in `compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/indirector/catalog/compiler.rb:268:in `block (2 levels) in compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler/around_profiler.rb:58:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util/profiler.rb:51:in `profile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/indirector/catalog/compiler.rb:266:in `block in compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util.rb:224:in `block in benchmark' # /usr/share/ruby/benchmark.rb:296:in `realtime' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/util.rb:223:in `benchmark' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/indirector/catalog/compiler.rb:264:in `compile' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/indirector/catalog/compiler.rb:55:in `find' # /usr/local/share/gems/gems/puppet-4.10.4/lib/puppet/indirector/indirection.rb:194:in `find' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/adapters.rb:83:in `catalog' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/adapters.rb:161:in `catalog' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:354:in `build_catalog_without_cache' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:375:in `block in build_catalog' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/cache.rb:17:in `call' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/cache.rb:17:in `get' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:374:in `build_catalog' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:75:in `block in load_catalogue' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:319:in `with_vardir' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:69:in `load_catalogue' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/example/class_example_group.rb:7:in `catalogue' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/support.rb:10:in `block in subject' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/matchers/create_generic.rb:84:in `call' # /usr/local/share/gems/gems/rspec-puppet-2.6.7/lib/rspec-puppet/matchers/create_generic.rb:84:in `matches?' # ./spec/classes/init_spec.rb:13:in `block (2 levels) in <top (required)>' Finished in 0.38469 seconds (files took 1.91 seconds to load) 2 examples, 2 failures Failed examples: rspec ./spec/classes/init_spec.rb:12 # ssh::sshd_config should contain File[sshdconfig] rspec ./spec/classes/init_spec.rb:13 # ssh::sshd_config should contain Service[sshd] /usr/bin/ruby -I/usr/local/share/gems/gems/rspec-core-3.6.0/lib:/usr/local/share/gems/gems/rspec-support-3.6.0/lib /usr/local/share/gems/gems/rspec-core-3.6.0/exe/rspec --pattern spec/\{aliases,classes,defines,unit,functions,hosts,integration,type_aliases,types\}/\*\*/\*_spec.rb --color failed ---------------------------------------------- For puppet apply: *I added 3 blank lines to end of /etc/ssh/sshd_config to force an update. * # cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) # /opt/puppetlabs/bin/puppet apply --environment sshtesting -tv --noop manifests/init.pp -e "include ssh::sshd_config" Info: Loading facts Info: Loading facts Info: Loading facts Info: Loading facts Info: Loading facts Info: Loading facts Notice: Compiled catalog for dlistmrfpup02.cbs.ad.cbs.net in environment aspera in 0.16 seconds Info: Applying configuration version '1503063783' Notice: /Stage[main]/Ssh::Sshd_config/File[sshdconfig]/content: --- /etc/ssh/sshd_config 2017-08-18 09:39:43.684192737 -0400 +++ /tmp/puppet-file20170818-1934-9a0w0g 2017-08-18 09:43:03.902131458 -0400 @@ -160,6 +160,3 @@ # AllowTcpForwarding no # PermitTTY no # ForceCommand cvs server - - - Notice: /Stage[main]/Ssh::Sshd_config/File[sshdconfig]/content: current_value {md5}0744515e169813a221830e894399bfb0, should be {md5}568f923999a863de160ae981aa8db81a (noop) Info: /Stage[main]/Ssh::Sshd_config/File[sshdconfig]: Scheduling refresh of Service[sshd] Notice: /Stage[main]/Ssh::Sshd_config/Service[sshd]: Would have triggered 'refresh' from 1 events Notice: Class[Ssh::Sshd_config]: Would have triggered 'refresh' from 2 events Notice: Stage[main]: Would have triggered 'refresh' from 1 events Notice: Applied catalog in 0.27 seconds -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/6b5cb80e-23d4-4d1d-8406-036fae1ce0bc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
sshd_config.erb
Description: Binary data