have shadow node configure ejabberd cert and copy it to other nodes
@@ -2119,7 +2119,7 @@ class Djinn
# nodes to start up.
if my_node.is_shadow?
build_uncommitted_changes
-
+ configure_ejabberd_cert
Djinn.log_info("Preparing other nodes for this deployment.")
initialize_nodes_in_parallel(@nodes)
end
@@ -4085,6 +4085,17 @@ class Djinn
build_java_appserver if status.include?('AppServer_Java')
end
+ def configure_ejabberd_cert
+ # Replace APPSCALE_CONFIG_DIR/ejabberd.pem with private key and cert
+ # copied from tools. APPSCALE_CONFIG_DIR/ejabberd.pem is not the default
+ # ejabberd.pem file, so we are overwriting changes that we have made.
+ cert_loc = "#{APPSCALE_CONFIG_DIR}/certs/mycert.pem"
+ key_loc = "#{APPSCALE_CONFIG_DIR}/certs/mykey.pem"
+ Djinn.log_run("cat #{cert_loc} > "\
+ "#{APPSCALE_CONFIG_DIR}/ejabberd.pem && cat #{key_loc} >> "\
+ "#{APPSCALE_CONFIG_DIR}/ejabberd.pem")
+ end
+
def initialize_nodes_in_parallel(node_info)
threads = []
node_info.each { |slave|
@@ -4142,12 +4153,12 @@ class Djinn
secret_key_loc = "#{APPSCALE_CONFIG_DIR}/secret.key"
cert_loc = "#{APPSCALE_CONFIG_DIR}/certs/mycert.pem"
key_loc = "#{APPSCALE_CONFIG_DIR}/certs/mykey.pem"
- Djinn.log_run("cat #{cert_loc} > "\
- "#{APPSCALE_CONFIG_DIR}/ejabberd.pem && cat #{key_loc} >> "\
- "#{APPSCALE_CONFIG_DIR}/ejabberd.pem")
+ ejabberd_cert_loc = "#{APPSCALE_CONFIG_DIR}/ejabberd.pem"
+
HelperFunctions.scp_file(secret_key_loc, secret_key_loc, ip, ssh_key)
HelperFunctions.scp_file(cert_loc, cert_loc, ip, ssh_key)
HelperFunctions.scp_file(key_loc, key_loc, ip, ssh_key)
+ HelperFunctions.scp_file(ejabberd_cert_loc, ejabberd_cert_loc, ip, ssh_key)
cloud_keys_dir = File.expand_path("#{APPSCALE_CONFIG_DIR}/keys/cloud1")
make_dir = "mkdir -p #{cloud_keys_dir}"
