Added initial support for MySQL and PostgreSQL database for storeconfigs
This commit is contained in:
parent
6f5f738833
commit
5d4ce37211
2 changed files with 44 additions and 2 deletions
|
@ -173,6 +173,21 @@ class puppet::server {
|
||||||
# Store config type to use. Valid values are "thin", "full" and "none".
|
# Store config type to use. Valid values are "thin", "full" and "none".
|
||||||
# Defaults to "thin".
|
# Defaults to "thin".
|
||||||
#
|
#
|
||||||
|
# $puppet_dbadapter:
|
||||||
|
# Database adapter to use. Defaults to "sqlite3".
|
||||||
|
#
|
||||||
|
# $puppet_dbserver:
|
||||||
|
# Database server address. Defaults to "localhost".
|
||||||
|
#
|
||||||
|
# $puppet_dbname:
|
||||||
|
# Database name. Defaults to "puppet".
|
||||||
|
#
|
||||||
|
# $puppet_dbuser:
|
||||||
|
# Database user name. Defaults to "puppet".
|
||||||
|
#
|
||||||
|
# $puppet_dbpassword:
|
||||||
|
# Database password.
|
||||||
|
#
|
||||||
# $puppet_report_maxage:
|
# $puppet_report_maxage:
|
||||||
# Maximum age (in hours) to keep reports. Defaults to 720 hours (30 days).
|
# Maximum age (in hours) to keep reports. Defaults to 720 hours (30 days).
|
||||||
#
|
#
|
||||||
|
@ -197,6 +212,24 @@ class puppet::server::common inherits puppet::client {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !$puppet_dbadapter {
|
||||||
|
$puppet_dbadapter = "sqlite3"
|
||||||
|
}
|
||||||
|
if $puppet_dbadapter != "sqlite3" {
|
||||||
|
if !$puppet_dbserver {
|
||||||
|
$puppet_dbserver = "localhost"
|
||||||
|
}
|
||||||
|
if !$puppet_dbname {
|
||||||
|
$puppet_dbname = "puppet"
|
||||||
|
}
|
||||||
|
if !$puppet_dbuser {
|
||||||
|
$puppet_dbuser = "puppet"
|
||||||
|
}
|
||||||
|
if !$puppet_dbpassword {
|
||||||
|
fail("\$puppet_dbpassword must be set when using ${puppet_dbadapter}.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
package { "puppetmaster":
|
package { "puppetmaster":
|
||||||
name => $operatingsystem ? {
|
name => $operatingsystem ? {
|
||||||
debian => "puppetmaster",
|
debian => "puppetmaster",
|
||||||
|
|
|
@ -22,7 +22,16 @@
|
||||||
<% if puppet_storeconfigs != 'none' -%>
|
<% if puppet_storeconfigs != 'none' -%>
|
||||||
# Use storeconfigs
|
# Use storeconfigs
|
||||||
storeconfigs = true
|
storeconfigs = true
|
||||||
<% if puppet_storeconfigs == 'thin' %> thin_storeconfigs = true<% end %>
|
<% if puppet_storeconfigs == 'thin' -%>
|
||||||
dbadapter = sqlite3
|
thin_storeconfigs = true
|
||||||
|
<% end -%>
|
||||||
|
dbadapter = <%= puppet_dbadapter %>
|
||||||
|
<% if puppet_dbadapter == 'sqlite3' -%>
|
||||||
dblocation = /srv/puppet/storeconfigs/storeconfigs.db
|
dblocation = /srv/puppet/storeconfigs/storeconfigs.db
|
||||||
|
<% else -%>
|
||||||
|
dbserver = <%= puppet_dbserver %>
|
||||||
|
dbname = <%= puppet_dbname %>
|
||||||
|
dbuser = <%= puppet_dbuser %>
|
||||||
|
dbpassword = <%= puppet_dbpassword %>
|
||||||
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
Loading…
Add table
Reference in a new issue