From 7e284e0c4ab99c7c8aee9da6d90809e7b3d45776 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Thu, 17 Jul 2014 14:02:56 -0500 Subject: [PATCH 1/4] Theoretical move from /etc/awx/ to /etc/tower/. --- awx/main/management/commands/run_socketio_service.py | 4 ++-- awx/settings/development.py | 4 ++-- awx/settings/production.py | 12 ++++++------ awx/ui/static/js/helpers/Access.js | 4 ++-- config/awx-httpd-443.conf | 4 ++-- setup.py | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/awx/main/management/commands/run_socketio_service.py b/awx/main/management/commands/run_socketio_service.py index 50602dc309..bf8b0b5053 100644 --- a/awx/main/management/commands/run_socketio_service.py +++ b/awx/main/management/commands/run_socketio_service.py @@ -110,10 +110,10 @@ class Command(NoArgsCommand): socketio_notification_port = settings.SOCKETIO_NOTIFICATION_PORT try: - if os.path.exists('/etc/awx/awx.cert') and os.path.exists('/etc/awx/awx.key'): + if os.path.exists('/etc/tower/awx.cert') and os.path.exists('/etc/tower/awx.key'): print 'Listening on port https://0.0.0.0:' + str(socketio_listen_port) server = SocketIOServer(('0.0.0.0', socketio_listen_port), TowerSocket(), resource='socket.io', - keyfile='/etc/awx/awx.key', certfile='/etc/awx/awx.cert') + keyfile='/etc/tower/awx.key', certfile='/etc/tower/awx.cert') else: print 'Listening on port http://0.0.0.0:' + str(socketio_listen_port) server = SocketIOServer(('0.0.0.0', socketio_listen_port), TowerSocket(), resource='socket.io') diff --git a/awx/settings/development.py b/awx/settings/development.py index ba6cb1362f..f9621fcf07 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -47,8 +47,8 @@ if 'django_jenkins' in INSTALLED_APPS: JSHINT_CHECKED_FILES = [os.path.join(BASE_DIR, 'ui/static/js'), os.path.join(BASE_DIR, 'ui/static/lib/ansible'),] -# If there is an `/etc/awx/settings.py`, include it. -include(optional('/etc/awx/settings.py'), scope=locals()) +# If there is an `/etc/tower/settings.py`, include it. +include(optional('/etc/tower/settings.py'), scope=locals()) # If any local_*.py files are present in awx/settings/, use them to override # default settings for development. If not present, we can still run using diff --git a/awx/settings/production.py b/awx/settings/production.py index 66ea2fb8c4..dbeecbb82b 100644 --- a/awx/settings/production.py +++ b/awx/settings/production.py @@ -54,17 +54,17 @@ LOGGING['handlers']['rotating_file'] = { } # Load settings from any .py files in the global conf.d directory specified in -# the environment, defaulting to /etc/awx/conf.d/. -settings_dir = os.environ.get('AWX_SETTINGS_DIR', '/etc/awx/conf.d/') +# the environment, defaulting to /etc/tower/conf.d/. +settings_dir = os.environ.get('AWX_SETTINGS_DIR', '/etc/tower/conf.d/') settings_files = os.path.join(settings_dir, '*.py') # Load remaining settings from the global settings file specified in the -# environment, defaulting to /etc/awx/settings.py. +# environment, defaulting to /etc/tower/settings.py. settings_file = os.environ.get('AWX_SETTINGS_FILE', - '/etc/awx/settings.py') + '/etc/tower/settings.py') -# Attempt to load settings from /etc/awx/settings.py first, followed by -# /etc/awx/conf.d/*.py. +# Attempt to load settings from /etc/tower/settings.py first, followed by +# /etc/tower/conf.d/*.py. try: include( settings_file, diff --git a/awx/ui/static/js/helpers/Access.js b/awx/ui/static/js/helpers/Access.js index 878f636eb7..3053e647dd 100644 --- a/awx/ui/static/js/helpers/Access.js +++ b/awx/ui/static/js/helpers/Access.js @@ -69,7 +69,7 @@ angular.module('AccessHelper', ['RestServices', 'Utilities', 'ngCookies']) // The license is invalid. Stop the user from logging in. status = 'alert-danger'; hdr = 'License Error'; - msg = '

