I was a bit vague in my report initially, will try to clarify.
The error about "undefined method >= for :undef" is due to using
version 1.0.1 of the module which did not have the fix for
MODULES-910. The fact the value was :undef is the other issue.
The error "private method scan called on nil:NilClass" is indeed due
to the $apache_version being undefined, which should not be the case.
The bug I ran into on the stable version of the module would not have
occurred because if that value would have been correctly pulled from
$::apache::apache_version, the value would be 2.2 (CentOS 6.5).
I'm using only Foreman, no Hiera at this time. Here is the relevant
lines outputted by Foreman:
---
classes:
apache:
default_ssl_vhost: true
default_vhost: true
purge_configs: false
server_signature: 'Off'
server_tokens: Prod
trace_enable: 'On'
apache::mod::ssl:
apache::mod::wsgi:
wsgi_socket_prefix: /var/run/wsgi
Using puppetlabs-apache-1.0.1 and the above ENC output, I get the following
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: undefined method `>=' for :undef:Symbol at
/etc/puppet/environments/production/modules/apache/manifests/mod/ssl.pp:35
on node
web01.brazos.tamu.edu
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
(Yes I'm editing production by hand, but this infrastructure is still
non-production :-) )
This change was on the code from puppetlabs-apache-1.0.1 pulled from the forge.
--- production/modules/apache/manifests/mod/ssl.pp.orig 2014-06-24
09:36:57.085572966 -0500
+++ production/modules/apache/manifests/mod/ssl.pp 2014-06-24
09:38:28.356519037 -0500
@@ -1,8 +1,12 @@
class apache::mod::ssl (
$ssl_compression = false,
$ssl_options = [ 'StdEnvVars' ],
- $apache_version = $::apache::apache_version,
) {
+
+ include ::apache
+
+ $apache_version = $::apache::apache_version
+
$session_cache = $::osfamily ? {
'debian' => '${APACHE_RUN_DIR}/ssl_scache(512000)',
'redhat' => '/var/cache/mod_ssl/scache(512000)',
The change above with the same ENC output results in no error.
Here's where things get interesting. If I change my ENC output to
provide no parameters for apache::mod::wsgi, then I end up with all
variables using the $::apache:: reference being 'undef'.
ENC:
---
classes:
apache:
default_ssl_vhost: true
default_vhost: true
purge_configs: false
server_signature: 'Off'
server_tokens: Prod
trace_enable: 'On'
apache::mod::ssl:
apache::mod::wsgi:
Error:
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: Invalid relationship: File[wsgi.conf] { before => File[undef]
}, because File[undef] doesn't seem to be in the catalog
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
That seems like a bug in how Puppet is handling classes defined from an ENC.
Finally, if I go back to stock puppetlabs-apache-1.0.1 and define a
parameter for apache::mode::ssl ...
ENC:
---
classes:
apache:
default_ssl_vhost: true
default_vhost: true
purge_configs: false
server_signature: 'Off'
server_tokens: Prod
trace_enable: 'On'
apache::mod::ssl:
ssl_options:
- StdEnvVars
apache::mod::wsgi:
wsgi_socket_prefix: /var/run/wsgi
NO ERRORS.
Thoughts? It seems as though a class defined by an ENC with no
parameters is treated differently than a class defined with
parameters. I'd expect and thought that a class with no parameters
was called in a similar was as doing "class { 'apache::mod::ssl': }".
Should this be filed as a bug against Puppet?
Thanks,
- Trey
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
>
https://groups.google.com/d/topic/puppet-users/vQRNCDQacOc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
>
puppet-users...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/puppet-users/88895d38-8735-414b-9b53-cec03b8e8166%40googlegroups.com.
>
> For more options, visit
https://groups.google.com/d/optout.