Skip to content

Commit

Permalink
Merge pull request #2654 from jeff1evesque/feature-2653
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff1evesque committed Aug 2, 2016
2 parents 8fefcfc + bbfe1d0 commit d0572d1
Show file tree
Hide file tree
Showing 6 changed files with 1,083 additions and 4 deletions.
4 changes: 2 additions & 2 deletions brain/cache/redis_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def __init__(self):
'''

self.host = current_app.config.get('HOST')
self.port = current_app.config.get('PORT_REDIS')
self.host = current_app.config.get('REDIS_HOST')
self.port = current_app.config.get('REDIS_PORT')

def get_host(self):
'''@get_host
Expand Down
3 changes: 2 additions & 1 deletion factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def create_app(args={'prefix': '', 'settings': ''}):
# flask attributes: accessible across application
app.config.update(
HOST=settings['general']['host'],
PORT_REDIS=settings['redis']['port'],
REDIS_HOST=settings['redis']['host'],
REDIS_PORT=settings['redis']['port'],
ROOT=settings['general']['root'],
DB_HOST=settings['database']['host'],
DB_LOG_PATH=settings['database']['log_path'],
Expand Down
5 changes: 4 additions & 1 deletion puppet/environment/docker/manifests/configure_redis.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
###

## install redis-server
include package::redis_server
include package::redis_server

## configure redis-server
include redis::configuration
20 changes: 20 additions & 0 deletions puppet/environment/docker/modules/redis/manifests/configuration.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### Note: the prefix 'database::', corresponds to a puppet convention:
###
### https://github.com/jeff1evesque/machine-learning/issues/2349
###
class redis::configuration {
## variables
$hiera_redis = hiera('redis')
$bind_address = $hiera_redis['bind_address']
$config_file = $hiera_redis['path']
$template_path = 'redis/configuration.erb'

## configure redis-server
file { $config_file:
ensure => file,
owner => 'root',
group => 'root',
content => dos2unix(template($template_path)),
mode => '770',
}
}

0 comments on commit d0572d1

Please sign in to comment.