There is a problem with the /etc/awx/license file on your Tower server. Check to make sure Tower can access ' + + msg = '

There is a problem with the /etc/tower/license file on your Tower server. Check to make sure Tower can access ' + 'the file.

' + purchase_msg; Alert(hdr, msg, status, null, false, true); } else if (license.demo !== undefined && license.demo === true) { @@ -103,4 +103,4 @@ angular.module('AccessHelper', ['RestServices', 'Utilities', 'ngCookies']) } }; } -]); \ No newline at end of file +]); diff --git a/config/awx-httpd-443.conf b/config/awx-httpd-443.conf index e74e19f199..e924b337e3 100644 --- a/config/awx-httpd-443.conf +++ b/config/awx-httpd-443.conf @@ -7,8 +7,8 @@ WSGISocketPrefix /var/run/wsgi ServerAlias * DocumentRoot /var/lib/awx/public SSLEngine on - SSLCertificateFile /etc/awx/awx.cert - SSLCertificateKeyFile /etc/awx/awx.key + SSLCertificateFile /etc/tower/awx.cert + SSLCertificateKeyFile /etc/tower/awx.key WSGIScriptAlias / /var/lib/awx/wsgi.py WSGIPassAuthorization On diff --git a/setup.py b/setup.py index 5fd2ee3665..33468dc71d 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from awx import __version__ build_timestamp = os.getenv("BUILD",datetime.datetime.now().strftime('-%Y%m%d%H%M')) # Paths we'll use later -etcpath = "/etc/awx" +etcpath = "/etc/tower" homedir = "/var/lib/awx" sharedir = "/usr/share/awx" if os.path.exists("/etc/debian_version"): From 3b45252039927415a50e5980aba8e6cb43591e5b Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Thu, 17 Jul 2014 14:02:56 -0500 Subject: [PATCH 2/4] Theoretical move from /etc/awx/ to /etc/tower/. --- awx/main/management/commands/run_socketio_service.py | 4 ++-- awx/settings/development.py | 4 ++-- awx/settings/production.py | 12 ++++++------ config/awx-httpd-443.conf | 4 ++-- setup.py | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/awx/main/management/commands/run_socketio_service.py b/awx/main/management/commands/run_socketio_service.py index 50602dc309..bf8b0b5053 100644 --- a/awx/main/management/commands/run_socketio_service.py +++ b/awx/main/management/commands/run_socketio_service.py @@ -110,10 +110,10 @@ class Command(NoArgsCommand): socketio_notification_port = settings.SOCKETIO_NOTIFICATION_PORT try: - if os.path.exists('/etc/awx/awx.cert') and os.path.exists('/etc/awx/awx.key'): + if os.path.exists('/etc/tower/awx.cert') and os.path.exists('/etc/tower/awx.key'): print 'Listening on port https://0.0.0.0:' + str(socketio_listen_port) server = SocketIOServer(('0.0.0.0', socketio_listen_port), TowerSocket(), resource='socket.io', - keyfile='/etc/awx/awx.key', certfile='/etc/awx/awx.cert') + keyfile='/etc/tower/awx.key', certfile='/etc/tower/awx.cert') else: print 'Listening on port http://0.0.0.0:' + str(socketio_listen_port) server = SocketIOServer(('0.0.0.0', socketio_listen_port), TowerSocket(), resource='socket.io') diff --git a/awx/settings/development.py b/awx/settings/development.py index ba6cb1362f..f9621fcf07 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -47,8 +47,8 @@ if 'django_jenkins' in INSTALLED_APPS: JSHINT_CHECKED_FILES = [os.path.join(BASE_DIR, 'ui/static/js'), os.path.join(BASE_DIR, 'ui/static/lib/ansible'),] -# If there is an `/etc/awx/settings.py`, include it. -include(optional('/etc/awx/settings.py'), scope=locals()) +# If there is an `/etc/tower/settings.py`, include it. +include(optional('/etc/tower/settings.py'), scope=locals()) # If any local_*.py files are present in awx/settings/, use them to override # default settings for development. If not present, we can still run using diff --git a/awx/settings/production.py b/awx/settings/production.py index 2341e607f7..814553131c 100644 --- a/awx/settings/production.py +++ b/awx/settings/production.py @@ -55,17 +55,17 @@ LOGGING['handlers']['rotating_file'] = { } # Load settings from any .py files in the global conf.d directory specified in -# the environment, defaulting to /etc/awx/conf.d/. -settings_dir = os.environ.get('AWX_SETTINGS_DIR', '/etc/awx/conf.d/') +# the environment, defaulting to /etc/tower/conf.d/. +settings_dir = os.environ.get('AWX_SETTINGS_DIR', '/etc/tower/conf.d/') settings_files = os.path.join(settings_dir, '*.py') # Load remaining settings from the global settings file specified in the -# environment, defaulting to /etc/awx/settings.py. +# environment, defaulting to /etc/tower/settings.py. settings_file = os.environ.get('AWX_SETTINGS_FILE', - '/etc/awx/settings.py') + '/etc/tower/settings.py') -# Attempt to load settings from /etc/awx/settings.py first, followed by -# /etc/awx/conf.d/*.py. +# Attempt to load settings from /etc/tower/settings.py first, followed by +# /etc/tower/conf.d/*.py. try: include( settings_file, diff --git a/config/awx-httpd-443.conf b/config/awx-httpd-443.conf index 29f1af4d0a..bf86166957 100644 --- a/config/awx-httpd-443.conf +++ b/config/awx-httpd-443.conf @@ -7,8 +7,8 @@ WSGISocketPrefix /var/run/wsgi ServerAlias * DocumentRoot /var/lib/awx/public SSLEngine on - SSLCertificateFile /etc/awx/awx.cert - SSLCertificateKeyFile /etc/awx/awx.key + SSLCertificateFile /etc/tower/awx.cert + SSLCertificateKeyFile /etc/tower/awx.key WSGIScriptAlias / /var/lib/awx/wsgi.py WSGIPassAuthorization On diff --git a/setup.py b/setup.py index 484f537f2d..07a6a96679 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from awx import __version__ build_timestamp = os.getenv("BUILD",datetime.datetime.now().strftime('-%Y%m%d%H%M')) # Paths we'll use later -etcpath = "/etc/awx" +etcpath = "/etc/tower" homedir = "/var/lib/awx" sharedir = "/usr/share/awx" munin_plugin_path = "/etc/munin/plugins/" From 6d65423a8c437c9b59719185ddd97678b1eeba04 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Fri, 22 Aug 2014 12:33:00 -0400 Subject: [PATCH 3/4] Make the /etc/awx/ migration more permissive for one run. --- awx/settings/production.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/settings/production.py b/awx/settings/production.py index 814553131c..e53ba5e703 100644 --- a/awx/settings/production.py +++ b/awx/settings/production.py @@ -32,7 +32,7 @@ SECRET_KEY = None ALLOWED_HOSTS = [] # Production should only use minified JS for UI. -USE_MINIFIED_JS = True +USE_MINIFIED_JS = True # URL used by inventory script and callback plugin to access API. INTERNAL_API_URL = 'http://127.0.0.1:80' @@ -81,7 +81,7 @@ except IOError: if (not included_file or included_file == settings_file): # The import doesn't always give permission denied, so try to open the # settings file directly. - try: + try: e = None open(settings_file) except IOError, e: From deaf54f2d71128ba91f35ec1a438b4ce7766fe91 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Mon, 25 Aug 2014 12:31:18 -0400 Subject: [PATCH 4/4] Migrating logs to /var/log/tower/. --- .gitignore | 1 + awx/settings/production.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c61b0d9786..0af931fd9d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ awx/ui/static/js/local_config.js awx/ui/static/css/awx.min.css awx/main/fixtures awx/tower_warnings.log +tower/tower_warnings.log celerybeat-schedule # Python & setuptools diff --git a/awx/settings/production.py b/awx/settings/production.py index e53ba5e703..9ded1f47ca 100644 --- a/awx/settings/production.py +++ b/awx/settings/production.py @@ -48,7 +48,7 @@ LOGGING['handlers']['rotating_file'] = { 'level': 'WARNING', 'class':'logging.handlers.RotatingFileHandler', 'filters': ['require_debug_false'], - 'filename': '/var/log/awx/tower_warnings.log', + 'filename': '/var/log/tower/tower_warnings.log', 'maxBytes': 1024*1024*5, # 5 MB 'backupCount': 5, 'formatter':'simple',