Fix nova group name in nova.conf.j2

- "ansible" group is actually the role that we use.
  (this was getting lucky up until now as mariadb and rabbitmq
   have the same group and role name)
- Fix this so nova-compute matches the role in the service
  definition

Change-Id: I3fa414ca2615ea8470bad47cd6848220184fcd1f
This commit is contained in:
Angus Salkeld 2016-02-16 13:39:38 +10:00 committed by Proskurin Kirill
parent 45c6c9beeb
commit 663368c855
3 changed files with 7 additions and 7 deletions

View File

@ -57,7 +57,7 @@ novncproxy_port = {{ nova_novncproxy_port }}
[vnc]
vncserver_listen = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
vncserver_proxyclient_address = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
{% if inventory_hostname in groups['compute'] %}
{% if inventory_hostname in groups['nova-compute'] %}
novncproxy_base_url = http://{{ kolla_internal_address }}:{{ nova_novncproxy_port }}/vnc_auto.html
{% endif %}
{% elif nova_console == 'spice' %}
@ -67,7 +67,7 @@ enabled = false
[spice]
server_listen = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
server_proxyclient_address = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
{% if inventory_hostname in groups['compute'] %}
{% if inventory_hostname in groups['nova-compute'] %}
html5proxy_base_url = http://{{ kolla_internal_address }}:{{ nova_spicehtml5proxy_port }}/spice_auto.html
{% endif %}
html5proxy_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}

View File

@ -161,7 +161,7 @@ def get_new_node_id(zk, path):
def register_group_and_hostvars(zk):
host = str(get_ip_address(PRIVATE_INTERFACE))
path = os.path.join('kolla', DEPLOYMENT_ID, 'groups', GROUP)
path = os.path.join('kolla', DEPLOYMENT_ID, 'groups', ROLE)
zk.retry(zk.ensure_path, path)
node_id = get_new_node_id(zk, path)
@ -174,7 +174,7 @@ def register_group_and_hostvars(zk):
'role': ROLE,
'id': str(node_id)}
LOG.info('%s (%s) joining the %s party', host, node_id, GROUP)
LOG.info('%s (%s) joining the %s party', host, node_id, ROLE)
party.Party(zk, path, json.dumps(data)).join()

View File

@ -464,7 +464,7 @@ class HostvarsAndGroupsTest(base.BaseTestCase):
m_gethost.return_value = 'test-hostname'
start.register_group_and_hostvars(self.client)
groups, hostvars = start.get_groups_and_hostvars(self.client)
self.assertEqual({'testg': ['1.2.3.4']}, groups)
self.assertEqual({'testr': ['1.2.3.4']}, groups)
exp = {'ansible_eth1': {'ipv4': {'address': '1.2.3.4'}},
'ansible_eth2': {'ipv4': {'address': '1.2.3.4'}},
'ansible_hostname': 'test-hostname',
@ -489,13 +489,13 @@ class HostvarsAndGroupsTest(base.BaseTestCase):
'api_interface': 'eth2',
'role': 'testr',
'id': '55'}
party.Party(self.client, '/kolla/deploy_id/groups/testg',
party.Party(self.client, '/kolla/deploy_id/groups/testr',
json.dumps(remote)).join()
# make sure this function gets both hosts information.
groups, hostvars = start.get_groups_and_hostvars(self.client)
self.assertEqual(sorted(['1.2.3.4', '4.4.4.4']),
sorted(groups['testg']))
sorted(groups['testr']))
exp_local = {'ansible_eth1': {'ipv4': {'address': '1.2.3.4'}},
'ansible_eth2': {'ipv4': {'address': '1.2.3.4'}},
'ansible_hostname': 'test-hostname',