-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #32917 - Don't deploy or configure Redis with new tasking system
- Loading branch information
Showing
5 changed files
with
87 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ | |
require => Pulpcore::Admin['migrate --noinput'], | ||
} | ||
|
||
include redis | ||
if $pulpcore::uses_redis { | ||
include redis | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
is_expected.to contain_exec('pulpcore-manager collectstatic --noinput') | ||
end | ||
|
||
it 'configures the database' do | ||
it 'configures the PostgreSQL database' do | ||
is_expected.to contain_class('pulpcore::database') | ||
is_expected.to contain_class('postgresql::server') | ||
is_expected.to contain_postgresql__server__db('pulpcore') | ||
|
@@ -51,6 +51,29 @@ | |
is_expected.to contain_exec('pulpcore-manager reset-admin-password --random') | ||
end | ||
|
||
it 'does not install Redis' do | ||
is_expected.not_to contain_class('redis') | ||
end | ||
|
||
it 'does not configure Pulpcore connection to Redis' do | ||
is_expected.to contain_concat__fragment('base') | ||
.without_content(/REDIS_HOST/) | ||
.without_content(/REDIS_POST/) | ||
.without_content(/REDIS_DB/) | ||
end | ||
|
||
it 'does not configure content caching' do | ||
is_expected.to contain_concat__fragment('base') | ||
.without_content(/CACHE_ENABLED = True/) | ||
.without_content(%r{CACHE_SETTINGS = \{\n 'EXPIRES_TTL': 60,\n\}}) | ||
end | ||
|
||
it 'configures pulpcore to use PostgreSQL tasking system' do | ||
is_expected.to contain_concat__fragment('base') | ||
.with_content(/USE_NEW_WORKER_TYPE = True/) | ||
is_expected.to contain_systemd__unit_file('pulpcore-resource-manager.service').with_ensure('absent') | ||
end | ||
|
||
it 'configures apache' do | ||
is_expected.to contain_class('pulpcore::apache') | ||
is_expected.to contain_apache__vhost('pulpcore') | ||
|
@@ -128,7 +151,6 @@ | |
is_expected.to contain_systemd__unit_file('pulpcore-content.socket') | ||
is_expected.to contain_systemd__unit_file('pulpcore-content.service') | ||
is_expected.to contain_file('/etc/systemd/system/pulpcore-content.socket').that_comes_before('Service[pulpcore-content.service]') | ||
is_expected.to contain_systemd__unit_file('pulpcore-resource-manager.service').with_ensure('absent') | ||
is_expected.to contain_systemd__unit_file('[email protected]') | ||
is_expected.to contain_service("[email protected]").with_ensure(true) | ||
is_expected.not_to contain_service("[email protected]") | ||
|
@@ -491,11 +513,46 @@ | |
} | ||
end | ||
|
||
it do | ||
it 'configures content caching' do | ||
is_expected.to contain_concat__fragment('base') | ||
.with_content(%r{CACHE_ENABLED = True}) | ||
.with_content(/CACHE_ENABLED = True/) | ||
.with_content(%r{CACHE_SETTINGS = \{\n 'EXPIRES_TTL': 60,\n\}}) | ||
end | ||
|
||
it 'installs Redis' do | ||
is_expected.to contain_class('redis') | ||
end | ||
|
||
it 'configures Pulpcore connection to Redis' do | ||
is_expected.to contain_concat__fragment('base') | ||
.with_content(/REDIS_HOST/) | ||
.with_content(/REDIS_PORT/) | ||
.with_content(/REDIS_DB/) | ||
end | ||
end | ||
|
||
context 'can enable RQ tasking system' do | ||
let :params do | ||
{ | ||
use_rq_tasking_system: true, | ||
} | ||
end | ||
|
||
it 'configures RQ tasking system' do | ||
is_expected.to contain_concat__fragment('base') | ||
.with_content(/USE_NEW_WORKER_TYPE = False/) | ||
end | ||
|
||
it 'installs Redis' do | ||
is_expected.to contain_class('redis') | ||
end | ||
|
||
it 'configures Pulpcore connection to Redis' do | ||
is_expected.to contain_concat__fragment('base') | ||
.with_content(/REDIS_HOST/) | ||
.with_content(/REDIS_PORT/) | ||
.with_content(/REDIS_DB/) | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters