2017-06-30 22:25:10 +03:00
# AWX settings file
import os
2017-08-29 23:14:28 +03:00
def get_secret ( ) :
if os . path . exists ( " /etc/tower/SECRET_KEY " ) :
2019-01-15 01:33:01 +03:00
return open ( ' /etc/tower/SECRET_KEY ' , ' rb ' ) . read ( ) . strip ( )
2017-09-18 22:11:04 +03:00
return os . getenv ( " SECRET_KEY " , " privateawx " )
2017-08-29 23:14:28 +03:00
2017-06-30 22:25:10 +03:00
ADMINS = ( )
STATIC_ROOT = ' /var/lib/awx/public/static '
PROJECTS_ROOT = ' /var/lib/awx/projects '
JOBOUTPUT_ROOT = ' /var/lib/awx/job_status '
2017-08-29 23:14:28 +03:00
SECRET_KEY = get_secret ( )
2017-06-30 22:25:10 +03:00
ALLOWED_HOSTS = [ ' * ' ]
2017-08-29 23:14:28 +03:00
INTERNAL_API_URL = ' http://awxweb:8052 '
2017-06-30 22:25:10 +03:00
2017-08-29 23:14:28 +03:00
# Container environments don't like chroots
AWX_PROOT_ENABLED = False
CLUSTER_HOST_ID = " awx "
SYSTEM_UUID = ' 00000000-0000-0000-0000-000000000000 '
2018-02-28 00:19:46 +03:00
CSRF_COOKIE_SECURE = False
2018-02-28 04:34:28 +03:00
SESSION_COOKIE_SECURE = False
2017-08-29 23:14:28 +03:00
2017-06-30 22:25:10 +03:00
###############################################################################
# EMAIL SETTINGS
###############################################################################
SERVER_EMAIL = ' root@localhost '
DEFAULT_FROM_EMAIL = ' webmaster@localhost '
EMAIL_SUBJECT_PREFIX = ' [AWX] '
EMAIL_HOST = ' localhost '
EMAIL_PORT = 25
EMAIL_HOST_USER = ' '
EMAIL_HOST_PASSWORD = ' '
EMAIL_USE_TLS = False
2017-08-29 23:14:28 +03:00
LOGGING [ ' handlers ' ] [ ' console ' ] = {
' () ' : ' logging.StreamHandler ' ,
' level ' : ' DEBUG ' ,
' formatter ' : ' simple ' ,
}
2017-06-30 22:25:10 +03:00
LOGGING [ ' loggers ' ] [ ' django.request ' ] [ ' handlers ' ] = [ ' console ' ]
LOGGING [ ' loggers ' ] [ ' rest_framework.request ' ] [ ' handlers ' ] = [ ' console ' ]
2018-05-02 22:18:20 +03:00
LOGGING [ ' loggers ' ] [ ' awx ' ] [ ' handlers ' ] = [ ' console ' , ' external_logger ' ]
2017-06-30 22:25:10 +03:00
LOGGING [ ' loggers ' ] [ ' awx.main.commands.run_callback_receiver ' ] [ ' handlers ' ] = [ ' console ' ]
2018-05-02 22:18:20 +03:00
LOGGING [ ' loggers ' ] [ ' awx.main.tasks ' ] [ ' handlers ' ] = [ ' console ' , ' external_logger ' ]
LOGGING [ ' loggers ' ] [ ' awx.main.scheduler ' ] [ ' handlers ' ] = [ ' console ' , ' external_logger ' ]
2017-06-30 22:25:10 +03:00
LOGGING [ ' loggers ' ] [ ' django_auth_ldap ' ] [ ' handlers ' ] = [ ' console ' ]
LOGGING [ ' loggers ' ] [ ' social ' ] [ ' handlers ' ] = [ ' console ' ]
LOGGING [ ' loggers ' ] [ ' system_tracking_migrations ' ] [ ' handlers ' ] = [ ' console ' ]
LOGGING [ ' loggers ' ] [ ' rbac_migrations ' ] [ ' handlers ' ] = [ ' console ' ]
2017-08-29 23:14:28 +03:00
LOGGING [ ' loggers ' ] [ ' awx.isolated.manager.playbooks ' ] [ ' handlers ' ] = [ ' console ' ]
LOGGING [ ' handlers ' ] [ ' callback_receiver ' ] = { ' class ' : ' logging.NullHandler ' }
LOGGING [ ' handlers ' ] [ ' fact_receiver ' ] = { ' class ' : ' logging.NullHandler ' }
LOGGING [ ' handlers ' ] [ ' task_system ' ] = { ' class ' : ' logging.NullHandler ' }
LOGGING [ ' handlers ' ] [ ' tower_warnings ' ] = { ' class ' : ' logging.NullHandler ' }
LOGGING [ ' handlers ' ] [ ' rbac_migrations ' ] = { ' class ' : ' logging.NullHandler ' }
LOGGING [ ' handlers ' ] [ ' system_tracking_migrations ' ] = { ' class ' : ' logging.NullHandler ' }
LOGGING [ ' handlers ' ] [ ' management_playbooks ' ] = { ' class ' : ' logging.NullHandler ' }
2017-06-30 22:25:10 +03:00
DATABASES = {
' default ' : {
' ATOMIC_REQUESTS ' : True ,
2017-11-10 01:17:30 +03:00
' ENGINE ' : ' django.db.backends.postgresql ' ,
2017-06-30 22:25:10 +03:00
' NAME ' : os . getenv ( " DATABASE_NAME " , None ) ,
' USER ' : os . getenv ( " DATABASE_USER " , None ) ,
' PASSWORD ' : os . getenv ( " DATABASE_PASSWORD " , None ) ,
' HOST ' : os . getenv ( " DATABASE_HOST " , None ) ,
' PORT ' : os . getenv ( " DATABASE_PORT " , None ) ,
}
}
2019-01-21 21:47:34 +03:00
if os . getenv ( " DATABASE_SSLMODE " , False ) :
DATABASES [ ' default ' ] [ ' OPTIONS ' ] = { ' sslmode ' : os . getenv ( " DATABASE_SSLMODE " ) }
2018-02-28 20:47:05 +03:00
BROKER_URL = ' amqp:// {} : {} @ {} : {} / {} ' . format (
2017-06-30 22:25:10 +03:00
os . getenv ( " RABBITMQ_USER " , None ) ,
os . getenv ( " RABBITMQ_PASSWORD " , None ) ,
os . getenv ( " RABBITMQ_HOST " , None ) ,
os . getenv ( " RABBITMQ_PORT " , " 5672 " ) ,
os . getenv ( " RABBITMQ_VHOST " , " tower " ) )
CHANNEL_LAYERS = {
2017-11-27 22:34:52 +03:00
' default ' : { ' BACKEND ' : ' asgi_amqp.AMQPChannelLayer ' ,
2017-06-30 22:25:10 +03:00
' ROUTING ' : ' awx.main.routing.channel_routing ' ,
2018-02-28 20:47:05 +03:00
' CONFIG ' : { ' url ' : BROKER_URL } }
2017-06-30 22:25:10 +03:00
}
CACHES = {
' default ' : {
' BACKEND ' : ' django.core.cache.backends.memcached.MemcachedCache ' ,
' LOCATION ' : ' {} : {} ' . format ( os . getenv ( " MEMCACHED_HOST " , None ) ,
os . getenv ( " MEMCACHED_PORT " , " 11211 " ) )
} ,
2017-09-18 19:31:33 +03:00
' ephemeral ' : {
' BACKEND ' : ' django.core.cache.backends.locmem.LocMemCache ' ,
} ,
2017-06-30 22:25:10 +03:00
}
2018-08-07 17:07:06 +03:00
USE_X_FORWARDED_PORT = True