This is an automated email from the ASF dual-hosted git repository.
jhg03a pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 7fa607e Add missing TP configuration options to ansible infra code
and improve TP configuration safety (#5072)
7fa607e is described below
commit 7fa607e16d90b9eda3dbd21193f8c823e5f1bfe7
Author: Jeremy Mitchell <[email protected]>
AuthorDate: Fri Sep 25 11:56:28 2020 -0600
Add missing TP configuration options to ansible infra code and improve TP
configuration safety (#5072)
* fixes lab enviro to account for changes in traffic_portal_properties.json
and adds some defensive coding.
* adds comment for enforcecapabilities
---
infrastructure/ansible/roles/traffic_portal/defaults/main.yml | 8 ++++++++
traffic_portal/app/src/common/modules/header/HeaderController.js | 4 ++--
.../app/src/common/modules/navigation/NavigationController.js | 2 +-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/infrastructure/ansible/roles/traffic_portal/defaults/main.yml
b/infrastructure/ansible/roles/traffic_portal/defaults/main.yml
index cf9ec30..098051d 100644
--- a/infrastructure/ansible/roles/traffic_portal/defaults/main.yml
+++ b/infrastructure/ansible/roles/traffic_portal/defaults/main.yml
@@ -42,10 +42,18 @@ tp_default_properties_template:
_comment: These are the default properties for Traffic Portal. Customize
these values
to fit your needs.
properties:
+ _comments:
+ name: Customize the name of Traffic Portal if desired.
+ enforceCapabilities: Not currently supported. Must be false.
name: Traffic Portal
+ environment:
+ _comments: Optionally set the environment name (production, staging,
development, etc) and an indicator if the environment is production or not.
+ name: Kabletown2.0
+ isProd: false
api:
_comment: This should have the same value found in
/etc/traffic_portal/conf/config.js
baseUrl: "{{ tp_to_base_url }}/api/"
+ # enforceCapabilities is not currently supported and must be false
enforceCapabilities: false
dashboard:
_comments: These are configurable properties for the dashboard
diff --git a/traffic_portal/app/src/common/modules/header/HeaderController.js
b/traffic_portal/app/src/common/modules/header/HeaderController.js
index 759b3f1..cb1b376 100644
--- a/traffic_portal/app/src/common/modules/header/HeaderController.js
+++ b/traffic_portal/app/src/common/modules/header/HeaderController.js
@@ -23,9 +23,9 @@ var HeaderController = function($rootScope, $scope, $state,
$uibModal, $location
$scope.userLoaded = userModel.loaded;
- $scope.enviroName = propertiesModel.properties.environment.name;
+ $scope.enviroName = (propertiesModel.properties.environment) ?
propertiesModel.properties.environment.name : '';
- $scope.isProd = propertiesModel.properties.environment.isProd;
+ $scope.isProd = (propertiesModel.properties.environment) ?
propertiesModel.properties.environment.isProd : false;
/* we don't want real time changes to the user showing up. we want the
ability to revert changes
if necessary. thus, we will only update this on save. see
userModel::userUpdated event below.
diff --git
a/traffic_portal/app/src/common/modules/navigation/NavigationController.js
b/traffic_portal/app/src/common/modules/navigation/NavigationController.js
index dea2b6c..17a73ac 100644
--- a/traffic_portal/app/src/common/modules/navigation/NavigationController.js
+++ b/traffic_portal/app/src/common/modules/navigation/NavigationController.js
@@ -21,7 +21,7 @@ var NavigationController = function($scope, $log, $state,
$location, $window, $t
$scope.appName = propertiesModel.properties.name;
- $scope.isProd = propertiesModel.properties.environment.isProd;
+ $scope.isProd = (propertiesModel.properties.environment) ?
propertiesModel.properties.environment.isProd : false;
$scope.enforceCapabilities =
propertiesModel.properties.enforceCapabilities;