From 3d1018dea90f2d7ba531842aed60d8c371505843 Mon Sep 17 00:00:00 2001 From: Nick Jones Date: Thu, 22 Nov 2018 18:51:39 +0000 Subject: [PATCH] Add support for a custom octavia.conf file Kayobe should be able to handle extra configuration options in Octavia's main configuration file, in a similar fashion to other services. This commit adds support for just that. TrivialFix Change-Id: Ibd91a90a5278bcd8963fb06874a74f71b1882d89 --- ansible/kolla-openstack.yml | 2 ++ .../molecule/enable-everything/molecule.yml | 3 +++ .../molecule/enable-everything/tests/test_default.py | 1 + ansible/roles/kolla-openstack/tasks/config.yml | 1 + ansible/roles/kolla-openstack/templates/octavia.conf.j2 | 9 +++++++++ 5 files changed, 16 insertions(+) create mode 100644 ansible/roles/kolla-openstack/templates/octavia.conf.j2 diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index d5b8c308d..7386624c5 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -115,6 +115,7 @@ - { name: neutron, file: neutron.conf } - { name: neutron_ml2, file: neutron/ml2_conf.ini } - { name: nova, file: nova.conf } + - { name: octavia, file: octavia.conf } - { name: sahara, file: sahara.conf } - { name: zookeeper, file: zookeeper.cfg } @@ -217,6 +218,7 @@ kolla_extra_neutron: "{{ kolla_extra_config.neutron | default }}" kolla_extra_neutron_ml2: "{{ kolla_extra_config.neutron_ml2 | default }}" kolla_extra_nova: "{{ kolla_extra_config.nova | default }}" + kolla_extra_octavia: "{{ kolla_extra_config.octavia | default }}" kolla_extra_sahara: "{{ kolla_extra_config.sahara | default }}" kolla_extra_zookeeper: "{{ kolla_extra_config.zookeeper | default }}" kolla_extra_config_path: "{{ kayobe_config_path }}/kolla/config" diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml index 1fa811fba..2460e6b3c 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml @@ -79,6 +79,9 @@ provisioner: [extra-nova.conf] foo=bar kolla_enable_octavia: true + kolla_extra_octavia: | + [extra-octavia.conf] + foo=bar kolla_enable_sahara: true kolla_extra_sahara: | [extra-sahara.conf] diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py b/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py index 3953530b9..b9658504c 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py @@ -74,6 +74,7 @@ def test_service_config_directory(host, path): 'murano.conf', 'neutron.conf', 'nova.conf', + 'octavia.conf', 'sahara.conf', 'zookeeper.cfg']) def test_service_ini_file(host, path): diff --git a/ansible/roles/kolla-openstack/tasks/config.yml b/ansible/roles/kolla-openstack/tasks/config.yml index 10bc931a1..f982c8dcf 100644 --- a/ansible/roles/kolla-openstack/tasks/config.yml +++ b/ansible/roles/kolla-openstack/tasks/config.yml @@ -28,6 +28,7 @@ - { src: murano.conf.j2, dest: murano.conf, enabled: "{{ kolla_enable_murano }}" } - { src: neutron.conf.j2, dest: neutron.conf, enabled: "{{ kolla_enable_neutron }}" } - { src: nova.conf.j2, dest: nova.conf, enabled: "{{ kolla_enable_nova }}" } + - { src: octavia.conf.j2, dest: octavia.conf, enabled: "{{ kolla_enable_octavia }}" } - { src: pxelinux.default.j2, dest: ironic/pxelinux.default, enabled: "{{ kolla_enable_ironic }}" } - { src: inspector.ipxe.j2, dest: ironic/inspector.ipxe, enabled: "{{ kolla_enable_ironic_ipxe }}" } - { src: sahara.conf.j2, dest: sahara.conf, enabled: "{{ kolla_enable_sahara }}" } diff --git a/ansible/roles/kolla-openstack/templates/octavia.conf.j2 b/ansible/roles/kolla-openstack/templates/octavia.conf.j2 new file mode 100644 index 000000000..4210d8485 --- /dev/null +++ b/ansible/roles/kolla-openstack/templates/octavia.conf.j2 @@ -0,0 +1,9 @@ +# {{ ansible_managed }} + +{% if kolla_extra_octavia %} +####################### +# Extra configuration +####################### + +{{ kolla_extra_octavia }} +{% endif %}