Juniper / contrail-ansible-deployer

Ansible deployment for contrail
Apache License 2.0
60 stars 65 forks source link

Issue with kolla multidomain auth #28

Open malebeau opened 6 years ago

malebeau commented 6 years ago

I'm trying to setup mutlidomain auth with domain choices in horizon UI (branch stable-queens). When setting in config/instances.yaml :

kolla_globals:
  horizon_keystone_multidomain: true
  horizon_keystone_domain_choices:
    Default: Default
    domain: domain

This result on an error when horizon docker launch.

Resulting var in : /etc/kolla/globals

horizon_keystone_domain_choices: {u'Default': u'Default', u'domain': `u'domain'}

Result in local_settings in /etc/kolla/horizon/local_settings :

OPENSTACK_KEYSTONE_DOMAIN_CHOICES = (
    (''u'Default'', 'u'default''),
    ('u'domain'', 'u'domain''),
)

This causes horizon docker to restart infinitely.

When changing in contrail-kolla-ansible/ansible/roles/horizon/templates/local_settings.j2

OPENSTACK_KEYSTONE_DOMAIN_CHOICES = (
{% for key, value in horizon_keystone_domain_choices.items() %}
    ('{{ key }}', '{{ value }}'),
{% endfor %}
)

with :

OPENSTACK_KEYSTONE_DOMAIN_CHOICES = (
{% for key, value in horizon_keystone_domain_choices.items() %}
    ({{ key }}, {{ value }}),
{% endfor %}
)

Problem is solved in that case.

Also when setting directly the domain in contrail-kolla-ansible/ansible/roles/horizon/defaults/main.yml and without modifying local_setting template this is OK

horizon_keystone_domain_choices:
  Default: default
  domain: domain

It seems the way contrail ansible deployer generate kolla_globals variable file is the problem. Has someone a clue to avoid this problem ?

Andrey-mp commented 6 years ago

Hi @surfmax I've checked it on my side. You're right - it generates invalid config for kolla:

horizon_keystone_domain_choices: {u'Default': u'Default', u'domain': u'domain'}

LP bug for tracking is https://bugs.launchpad.net/juniperopenstack/+bug/1783146

malebeau commented 6 years ago

Thanks for this BR, Maxime

Andrey-mp commented 6 years ago

fixed. issue can be closed.