Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type reference for create_resources in init.pp using top level namespace causing catalog to fail to compile #550

Closed
skorten opened this issue Jan 21, 2015 · 3 comments · Fixed by #604
Labels
bug Something isn't working

Comments

@skorten
Copy link

skorten commented Jan 21, 2015

Using Puppet v3.2.2 (Puppet Enterprise 3.0.0)...

I have run into an issue where the create_resources for $nginx_vhosts and $nginx_locations (I have not tested the others) fails with the error message:

Error 400 on SERVER: Invalid tag "::nginx::resource::vhost" at /etc/puppetlabs/puppet/environments/r10k/dev_nginx/modules/nginx/manifests/init.pp:297 on node my.node.com

This appears to be caused by the top level name space reference to the type. With the preceding '::' the catalog fails to compile with the above error. With the preceding '::' removed everything works fine. For example:

Top level reference that does not work:

create_resources('::nginx::resource::vhost', $nginx_vhosts, $nginx_vhosts_defaults)

vs. no preceding '::' that does work:

create_resources('nginx::resource::vhost', $nginx_vhosts, $nginx_vhosts_defaults)

Hiera:

nginx::nginx_vhosts:
  'myvhost01':
    ensure: present
    proxy: 'http://127.0.0.1:8080/myapp/'
    proxy_set_header: ['X-Forwarded-For $proxy_add_x_forwarded_for']
    access_log: '/data/logs/nginx/myapp.access.log'

nginx::nginx_locations:
  'system_health0':
    location: '/system_health0/'
    proxy   : 'http://127.0.0.1:8080/myapp/'
    proxy_set_header: ['X-Forwarded-For $proxy_add_x_forwarded_for']
    vhost   : 'myvhost01'

Role:

class role::nginx_tomcat inherits role::base {
  include profile::sysconfig::nginx_cfg
  include profile::sysconfig::tomcat
}

Profile:

class profile::sysconfig::nginx_cfg {
  include ::nginx
}
@ctavan
Copy link

ctavan commented Feb 10, 2015

I can confirm this problem. I have the same problem with puppet 2.7.26.

@3flex
Copy link
Contributor

3flex commented Apr 13, 2015

Without confirming, I believe that's related to this fix to create_resources that was added to Puppet 3.3.0: puppetlabs/puppet#1766

We only test on latest Puppet in Travis, so sorry about that. Will get that change added.

@ctavan
Copy link

ctavan commented Apr 14, 2015

I can confirm that this is not a problem with puppet 3.7.x. Thanks for clarifying.

cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this issue Oct 23, 2017
Slm0n87 pushed a commit to Slm0n87/puppet-nginx that referenced this issue Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants