Skip to content

Instantly share code, notes, and snippets.

@stevelle
Last active March 10, 2017 21:27
Show Gist options
  • Save stevelle/1f7f82b7af787b0bc1097276d2a917a0 to your computer and use it in GitHub Desktop.
Save stevelle/1f7f82b7af787b0bc1097276d2a917a0 to your computer and use it in GitHub Desktop.
neutron_lbaasv2_haproxy_driver: LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver
neutron_lbaasv2_octavia_driver: LOADBALANCERV2:Octavia:neutron_lbaas.drivers.octavia.driver.OctaviaDriver
neutron_lbaasv2_service_drivers: "{{[ neutron_lbaasv2_haproxy_driver if neutron_lbaasv2_service_provider | bool, neutron_lbaasv2_octavia_driver if neutron_lbaas_octavia | bool ]}}"
neutron_lbaasv2_service_provider: "{{ neutron_lbaasv2_service_drivers | join(',') }}{% if neutron_lbaasv2_service_drivers | length > 0 %}:default{% endif %}"
# If it rejects the empty list entries here, or the join includes empty entries causing extra commas, we might be able
# to work around it as such:
# - use "neutron_lbaasv2_service_drivers | reject('none') | join(',')" on line 5
@stevelle
Copy link
Author

stevelle commented Mar 10, 2017

maybe

neutron_lbaasv2_service_drivers: "{{[] + (neutron_lbaasv2_haproxy_driver if neutron_lbaasv2_service_provider | bool else None) + (neutron_lbaasv2_octavia_driver if neutron_lbaas_octavia | bool else None)
}}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment