Update directory structure & allow to configure paths (tmp, log, cache)

This commit is contained in:
Nicolas Le Goff
2014-09-05 11:28:25 +02:00
parent 69fd50906f
commit de7988689e
2201 changed files with 850 additions and 13650 deletions

View File

@@ -0,0 +1,23 @@
Templates
=========
Puppet supports templates and templating via ERB, which is part of the Ruby
standard library and is used for many other projects including Ruby on Rails.
Templates allow you to manage the content of template files, for example
configuration files that cannot yet be managed as a Puppet type. Learn more at
http://projects.puppetlabs.com/projects/puppet/wiki/Puppet_Templating
You can use templates like this:
class myclass {
package { mypackage: ensure => latest }
service { myservice: ensure => running }
file { "/etc/myfile":
content => template("mymodule/myfile.erb")
}
}
The templates are searched for in:
$templatedir/mymodule/myfile.erb
$modulepath/mymodule/templates/myfile.erb

View File

@@ -0,0 +1,5 @@
<%- @environment_variables.keys.sort.each do |key| -%>
<%- if @environment_variables[key] != 'UNSET' -%>
<%= key %>=<%= @environment_variables[key] %>
<%- end -%>
<%- end -%>

View File

@@ -0,0 +1,56 @@
% This file managed by Puppet
% Template Path: <%= @module_name %>/templates/rabbitmq.config
[
{rabbit, [
<% if @ldap_auth -%>
{auth_backends, [rabbit_auth_backend_internal, rabbit_auth_backend_ldap]},
<% end -%>
<% if @config_cluster -%>
{cluster_nodes, {[<%= @r_cluster_nodes.map { |n| "\'rabbit@#{n}\'" }.join(', ') %>], <%= @cluster_node_type %>}},
{cluster_partition_handling, <%= @cluster_partition_handling %>},
<% end -%>
<%- if @ssl_only -%>
{tcp_listeners, []},
<%- end -%>
<%- if @ssl -%>
{ssl_listeners, [<%= @ssl_management_port %>]},
{ssl_options, [{cacertfile,"<%= @ssl_cacert %>"},
{certfile,"<%= @ssl_cert %>"},
{keyfile,"<%= @ssl_key %>"},
{verify,<%= @ssl_verify %>},
{fail_if_no_peer_cert,<%= @ssl_fail_if_no_peer_cert %>}]},
<%- end -%>
<% if @config_variables -%>
<%- @config_variables.keys.sort.each do |key| -%>
{<%= key %>, <%= @config_variables[key] %>},
<%- end -%>
<%- end -%>
{default_user, <<"<%= @default_user %>">>},
{default_pass, <<"<%= @default_pass %>">>}
]}<% if @config_kernel_variables -%>,
{kernel, [
<%= @config_kernel_variables.sort.map{|k,v| "{#{k}, #{v}}"}.join(",\n ") %>
]}
<%- end -%>
<% if @config_stomp -%>,
% Configure the Stomp Plugin listening port
{rabbitmq_stomp, [
{tcp_listeners, [<%= @stomp_port %>]}
<%- if @ssl_stomp_port -%>,
{ssl_listeners, [<%= @ssl_stomp_port %>]}
<%- end -%>
]}
<% end -%>
<%- if @ldap_auth -%>,
% Configure the LDAP authentication plugin
{rabbitmq_auth_backend_ldap, [
{other_bind, anon},
{servers, ["<%= @ldap_server %>"]},
{user_dn_pattern, "<%= @ldap_user_dn_pattern %>"},
{use_ssl, <%= @ldap_use_ssl %>},
{port, <%= @ldap_port %>},
{log, <%= @ldap_log %>}
]}
<%- end -%>
].
% EOF