diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index c240401fe4..65c1f8c860 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -405,6 +405,7 @@ mariadb_shard_backup_user_prefix: "backup_shard_" mariadb_shards_info: "{{ groups['mariadb'] | database_shards_info() }}" masakari_api_port: "15868" +masakari_coordination_backend: "{{ 'redis' if enable_redis | bool else 'etcd' if enable_etcd | bool else '' }}" memcached_port: "11211" diff --git a/ansible/roles/masakari/templates/masakari.conf.j2 b/ansible/roles/masakari/templates/masakari.conf.j2 index 969cf2f2d5..081688aed1 100644 --- a/ansible/roles/masakari/templates/masakari.conf.j2 +++ b/ansible/roles/masakari/templates/masakari.conf.j2 @@ -70,3 +70,12 @@ policy_file = {{ masakari_policy_file }} [taskflow] connection = mysql+pymysql://{{ masakari_database_user }}:{{ masakari_database_password }}@{{ masakari_database_address }}/{{ masakari_database_name }} + +{% if service_name == 'masakari-api' %} +[coordination] +{% if masakari_coordination_backend == 'redis' %} +backend_url = {{ redis_connection_string }} +{% elif masakari_coordination_backend == 'etcd' %} +backend_url = etcd3+{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ etcd_client_port }}{% if openstack_cacert %}?ca_cert={{ openstack_cacert }}{% endif %} +{% endif %} +{% endif %} diff --git a/releasenotes/notes/new-variable-masakari-coordination-backend-d3b742315a07aabc.yaml b/releasenotes/notes/new-variable-masakari-coordination-backend-d3b742315a07aabc.yaml new file mode 100644 index 0000000000..d425368299 --- /dev/null +++ b/releasenotes/notes/new-variable-masakari-coordination-backend-d3b742315a07aabc.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Masakari coordination backend can now be configured via + masakari_coordination_backend variable. + Coordination is optional and can now be set to either redis or etcd.