Skip to content

Commit

Permalink
Fixup for PR 928 - omit priority
Browse files Browse the repository at this point in the history
There were a lot of conflicts in vhost so I updated them manually rather
than in the merge.
  • Loading branch information
Morgan Haskel committed Feb 11, 2015
1 parent 9566fdb commit be8de01
Showing 1 changed file with 48 additions and 46 deletions.
94 changes: 48 additions & 46 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,13 @@

# Configure the defaultness of a vhost
if $priority {
$priority_real = $priority
$priority_real = "${priority}-"
} elsif $priority == false {
$priority_real = ''
} elsif $default_vhost {
$priority_real = '10'
$priority_real = '10-'
} else {
$priority_real = '25'
$priority_real = '25-'
}

## Apache include does not always work with spaces in the filename
Expand All @@ -249,7 +251,7 @@
group => $docroot_group,
mode => $docroot_mode,
require => Package['httpd'],
before => Concat["${priority_real}-${filename}.conf"],
before => Concat["${priority_real}${filename}.conf"],
}
}

Expand All @@ -259,7 +261,7 @@
ensure => $logroot_ensure,
mode => $logroot_mode,
require => Package['httpd'],
before => Concat["${priority_real}-${filename}.conf"],
before => Concat["${priority_real}${filename}.conf"],
}
}

Expand Down Expand Up @@ -436,9 +438,9 @@
}
}

