Support purging local_settings.d
In Debian, some files are installed into local_settings.d by their packages and these conflict with the options added to local_settings. This introduces an option to purge the directory. Change-Id: I7e074f78b15ab22d86d6a6a10f573cfc4052023a
This commit is contained in:
@@ -8,6 +8,13 @@
|
|||||||
# (required) Secret key. This is used by Django to provide cryptographic
|
# (required) Secret key. This is used by Django to provide cryptographic
|
||||||
# signing, and should be set to a unique, unpredictable value.
|
# signing, and should be set to a unique, unpredictable value.
|
||||||
#
|
#
|
||||||
|
# [*package_ensure*]
|
||||||
|
# (optional) Package ensure state. Defaults to 'present'.
|
||||||
|
#
|
||||||
|
# [*purge_conf_d_dir*]
|
||||||
|
# (optional) Purge files in the local_settings.d directory
|
||||||
|
# Defaults to false
|
||||||
|
#
|
||||||
# [*servername*]
|
# [*servername*]
|
||||||
# (optional) FQDN used for the Server Name directives
|
# (optional) FQDN used for the Server Name directives
|
||||||
# Defaults to facts['networking']['fqdn'].
|
# Defaults to facts['networking']['fqdn'].
|
||||||
@@ -24,9 +31,6 @@
|
|||||||
# in vhost.conf.
|
# in vhost.conf.
|
||||||
# Defaults to facts['networking']['fqdn'].
|
# Defaults to facts['networking']['fqdn'].
|
||||||
#
|
#
|
||||||
# [*package_ensure*]
|
|
||||||
# (optional) Package ensure state. Defaults to 'present'.
|
|
||||||
#
|
|
||||||
# [*cache_backend*]
|
# [*cache_backend*]
|
||||||
# (optional) Horizon cache backend.
|
# (optional) Horizon cache backend.
|
||||||
# Defaults: 'django.core.cache.backends.locmem.LocMemCache'
|
# Defaults: 'django.core.cache.backends.locmem.LocMemCache'
|
||||||
@@ -534,6 +538,7 @@
|
|||||||
class horizon(
|
class horizon(
|
||||||
$secret_key,
|
$secret_key,
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
|
Boolean $purge_conf_d_dir = false,
|
||||||
$cache_backend = 'django.core.cache.backends.locmem.LocMemCache',
|
$cache_backend = 'django.core.cache.backends.locmem.LocMemCache',
|
||||||
$cache_options = undef,
|
$cache_options = undef,
|
||||||
$cache_timeout = undef,
|
$cache_timeout = undef,
|
||||||
@@ -723,6 +728,8 @@ class horizon(
|
|||||||
file { $::horizon::params::conf_d_dir:
|
file { $::horizon::params::conf_d_dir:
|
||||||
ensure => 'directory',
|
ensure => 'directory',
|
||||||
mode => '0755',
|
mode => '0755',
|
||||||
|
purge => $purge_conf_d_dir,
|
||||||
|
recurse => $purge_conf_d_dir,
|
||||||
owner => $::horizon::params::wsgi_user,
|
owner => $::horizon::params::wsgi_user,
|
||||||
group => $::horizon::params::wsgi_group,
|
group => $::horizon::params::wsgi_group,
|
||||||
require => Anchor['horizon::config::begin'],
|
require => Anchor['horizon::config::begin'],
|
||||||
|
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The new ``horizon::purge_conf_d_dir`` parameter has been added.
|
@@ -67,6 +67,15 @@ describe 'horizon' do
|
|||||||
expect(content).not_to match(/^SESSION_ENGINE/)
|
expect(content).not_to match(/^SESSION_ENGINE/)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_file(platforms_params[:conf_d_dir]).with(
|
||||||
|
:ensure => 'directory',
|
||||||
|
:mode => '0755',
|
||||||
|
:purge => false,
|
||||||
|
:recurse => false,
|
||||||
|
:owner => platforms_params[:wsgi_user],
|
||||||
|
:group => platforms_params[:wsgi_group],
|
||||||
|
) }
|
||||||
|
|
||||||
it 'creates a key file' do
|
it 'creates a key file' do
|
||||||
is_expected.to contain_file(platforms_params[:secret_key_file]).with(
|
is_expected.to contain_file(platforms_params[:secret_key_file]).with(
|
||||||
:mode => '0600',
|
:mode => '0600',
|
||||||
@@ -82,6 +91,7 @@ describe 'horizon' do
|
|||||||
context 'with overridden parameters' do
|
context 'with overridden parameters' do
|
||||||
before do
|
before do
|
||||||
params.merge!({
|
params.merge!({
|
||||||
|
:purge_conf_d_dir => true,
|
||||||
:cache_backend => 'django.core.cache.backends.memcached.MemcachedCache',
|
:cache_backend => 'django.core.cache.backends.memcached.MemcachedCache',
|
||||||
:cache_timeout => 300,
|
:cache_timeout => 300,
|
||||||
:cache_options => {'SOCKET_TIMEOUT' => 1,'SERVER_RETRIES' => 1,'DEAD_RETRY' => 1},
|
:cache_options => {'SOCKET_TIMEOUT' => 1,'SERVER_RETRIES' => 1,'DEAD_RETRY' => 1},
|
||||||
@@ -212,7 +222,14 @@ describe 'horizon' do
|
|||||||
])
|
])
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_file(platforms_params[:conf_d_dir]).with_ensure('directory') }
|
it { is_expected.to contain_file(platforms_params[:conf_d_dir]).with(
|
||||||
|
:ensure => 'directory',
|
||||||
|
:mode => '0755',
|
||||||
|
:purge => true,
|
||||||
|
:recurse => true,
|
||||||
|
:owner => platforms_params[:wsgi_user],
|
||||||
|
:group => platforms_params[:wsgi_group],
|
||||||
|
) }
|
||||||
it { is_expected.to_not contain_exec('refresh_horizon_django_compress') }
|
it { is_expected.to_not contain_exec('refresh_horizon_django_compress') }
|
||||||
|
|
||||||
it { is_expected.to contain_file(params[:file_upload_temp_dir]) }
|
it { is_expected.to contain_file(params[:file_upload_temp_dir]) }
|
||||||
|
Reference in New Issue
Block a user