Add logic to control replication setup

Added variable to decide whether setting up replication or not

Change-Id: I6a4e15b17d200fb4e5a7f723fddf96e5992bff0c
diff --git a/gerrit/setup_gerrit.py b/gerrit/setup_gerrit.py
index 294567a..91c408b 100755
--- a/gerrit/setup_gerrit.py
+++ b/gerrit/setup_gerrit.py
@@ -145,8 +145,9 @@
     })
     f.write(template.render(config_for_template))
 
-containerSlave = os.getenv('CONTAINER_SLAVE')
-if (not containerSlave):
+containerSlave = (os.getenv('CONTAINER_SLAVE') == 'true')
+setupReplication = (os.getenv('SETUP_REPLICATION') == 'true')
+if ((not containerSlave) and setupReplication):
     print("Setting Replication config in '" +
           GERRIT_CONFIG_DIRECTORY + "replication.config'")
     config.read(BASE_CONFIG_DIR + '/replication.setup')
diff --git a/master-slave/cf-service-master.yml b/master-slave/cf-service-master.yml
index fd46039..43af4e8 100644
--- a/master-slave/cf-service-master.yml
+++ b/master-slave/cf-service-master.yml
@@ -115,6 +115,8 @@
                       Value: !Sub 'proxy-https://*:${HTTPPort}/'
                     - Name: AWS_REGION
                       Value: !Ref AWS::Region
+                    - Name: SETUP_REPLICATION
+                      Value: true
                   MountPoints:
                     - SourceVolume: !Ref GerritGitVolume
                       ContainerPath: /var/gerrit/git