concat { "${priority_real}-${filename}.conf":
concat { "${priority_real}${filename}.conf":
ensure => $ensure,
path => "${::apache::vhost_dir}/${priority_real}-${filename}.conf",
path => "${::apache::vhost_dir}/${priority_real}${filename}.conf",
owner => 'root',
group => $::apache::params::root_group,
mode => '0644',
Expand All @@ -452,14 +454,14 @@
present => link,
default => $ensure,
}
file{ "${priority_real}-${filename}.conf symlink":
file{ "${priority_real}${filename}.conf symlink":
ensure => $vhost_symlink_ensure,
path => "${vhost_enable_dir}/${priority_real}-${filename}.conf",
target => "${::apache::vhost_dir}/${priority_real}-${filename}.conf",
path => "${vhost_enable_dir}/${priority_real}${filename}.conf",
target => "${::apache::vhost_dir}/${priority_real}${filename}.conf",
owner => 'root',
group => $::apache::params::root_group,
mode => '0644',
require => Concat["${priority_real}-${filename}.conf"],
require => Concat["${priority_real}${filename}.conf"],
notify => Class['apache::service'],
}
}
Expand All @@ -469,7 +471,7 @@
# - $servername
# - $serveradmin
concat::fragment { "${name}-apache-header":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 0,
content => template('apache/vhost/_file_header.erb'),
}
Expand All @@ -478,7 +480,7 @@
# - $virtual_docroot
# - $docroot
concat::fragment { "${name}-docroot":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 10,
content => template('apache/vhost/_docroot.erb'),
}
Expand All @@ -487,7 +489,7 @@
# - $aliases
if $aliases and ! empty($aliases) {
concat::fragment { "${name}-aliases":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 20,
content => template('apache/vhost/_aliases.erb'),
}
Expand All @@ -498,7 +500,7 @@
# - $::kernelversion
if $itk and ! empty($itk) {
concat::fragment { "${name}-itk":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 30,
content => template('apache/vhost/_itk.erb'),
}
Expand All @@ -508,7 +510,7 @@
# - $fallbackresource
if $fallbackresource {
concat::fragment { "${name}-fallbackresource":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 40,
content => template('apache/vhost/_fallbackresource.erb'),
}
Expand All @@ -518,7 +520,7 @@
# - $allow_encoded_slashes
if $allow_encoded_slashes {
concat::fragment { "${name}-allow_encoded_slashes":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 50,
content => template('apache/vhost/_allow_encoded_slashes.erb'),
}
Expand All @@ -532,7 +534,7 @@
# - $shibboleth_enabled
if $_directories and ! empty($_directories) {
concat::fragment { "${name}-directories":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 60,
content => template('apache/vhost/_directories.erb'),
}
Expand All @@ -542,7 +544,7 @@
# - $additional_includes
if $additional_includes and ! empty($additional_includes) {
concat::fragment { "${name}-additional_includes":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 70,
content => template('apache/vhost/_additional_includes.erb'),
}
Expand All @@ -555,15 +557,15 @@
# - $log_level
if $error_log or $log_level {
concat::fragment { "${name}-logging":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 80,
content => template('apache/vhost/_logging.erb'),
}
}

# Template uses no variables
concat::fragment { "${name}-serversignature":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 90,
content => template('apache/vhost/_serversignature.erb'),
}
Expand All @@ -577,7 +579,7 @@
# - $access_logs
if $access_log or $access_logs {
concat::fragment { "${name}-access_log":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 100,
content => template('apache/vhost/_access_log.erb'),
}
Expand All @@ -587,7 +589,7 @@
# - $action
if $action {
concat::fragment { "${name}-action":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 110,
content => template('apache/vhost/_action.erb'),
}
Expand All @@ -598,7 +600,7 @@
# - $apache_version
if $block and ! empty($block) {
concat::fragment { "${name}-block":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 120,
content => template('apache/vhost/_block.erb'),
}
Expand All @@ -608,7 +610,7 @@
# - $error_documents
if $error_documents and ! empty($error_documents) {
concat::fragment { "${name}-error_document":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 130,
content => template('apache/vhost/_error_document.erb'),
}
Expand All @@ -621,7 +623,7 @@
# - $no_proxy_uris
if $proxy_dest or $proxy_pass {
concat::fragment { "${name}-proxy":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 140,
content => template('apache/vhost/_proxy.erb'),
}
Expand All @@ -631,7 +633,7 @@
# - $rack_base_uris
if $rack_base_uris {
concat::fragment { "${name}-rack":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 150,
content => template('apache/vhost/_rack.erb'),
}
Expand All @@ -652,7 +654,7 @@
# - $redirectmatch_dest
if ($redirect_source and $redirect_dest) or ($redirectmatch_status and $redirectmatch_regexp and $redirectmatch_dest) {
concat::fragment { "${name}-redirect":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 160,
content => template('apache/vhost/_redirect.erb'),
}
Expand All @@ -665,7 +667,7 @@
# - $rewrite_cond
if $rewrites or $rewrite_rule {
concat::fragment { "${name}-rewrite":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 170,
content => template('apache/vhost/_rewrite.erb'),
}
Expand All @@ -676,7 +678,7 @@
# - $scriptalias
if $scriptaliases and ! empty($scriptaliases) {
concat::fragment { "${name}-scriptalias":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 180,
content => template('apache/vhost/_scriptalias.erb'),
}
Expand All @@ -686,7 +688,7 @@
# - $serveraliases
if $serveraliases and ! empty($serveraliases) {
concat::fragment { "${name}-serveralias":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 190,
content => template('apache/vhost/_serveralias.erb'),
}
Expand All @@ -697,7 +699,7 @@
# - $setenvif
if ($setenv and ! empty($setenv)) or ($setenvif and ! empty($setenvif)) {
concat::fragment { "${name}-setenv":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 200,
content => template('apache/vhost/_setenv.erb'),
}
Expand All @@ -723,7 +725,7 @@
# - $apache_version
if $ssl {
concat::fragment { "${name}-ssl":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 210,
content => template('apache/vhost/_ssl.erb'),
}
Expand All @@ -735,7 +737,7 @@
# - $suphp_configpath
if $suphp_engine == 'on' {
concat::fragment { "${name}-suphp":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 220,
content => template('apache/vhost/_suphp.erb'),
}
Expand All @@ -746,7 +748,7 @@
# - $php_flags
if ($php_values and ! empty($php_values)) or ($php_flags and ! empty($php_flags)) {
concat::fragment { "${name}-php":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 220,
content => template('apache/vhost/_php.erb'),
}
Expand All @@ -757,7 +759,7 @@
# - $php_admin_flags
if ($php_admin_values and ! empty($php_admin_values)) or ($php_admin_flags and ! empty($php_admin_flags)) {
concat::fragment { "${name}-php_admin":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 230,
content => template('apache/vhost/_php_admin.erb'),
}
Expand All @@ -767,7 +769,7 @@
# - $headers
if $headers and ! empty($headers) {
concat::fragment { "${name}-header":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 240,
content => template('apache/vhost/_header.erb'),
}
Expand All @@ -777,7 +779,7 @@
# - $request_headers
if $request_headers and ! empty($request_headers) {
concat::fragment { "${name}-requestheader":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 250,
content => template('apache/vhost/_requestheader.erb'),
}
Expand All @@ -794,7 +796,7 @@
# - $wsgi_pass_authorization
if $wsgi_application_group or $wsgi_daemon_process or ($wsgi_import_script and $wsgi_import_script_options) or $wsgi_process_group or ($wsgi_script_aliases and ! empty($wsgi_script_aliases)) or $wsgi_pass_authorization {
concat::fragment { "${name}-wsgi":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 260,
content => template('apache/vhost/_wsgi.erb'),
}
Expand All @@ -804,7 +806,7 @@
# - $custom_fragment
if $custom_fragment {
concat::fragment { "${name}-custom_fragment":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 270,
content => template('apache/vhost/_custom_fragment.erb'),
}
Expand All @@ -817,7 +819,7 @@
# - $apache_version
if $fastcgi_server or $fastcgi_dir {
concat::fragment { "${name}-fastcgi":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 280,
content => template('apache/vhost/_fastcgi.erb'),
}
Expand All @@ -827,7 +829,7 @@
# - $suexec_user_group
if $suexec_user_group {
concat::fragment { "${name}-suexec":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 290,
content => template('apache/vhost/_suexec.erb'),
}
Expand All @@ -841,7 +843,7 @@
# - $passenger_pre_start
if $passenger_app_root or $passenger_ruby or $passenger_min_instances or $passenger_start_timeout or $passenger_pre_start {
concat::fragment { "${name}-passenger":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 300,
content => template('apache/vhost/_passenger.erb'),
}
Expand All @@ -851,7 +853,7 @@
# - $add_default_charset
if $add_default_charset {
concat::fragment { "${name}-charsets":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 310,
content => template('apache/vhost/_charsets.erb'),
}
Expand All @@ -864,15 +866,15 @@
# - $modsec_body_limit
if $modsec_disable_vhost or $modsec_disable_ids or $modsec_disable_ips {
concat::fragment { "${name}-security":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 320,
content => template('apache/vhost/_security.erb')
}
}

# Template uses no variables
concat::fragment { "${name}-file_footer":
target => "${priority_real}-${filename}.conf",
target => "${priority_real}${filename}.conf",
order => 999,
content => template('apache/vhost/_file_footer.erb'),
}
Expand Down

0 comments on commit be8de01

Please sign in to comment.