Replace ssl configuration
Replace ssl configuration from hardcoded
into variable
Change-Id: I1e393d311940944060d3f3f4e1093ee96eece777
Issue-ID: SDC-1176
Signed-off-by: Areli, Fuss (af732p) <af732p@att.com>
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
index 4287ca8..26d18c5 100644
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/attributes/default.rb
@@ -1 +1,2 @@
-#
\ No newline at end of file
+#
+default['cassandra'][:truststore_password] = "Aa123456"
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
index fd7e2f8..c04b11b 100644
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
@@ -12,7 +12,9 @@
:CASSANDRA_USR => node['cassandra'][:cassandra_user],
:rep_factor => replication_factor,
:DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment,
- :titan_connection_timeout => node['cassandra']['titan_connection_timeout']
+ :titan_connection_timeout => node['cassandra']['titan_connection_timeout'],
+ :cassandra_traststore_password => node['cassandra'][:truststore_password],
+ :cassandra_ssl_enabled => "#{ENV['cassandra_ssl_enabled']}"
})
end
@@ -34,8 +36,9 @@
:socket_connect_timeout => node['cassandra']['socket_connect_timeout'],
:socket_read_timeout => node['cassandra']['socket_read_timeout'],
:cassandra_pwd => node['cassandra'][:cassandra_password],
- :cassandra_usr => node['cassandra'][:cassandra_user]
-
+ :cassandra_usr => node['cassandra'][:cassandra_user],
+ :cassandra_traststore_password => node['cassandra'][:truststore_password],
+ :cassandra_ssl_enabled => "#{ENV['cassandra_ssl_enabled']}"
})
end
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
index 9bb4c33..6ed6406 100644
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
@@ -77,9 +77,9 @@
authenticate: true
username: <%= @cassandra_usr %>
password: <%= @cassandra_pwd %>
- ssl: false
- truststorePath : /config/.truststore
- truststorePassword : Aa123456
+ ssl: <%= @cassandra_ssl_enabled %>
+ truststorePath : /config/truststore
+ truststorePassword : <%= @cassandra_traststore_password %>
keySpaces:
- { name: dox, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']}
- { name: sdcaudit, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']}
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-titan.properties.erb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-titan.properties.erb
index cf885e6..cc518ad 100644
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-titan.properties.erb
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-titan.properties.erb
@@ -6,9 +6,9 @@
storage.connection-timeout=<%= @titan_connection_timeout %>
storage.cassandra.keyspace=sdctitan
-storage.cassandra.ssl.enabled=false
-storage.cassandra.ssl.truststore.location=/var/lib/jetty/config/.truststore
-storage.cassandra.ssl.truststore.password=Aa123456
+storage.cassandra.ssl.enabled=<%= @cassandra_ssl_enabled %>
+storage.cassandra.ssl.truststore.location=/var/lib/jetty/config/truststore
+storage.cassandra.ssl.truststore.password=<%= @cassandra_traststore_password %>
storage.cassandra.read-consistency-level=LOCAL_QUORUM
storage.cassandra.write-consistency-level=LOCAL_QUORUM
diff --git a/sdc-os-chef/scripts/docker_run.sh b/sdc-os-chef/scripts/docker_run.sh
index 5dd73d2..b7d96d5 100755
--- a/sdc-os-chef/scripts/docker_run.sh
+++ b/sdc-os-chef/scripts/docker_run.sh
@@ -337,7 +337,7 @@
else
ADDITIONAL_ARGUMENTS=${DEBUG_PORT}
fi
-docker run --detach --name sdc-BE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env JAVA_OPTIONS="${BE_JAVA_OPTIONS}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/logs/BE/:/var/lib/jetty/logs --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 8443:8443 --publish 8080:8080 ${ADDITIONAL_ARGUMENTS} ${PREFIX}/sdc-backend:${RELEASE}
+docker run --detach --name sdc-BE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env cassandra_ssl_enabled="false" --env JAVA_OPTIONS="${BE_JAVA_OPTIONS}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/logs/BE/:/var/lib/jetty/logs --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 8443:8443 --publish 8080:8080 ${ADDITIONAL_ARGUMENTS} ${PREFIX}/sdc-backend:${RELEASE}
echo "please wait while BE is starting..."
monitor_docker sdc-BE