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

Errors & Fails to set file if location name includes a slash #102

Closed
pmgarman opened this issue Jul 30, 2013 · 4 comments
Closed

Errors & Fails to set file if location name includes a slash #102

pmgarman opened this issue Jul 30, 2013 · 4 comments

Comments

@pmgarman
Copy link

nginx::resource::location { '/dir':
    ensure   => present,
    proxy  => 'http://127.0.0.1:2368',
    location => '/dir',
    vhost  => 'domain.com'
}
Error: Could not set 'file' on ensure: No such file or directory - /tmp/nginx.d/domain.com-500-/dir.puppettmp_2073 at 139:/etc/puppet/modules/nginx/manifests/resource/location.pp
Error: Could not set 'file' on ensure: No such file or directory - /tmp/nginx.d/domain.com-500-/dir.puppettmp_2073 at 139:/etc/puppet/modules/nginx/manifests/resource/location.pp

resolved by removing the slash from the name like below.

nginx::resource::location { 'dir':
    ensure   => present,
    proxy  => 'http://127.0.0.1:2368',
    location => '/dir',
    vhost  => 'domain.com'
}
@ghost
Copy link

ghost commented Oct 19, 2013

I just ran into this myself today, and it is needlessly complicating my manifests.

I deny access to a number of directories and in order to keep things short, I'll declare a resource. Something like this:

define foo {
  nginx::resource::location { "${fqdn}-${name}":
      ensure              => present,
      www_root            => "/var/www/${fqdn}",
      location            => "$name",
      vhost               => "$fqdn",
      location_deny       => ["all"],
    }
}

Ideally, I could then do this:

foo{  ["/app/", "/includes/", "/lib/", "/var/export/" ]:  }

Instead, I have to do this:

foo{ "app":
  location=> "/app/"
 }

foo{ "includes":
  location => "/includes/"
} 
 etc...

@jfryman
Copy link
Contributor

jfryman commented Oct 19, 2013

Take a look at the PR I just pushed - does this fix it for you?

@ghost
Copy link

ghost commented Oct 19, 2013

Yep, works like a charm.

@jfryman
Copy link
Contributor

jfryman commented Oct 19, 2013

🤘

cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this issue Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants