From 6da39aeac253098469d2fb966b4990ff4b162d37 Mon Sep 17 00:00:00 2001 From: James Laska Date: Tue, 6 Oct 2015 16:20:03 -0400 Subject: [PATCH 01/71] Fix AMI publish playbook --- tools/playbooks/publish_ami.yml | 37 ++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/tools/playbooks/publish_ami.yml b/tools/playbooks/publish_ami.yml index 7c627f7d0c..c7af4ded8b 100644 --- a/tools/playbooks/publish_ami.yml +++ b/tools/playbooks/publish_ami.yml @@ -31,26 +31,35 @@ with_items: ami_info.results - name: Copy AMI to desired regions - ec2_ami_copy: - source_region: '{{ src_region }}' - region: '{{ item }}' - source_image_id: '{{ ami_info.results[0].ami_id }}' - name: '{{ ami_info.results[0].name }}' - description: '{{ ami_info.results[0].description }}' - tags: '{{ ami_info.results[0].tags }}' - wait: true + command: 'ec2-copy-image --source-region {{ src_region }} --source-ami-id {{ src_ami_id }} --region {{ item }} --client-token {{ src_ami_id }}-{{ item }}' with_items: dst_regions register: ami_copy - - name: Make image publicly available - command: 'ec2-modify-image-attribute {{ item.image_id }} --launch-permission -a all' - with_items: ami_copy.results +# ec2_ami_copy: +# source_region: '{{ src_region }}' +# region: '{{ item }}' +# source_image_id: '{{ ami_info.results[0].ami_id }}' +# name: '{{ ami_info.results[0].name }}' +# description: '{{ ami_info.results[0].description }}' +# tags: '{{ ami_info.results[0].tags }}' +# wait: true +# with_items: dst_regions +# register: ami_copy - - debug: - var: ami_copy.results + - name: Wait for AMI's to become available + command: 'ec2-describe-images --region {{ item.item }} --filter state=available {{ item.stdout[-12:] }}' + until: ami_available.stdout.find("available") != -1 + retries: 10 + delay: 120 + with_items: ami_copy.results + register: ami_available + + - name: Make image publicly available + command: 'ec2-modify-image-attribute --region {{ item.item }} {{ item.stdout[-12:] }} --launch-permission -a all' + with_items: ami_copy.results - name: Display AMI launch URL debug: - msg: 'https://console.aws.amazon.com/ec2/home?region={{ item.item }}#launchAmi={{ item.image_id }}' + msg: 'https://console.aws.amazon.com/ec2/home?region={{ item.item }}#launchAmi={{ item.stdout[-12:] }}' with_items: ami_copy.results when: ami_copy is defined From 815081eec1664650c99a380bb81ca6bcf9e96e33 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Mon, 5 Oct 2015 13:58:55 -0400 Subject: [PATCH 02/71] correct egg names for pip dependency resolution --- requirements/requirements.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 6e9297abde..fe3459cfc8 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,5 +1,5 @@ amqp==1.4.5 -git+https://github.com/chrismeyersfsu/ansiconv.git@tower_1.0.0#egg=ansiconv-tower_1.0.0 +git+https://github.com/chrismeyersfsu/ansiconv.git@tower_1.0.0#egg=ansiconv anyjson==0.3.3 apache-libcloud==0.15.1 argparse==1.2.1 @@ -31,13 +31,13 @@ enum34==1.0.4 #functools32==3.2.3-2 gevent==1.0.2 gevent-websocket==0.9.3 -git+https://github.com/chrismeyersfsu/django-jsonfield.git@tower_0.9.12#egg=jsonfield-tower_0.9.12 -git+https://github.com/chrismeyersfsu/django-qsstats-magic.git@tower_0.7.2#egg=qsstats-tower_0.7.2 -git+https://github.com/chrismeyersfsu/django-rest-framework-mongoengine.git@0c79515257a33a0ce61500b65fa497398628a03d#egg=rest_framework_mongoengine-1.5.4 -git+https://github.com/chrismeyersfsu/gevent-socketio.git@tower_0.3.6#egg=socketio-tower_0.3.6 -git+https://github.com/chrismeyersfsu/python-ipy.git@master#egg=ipy -git+https://github.com/chrismeyersfsu/python-keystoneclient.git@1.3.0#egg=keystoneclient-1.3.0 -git+https://github.com/chrismeyersfsu/shade.git@tower_0.5.0#egg=shade-tower_0.5.0 +git+https://github.com/chrismeyersfsu/django-jsonfield.git@tower_0.9.12#egg=django-jsonfield +git+https://github.com/chrismeyersfsu/django-qsstats-magic.git@tower_0.7.2#egg=django-qsstats-magic +git+https://github.com/chrismeyersfsu/django-rest-framework-mongoengine.git@0c79515257a33a0ce61500b65fa497398628a03d#egg=django-rest-framework-mongoengine +git+https://github.com/chrismeyersfsu/gevent-socketio.git@tower_0.3.6#egg=gevent-socketio +git+https://github.com/chrismeyersfsu/python-ipy.git@master#egg=IPy +git+https://github.com/chrismeyersfsu/python-keystoneclient.git@1.3.0#egg=python-keystoneclient +git+https://github.com/chrismeyersfsu/shade.git@tower_0.5.0#egg=shade git+https://github.com/chrismeyersfsu/sitecustomize.git#egg=sitecustomize greenlet==0.4.7 httplib2==0.9 From f213577f6ba807f1d54fa41cf5164facf16d2636 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 6 Oct 2015 10:37:13 -0400 Subject: [PATCH 03/71] expose session settings to user --- awx/settings/defaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 431dbe7990..046e6e0570 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -238,7 +238,7 @@ RADIUS_SECRET = '' # Seconds before auth tokens expire. AUTH_TOKEN_EXPIRATION = 1800 -# Maximum number of per-user valid, concurrent session. +# Maximum number of per-user valid, concurrent tokens. # -1 is unlimited AUTH_TOKEN_PER_USER = -1 From dcd731071ffde586479e11106d4346bd7ce25f94 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Tue, 6 Oct 2015 20:24:30 -0400 Subject: [PATCH 04/71] pin django debug toolbar for django dep reason * fix IPy dep * new django debug toolbar released today, broke things. Pin to our old version of django to ensure success. --- requirements/requirements.txt | 2 +- requirements/requirements_dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index fe3459cfc8..6c73afe30f 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -35,7 +35,7 @@ git+https://github.com/chrismeyersfsu/django-jsonfield.git@tower_0.9.12#egg=djan git+https://github.com/chrismeyersfsu/django-qsstats-magic.git@tower_0.7.2#egg=django-qsstats-magic git+https://github.com/chrismeyersfsu/django-rest-framework-mongoengine.git@0c79515257a33a0ce61500b65fa497398628a03d#egg=django-rest-framework-mongoengine git+https://github.com/chrismeyersfsu/gevent-socketio.git@tower_0.3.6#egg=gevent-socketio -git+https://github.com/chrismeyersfsu/python-ipy.git@master#egg=IPy +git+https://github.com/chrismeyersfsu/python-ipy.git@fix-127_localhost#egg=IPy git+https://github.com/chrismeyersfsu/python-keystoneclient.git@1.3.0#egg=python-keystoneclient git+https://github.com/chrismeyersfsu/shade.git@tower_0.5.0#egg=shade git+https://github.com/chrismeyersfsu/sitecustomize.git#egg=sitecustomize diff --git a/requirements/requirements_dev.txt b/requirements/requirements_dev.txt index 9c0d7f83ae..a2ff6cf11a 100644 --- a/requirements/requirements_dev.txt +++ b/requirements/requirements_dev.txt @@ -1,6 +1,6 @@ -r requirements.txt django-devserver -django-debug-toolbar +django-debug-toolbar==1.3.2 unittest2 pep8 flake8 From 83fe3282dc8bdbbfd764e2863df34aabf38c68d9 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Wed, 7 Oct 2015 09:19:22 -0400 Subject: [PATCH 05/71] add basic auth enabled / disabled setting --- awx/settings/defaults.py | 4 ++++ awx/settings/postprocess.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 046e6e0570..9684479542 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -242,6 +242,10 @@ AUTH_TOKEN_EXPIRATION = 1800 # -1 is unlimited AUTH_TOKEN_PER_USER = -1 +# Enable / Disable HTTP Basic Authentication used in the API browser +# Note: Session limits are not enforced when using HTTP Basic Authentication. +AUTH_BASIC_ENABLED = True + # If set, serve only minified JS for UI. USE_MINIFIED_JS = False diff --git a/awx/settings/postprocess.py b/awx/settings/postprocess.py index bed4d6299a..a3db97724d 100644 --- a/awx/settings/postprocess.py +++ b/awx/settings/postprocess.py @@ -29,3 +29,7 @@ if not all([SOCIAL_AUTH_SAML_SP_ENTITY_ID, SOCIAL_AUTH_SAML_SP_PUBLIC_CERT, SOCIAL_AUTH_SAML_TECHNICAL_CONTACT, SOCIAL_AUTH_SAML_SUPPORT_CONTACT, SOCIAL_AUTH_SAML_ENABLED_IDPS]): AUTHENTICATION_BACKENDS = [x for x in AUTHENTICATION_BACKENDS if x != 'social.backends.saml.SAMLAuth'] + +if not AUTH_BASIC_ENABLED: + REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = [x for x in REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] if x != 'rest_framework.authentication.BasicAuthentication'] + From 916391d0b3c47cd0ac482f4041eb363935ffbb28 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 7 Oct 2015 13:03:52 -0400 Subject: [PATCH 06/71] Fix base class import on Ansible 2.0. --- awx/plugins/fact_caching/tower.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/plugins/fact_caching/tower.py b/awx/plugins/fact_caching/tower.py index 362b9b261c..e4b6c19920 100755 --- a/awx/plugins/fact_caching/tower.py +++ b/awx/plugins/fact_caching/tower.py @@ -35,7 +35,10 @@ import time import datetime from copy import deepcopy from ansible import constants as C -from ansible.cache.base import BaseCacheModule +try: + from ansible.cache.base import BaseCacheModule +except: + from ansible.plugins.cache.base import BaseCacheModule try: import zmq From 8908f77fea51984c3813869f94b31bb0529faa11 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 6 Oct 2015 15:31:11 -0400 Subject: [PATCH 07/71] add token to href of downloadable standard out --- awx/ui/client/src/helpers/LogViewer.js | 4 ++-- awx/ui/client/src/partials/job_stdout.html | 2 +- awx/ui/client/src/partials/job_stdout_adhoc.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/helpers/LogViewer.js b/awx/ui/client/src/helpers/LogViewer.js index bc2f7e6835..90e9a3f407 100644 --- a/awx/ui/client/src/helpers/LogViewer.js +++ b/awx/ui/client/src/helpers/LogViewer.js @@ -359,13 +359,13 @@ export default }; }]) - .factory('AddPreFormattedText', [function() { + .factory('AddPreFormattedText', ['$rootScope', function($rootScope) { return function(params) { var id = params.id, val = params.val, html = ""; if (params.standardOut) { - html += 'Download'; + html += 'Download'; html += "
" + val + "
\n"; } else { html += "
" + val + "
\n"; diff --git a/awx/ui/client/src/partials/job_stdout.html b/awx/ui/client/src/partials/job_stdout.html index 8c113d908c..9ec92b6706 100644 --- a/awx/ui/client/src/partials/job_stdout.html +++ b/awx/ui/client/src/partials/job_stdout.html @@ -22,7 +22,7 @@

Standard Output - + Download

diff --git a/awx/ui/client/src/partials/job_stdout_adhoc.html b/awx/ui/client/src/partials/job_stdout_adhoc.html index 3dcac4097e..52b51565d7 100644 --- a/awx/ui/client/src/partials/job_stdout_adhoc.html +++ b/awx/ui/client/src/partials/job_stdout_adhoc.html @@ -160,7 +160,7 @@

Standard Output - Download + Download

From 8cfe02f5fbb6e5ed207385ed6cddad75ae3d60a3 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 6 Oct 2015 11:24:38 -0400 Subject: [PATCH 08/71] fixed ui implementation of get adhoc permission label --- awx/ui/client/src/permissions/shared/get-choices.factory.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/permissions/shared/get-choices.factory.js b/awx/ui/client/src/permissions/shared/get-choices.factory.js index 57e14433f4..8ad55907a5 100644 --- a/awx/ui/client/src/permissions/shared/get-choices.factory.js +++ b/awx/ui/client/src/permissions/shared/get-choices.factory.js @@ -24,10 +24,10 @@ .then(function (data) { data = data.data; var choices = data.actions.GET.permission_type.choices; - + // manually add the adhoc label to the choices object choices.push(["adhoc", - data.actions.GET.run_ad_hoc_commands.label]); + data.actions.GET.run_ad_hoc_commands.help_text]); return choices; }) From 6883d70805e1d571b2894e8ec6140d5104df7a07 Mon Sep 17 00:00:00 2001 From: jlmitch5 Date: Mon, 5 Oct 2015 15:24:43 -0400 Subject: [PATCH 09/71] fixed tmp dir deletion in make clean --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 923ad894e6..b292386b54 100644 --- a/Makefile +++ b/Makefile @@ -202,7 +202,8 @@ clean-bundle: clean: clean-rpm clean-deb clean-grunt clean-ui clean-tar clean-packer clean-bundle rm -rf awx/lib/site-packages rm -rf dist/* - rm -rf tmp/* + rm -rf tmp + mkdir tmp rm -rf build $(NAME)-$(VERSION) *.egg-info find . -type f -regex ".*\.py[co]$$" -delete From 4ea2e10f1c20e185fbb6ae1e45ea0ecaafbc4fd5 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 6 Oct 2015 12:10:51 -0400 Subject: [PATCH 10/71] rejecting promise on requestError REST interceptor --- .../client/src/login/loginModal/loginModal.controller.js | 8 ++++---- awx/ui/client/src/rest/interceptors.service.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/awx/ui/client/src/login/loginModal/loginModal.controller.js b/awx/ui/client/src/login/loginModal/loginModal.controller.js index 5aeb6a2eb3..52296a4c62 100644 --- a/awx/ui/client/src/login/loginModal/loginModal.controller.js +++ b/awx/ui/client/src/login/loginModal/loginModal.controller.js @@ -184,14 +184,14 @@ export default ['$log', '$cookieStore', '$compile', '$window', '$rootScope', '$l } else { Wait('start'); Authorization.retrieveToken(username, password) - .success(function (data) { + .then(function (data) { $('#login-modal').modal('hide'); Authorization.setToken(data.token, data.expires); $rootScope.sessionTimer = Timer.init(); scope.$emit('AuthorizationGetUser'); - }) - .error(function (data) { - var hdr, msg, key; + }, + function (data) { + var key; Wait('stop'); if (data.non_field_errors && data.non_field_errors.length === 0) { // show field specific errors returned by the API diff --git a/awx/ui/client/src/rest/interceptors.service.js b/awx/ui/client/src/rest/interceptors.service.js index 1a5d4f13a5..2564df40cd 100644 --- a/awx/ui/client/src/rest/interceptors.service.js +++ b/awx/ui/client/src/rest/interceptors.service.js @@ -11,8 +11,8 @@ *************************************************/ export default - [ '$rootScope', - function ($rootScope) { + [ '$rootScope', '$q', + function ($rootScope, $q) { return { response: function(config) { if(config.headers('auth-token-timeout') !== null){ @@ -23,9 +23,9 @@ responseError: function(rejection){ if( !_.isEmpty(rejection.data.detail) && rejection.data.detail === "Maximum per-user sessions reached"){ $rootScope.sessionTimer.expireSession('session_limit'); - return rejection; + return $q.reject(rejection); } - return rejection; + return $q.reject(rejection); } }; }]; From b6e51a0cd4f7e67d2430f6fe47989f7b3fc6d987 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 6 Oct 2015 17:42:17 -0400 Subject: [PATCH 11/71] updated $http call to angular 1.4 implementation --- .../client/src/login/loginModal/loginModal.controller.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/login/loginModal/loginModal.controller.js b/awx/ui/client/src/login/loginModal/loginModal.controller.js index 52296a4c62..a3386ee3ad 100644 --- a/awx/ui/client/src/login/loginModal/loginModal.controller.js +++ b/awx/ui/client/src/login/loginModal/loginModal.controller.js @@ -186,17 +186,17 @@ export default ['$log', '$cookieStore', '$compile', '$window', '$rootScope', '$l Authorization.retrieveToken(username, password) .then(function (data) { $('#login-modal').modal('hide'); - Authorization.setToken(data.token, data.expires); + Authorization.setToken(data.data.token, data.data.expires); $rootScope.sessionTimer = Timer.init(); scope.$emit('AuthorizationGetUser'); }, function (data) { var key; Wait('stop'); - if (data.non_field_errors && data.non_field_errors.length === 0) { + if (data.data.non_field_errors && data.data.non_field_errors.length === 0) { // show field specific errors returned by the API - for (key in data) { - scope[key + 'Error'] = data[key][0]; + for (key in data.data) { + scope[key + 'Error'] = data.data[key][0]; } } else { scope.reset(); From fa4dd9a335788ed212d9d963da02ee1bfbdb09a9 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Thu, 8 Oct 2015 11:14:24 -0400 Subject: [PATCH 12/71] load pa.min.js for pendo on demand courtesy of our friends at Pendo --- awx/ui/client/src/app.js | 3 +++ .../client/src/login/authenticationServices/pendo.service.js | 4 ++++ awx/ui/templates/ui/index.html | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index 36f416a268..cfdfa540d1 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -187,6 +187,9 @@ var tower = angular.module('Tower', [ .constant('AngularScheduler.useTimezone', true) .constant('AngularScheduler.showUTCField', true) .constant('$timezones.definitions.location', urlPrefix + 'lib/angular-tz-extensions/tz/data') + .config(function($pendolyticsProvider) { + $pendolyticsProvider.doNotAutoStart(); + }) .config(['$routeProvider', function ($routeProvider) { $routeProvider. diff --git a/awx/ui/client/src/login/authenticationServices/pendo.service.js b/awx/ui/client/src/login/authenticationServices/pendo.service.js index e20002f6a7..a6a5917799 100644 --- a/awx/ui/client/src/login/authenticationServices/pendo.service.js +++ b/awx/ui/client/src/login/authenticationServices/pendo.service.js @@ -100,6 +100,7 @@ export default config = response.license_info; config.analytics_status = response.analytics_status; if(config.analytics_status !== 'off'){ + $pendolytics.bootstrap(); deferred.resolve(config); } else { @@ -115,6 +116,7 @@ export default }); } else if(config.analytics_status !== 'off'){ + $pendolytics.bootstrap(); deferred.resolve(config); } else { @@ -128,6 +130,8 @@ export default this.getConfig().then(function(config){ var options = that.setPendoOptions(config); that.setRole(options).then(function(options){ + $log.debug('Pendo status is '+ config.analytics_status + '. Object below:'); + $log.debug(options); $pendolytics.identify(options); }, function(reason){ // reject function for setRole diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index c796f29527..78ea04bdb4 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -26,7 +26,8 @@ - + + - - +