Merge "For support non-clustered RabbitMQ configuration added check of use_vip_address option for nova.controller.nova_update_cell1 state"
diff --git a/_states/novang.py b/_states/novang.py
index b496117..88cffcb 100644
--- a/_states/novang.py
+++ b/_states/novang.py
@@ -65,10 +65,14 @@
'changes': {},
'result': False,
'comment': 'Cell "{0}" does not exists'.format(name)}
- cell_uuid = __salt__['cmd.shell']('nova-manage cell_v2 list_cells 2>/dev/null | awk \'/' + name + '/ {print $4}\'')
+ cell_uuid, ssl_enable = (__salt__['cmd.shell']('nova-manage cell_v2 list_cells 2>/dev/null | awk \'/' + name + '/ {print $4, $8}\'')).split(' ', 1)
+ if 'ssl' in ssl_enable:
+ db_options = '?charset=utf8&ssl_ca=/etc/nova/ssl/mysql/ca-cert.pem&ssl_cert=/etc/nova/ssl/mysql/client-cert.pem&ssl_key=/etc/nova/ssl/mysql/client-key.pem'
+ else:
+ db_options = '?charset=utf8'
if cell_uuid:
try:
- __salt__['cmd.shell']('nova-manage cell_v2 update_cell --cell_uuid ' + cell_uuid + ' --transport-url ' + transport_url + ' --database_connection ' + db_engine + '+pymysql://' + db_user + ':' + db_password + '@' + db_address + '/' + db_name + '?charset=utf8')
+ __salt__['cmd.shell']('nova-manage cell_v2 update_cell --cell_uuid ' + cell_uuid + ' --transport-url ' + transport_url + ' --database_connection ' + '"' + db_engine + '+pymysql://' + db_user + ':' + db_password + '@' + db_address + '/' + db_name + db_options + '"')
ret['result'] = True
ret['comment'] = 'Cell {0} updated'.format(name)
ret['changes'][name] = 'Cell {0} successfuly updated'.format(name)
diff --git a/nova/compute.sls b/nova/compute.sls
index 9450a30..b5c51d8 100644
--- a/nova/compute.sls
+++ b/nova/compute.sls
@@ -126,6 +126,14 @@
- require:
- pkg: nova_compute_packages
- sls: nova._ssl.rabbitmq
+
+/etc/nova/nova-compute.conf:
+ file.managed:
+ - contents: |
+ # This file is managed by Salt
+ - require:
+ - pkg: nova_compute_packages
+ - sls: nova._ssl.rabbitmq
{%- endif %}
{% for service_name in compute.services %}