Skip to content

Instantly share code, notes, and snippets.

@Alveel
Last active September 26, 2016 12:04
Show Gist options
  • Save Alveel/0e62c92d33ba43aed232a2ae30b5542b to your computer and use it in GitHub Desktop.
Save Alveel/0e62c92d33ba43aed232a2ae30b5542b to your computer and use it in GitHub Desktop.
Tree
/etc/puppet/environments/production/applications/myapplication
manifest/nginx.pp
templates/nginx/rewrites.erb
In the nginx class in nginx.pp
file { $nginx_rules_location:
mode => '0664',
owner => 'liferay',
group => 'liferay',
content => template("${module_name}/nginx/rewrites.erb"),
tag => ['nginx_rules'],
}
@Alveel
Copy link
Author

Alveel commented Sep 26, 2016

Error message:

Error: /Stage[main]/Application_myapp::Env::Nginx/File[/opt/tomcat/sites/liferay/nginx_rules.conf]: Could not evaluate: Could not retrieve file metadata for puppet:///${module_name}/nginx-rewrites: Cannot find file: Invalid mount '${module_name}'

@Alveel
Copy link
Author

Alveel commented Sep 26, 2016

Using puppet-nginx module from https://github.com/Proteon/puppet-nginx

@Alveel
Copy link
Author

Alveel commented Sep 26, 2016

Using content => template("file") instead of source => 'puppet:///file'.

Also using double quotes instead of single, otherwise puppet can't extrapolate ${module_name}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment