Removed dash from group names
diff --git a/tasks/cassandra.yml b/tasks/cassandra.yml
index 8538a27..d36c647 100644
--- a/tasks/cassandra.yml
+++ b/tasks/cassandra.yml
@@ -14,20 +14,20 @@
msg: 'ds group is not defined in the inventory file, please define the ds group in the inventory file'
when: groups['ds'] is not defined
-- name: Fail if dc-1 group is not provided
+- name: Fail if dc1 group is not provided
fail:
- msg: 'dc-1 group is not defined in the inventory file, please define the dc-1 group in the inventory file'
- when: groups['dc-1'] is not defined
+ msg: 'dc1 group is not defined in the inventory file, please define the dc1 group in the inventory file'
+ when: groups['dc1'] is not defined
-- name: Fail if dc-1-ds group is not provided
+- name: Fail if dc1-ds group is not provided
fail:
- msg: 'dc-1-ds group is not defined in the inventory file, please define the dc-1-ds group in the inventory file'
- when: groups['dc-1-ds'] is not defined
+ msg: 'dc1-ds group is not defined in the inventory file, please define the dc1-ds group in the inventory file'
+ when: groups['dc1-ds'] is not defined
-- name: Fail if dc-1-ms group is not provided
+- name: Fail if dc1-ms group is not provided
fail:
- msg: 'dc-1-ms group is not defined in the inventory file, please define the dc-1-ms group in the inventory file'
- when: groups['dc-1-ms'] is not defined
+ msg: 'dc1-ms group is not defined in the inventory file, please define the dc1-ms group in the inventory file'
+ when: groups['dc1-ms'] is not defined
- name: Construct cassandra hosts configuration
become: yes
diff --git a/templates/silent-install.conf.j2 b/templates/silent-install.conf.j2
index 73fe40d..1635131 100644
--- a/templates/silent-install.conf.j2
+++ b/templates/silent-install.conf.j2
@@ -7,13 +7,13 @@
LDAP_TYPE='{{ opdk_ldap_type }}'
{% if opdk_ldap_type == '2' %}
-{% if groups['dc-1-ldap'] is defined and groups['dc-2-ldap'] is defined and inventory_hostname in groups['dc-1'] %}
+{% if groups['dc1-ldap'] is defined and groups['dc2-ldap'] is defined and inventory_hostname in groups['dc1'] %}
LDAP_SID=1
-LDAP_PEER={{ hostvars[groups['dc-2-ldap'][0]]['private_address'] }}
+LDAP_PEER={{ hostvars[groups['dc2-ldap'][0]]['private_address'] }}
{% endif %}
-{% if groups['dc-1-ldap'] is defined and groups['dc-2-ldap'] is defined and inventory_hostname in groups['dc-2'] %}
+{% if groups['dc1-ldap'] is defined and groups['dc2-ldap'] is defined and inventory_hostname in groups['dc2'] %}
LDAP_SID=2
-LDAP_PEER={{ hostvars[groups['dc-1-ldap'][0]]['private_address'] }}
+LDAP_PEER={{ hostvars[groups['dc1-ldap'][0]]['private_address'] }}
{% endif %}
{% endif %}
APIGEE_LDAPPW={{ opdk_ldap_pass }}
@@ -22,10 +22,10 @@
MP_POD={{ opdk_mp_pod | default(default_mp_pod) }}
{# TODO: Build a module that discover the region of the inventory_hostname and update the REGION dynamically #}
-{% if groups['dc-1'] is defined and inventory_hostname in groups['dc-1'] %}
-REGION=dc-1
-{% elif groups['dc-2'] is defined and inventory_hostname in groups['dc-2'] %}
-REGION=dc-2
+{% if groups['dc1'] is defined and inventory_hostname in groups['dc1'] %}
+REGION=dc1
+{% elif groups['dc2'] is defined and inventory_hostname in groups['dc2'] %}
+REGION=dc2
{% elif groups['dc-3'] is defined and inventory_hostname in groups['dc-3'] %}
REGION=dc-3
{% endif %}
@@ -35,10 +35,10 @@
ZK_HOSTS="{% for host in groups['ds'] %}{{ hostvars[host]['private_address'] }}{% if hostvars[host]['zk_observer'] is defined and hostvars[host]['zk_observer'] == 'true' %}:observer{% endif %}{% if not loop.last %} {% endif %}{% endfor %}"
{# TODO: Build a module to construct the ZK_CLIENT_HOSTS value#}
-{% if groups['dc-1'] is defined and inventory_hostname in groups['dc-1'] %}
-ZK_CLIENT_HOSTS="{% for host in groups['dc-1-ds'] %}{{ hostvars[host]['private_address'] }}{% if not loop.last %} {% endif %}{% endfor %}"
-{% elif groups['dc-2'] is defined and inventory_hostname in groups['dc-2']%}
-ZK_CLIENT_HOSTS="{% for host in groups['dc-2-ds'] %}{{ hostvars[host]['private_address'] }}{% if not loop.last %} {% endif %}{% endfor %}"
+{% if groups['dc1'] is defined and inventory_hostname in groups['dc1'] %}
+ZK_CLIENT_HOSTS="{% for host in groups['dc1-ds'] %}{{ hostvars[host]['private_address'] }}{% if not loop.last %} {% endif %}{% endfor %}"
+{% elif groups['dc2'] is defined and inventory_hostname in groups['dc2']%}
+ZK_CLIENT_HOSTS="{% for host in groups['dc2-ds'] %}{{ hostvars[host]['private_address'] }}{% if not loop.last %} {% endif %}{% endfor %}"
{% else %}
ZK_CLIENT_HOSTS="{% for host in groups['ds'] %}{{ hostvars[host]['private_address'] }}{% if not loop.last %} {% endif %}{% endfor %}"
{% endif %}
@@ -75,10 +75,10 @@
MO_PG_PASSWD={{ pg_pass }}
CASS_CLUSTERNAME={{ opdk_cass_clustername }}
APIGEE_PORT_HTTP_MS={{ ms_ext_mgmt_port }}
-{% if groups['dc-1-qpid'] is defined and inventory_hostname in groups['dc-1-qpid'] %}
-QPID_HOST="{{ groups['dc-1-qpid'] | join(' ') }}"
+{% if groups['dc1-qpid'] is defined and inventory_hostname in groups['dc1-qpid'] %}
+QPID_HOST="{{ groups['dc1-qpid'] | join(' ') }}"
{% else %}
-QPID_HOST="{{ groups['dc-2-qpid'] | join(' ') }}"
+QPID_HOST="{{ groups['dc2-qpid'] | join(' ') }}"
{% endif %}
QPID_PORT={{ qpid_ext_mgmt_port }}
MX_GROUP=mxgroup
diff --git a/tests/test_cassandra_hosts.yml b/tests/test_cassandra_hosts.yml
index 5f7247f..e59e7a5 100644
--- a/tests/test_cassandra_hosts.yml
+++ b/tests/test_cassandra_hosts.yml
@@ -15,7 +15,7 @@
roles:
- apigee-opdk-setup-default-settings
-- hosts: dc-1-rmp[0]
+- hosts: dc1-rmp[0]
become: yes
vars:
opdk_cass_password: 'cassandra'