diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index 07f52f156..f847b5824 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -96,6 +96,8 @@ mime: False register: stat_result with_items: + - { name: ceph, file: ceph.conf } + - { name: cinder, file: cinder.conf } - { name: glance, file: glance.conf } - { name: heat, file: heat.conf } - { name: inspector, file: ironic-inspector.conf } @@ -192,6 +194,8 @@ kolla_inspector_dhcp_pool_end: "{{ inspection_net_name | net_inspection_allocation_pool_end }}" kolla_inspector_default_gateway: "{{ inspection_net_name | net_inspection_gateway or inspection_net_name | net_gateway }}" # Extra free-form user-provided configuration. + kolla_extra_ceph: "{{ kolla_extra_config.ceph | default }}" + kolla_extra_cinder: "{{ kolla_extra_config.cinder | default }}" kolla_extra_glance: "{{ kolla_extra_config.glance | default }}" kolla_extra_heat: "{{ kolla_extra_config.heat | default }}" kolla_extra_inspector: "{{ kolla_extra_config.inspector | default }}" diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml index d1bf9e7a0..4149ab4b9 100644 --- a/ansible/roles/kolla-openstack/defaults/main.yml +++ b/ansible/roles/kolla-openstack/defaults/main.yml @@ -5,6 +5,24 @@ kolla_extra_config_path: # Directory where Kolla custom configuration files will be installed. kolla_node_custom_config_path: +############################################################################### +# ceph configuration. + +# Whether to enable ceph. +kolla_enable_ceph: + +# Free form extra configuration to append to ceph.conf. +kolla_extra_ceph: + +############################################################################### +# cinder configuration. + +# Whether to enable cinder. +kolla_enable_cinder: + +# Free form extra configuration to append to cinder.conf. +kolla_extra_cinder: + ############################################################################### # Glance configuration. diff --git a/ansible/roles/kolla-openstack/tasks/config.yml b/ansible/roles/kolla-openstack/tasks/config.yml index 68db1d609..1f3ea22bc 100644 --- a/ansible/roles/kolla-openstack/tasks/config.yml +++ b/ansible/roles/kolla-openstack/tasks/config.yml @@ -13,6 +13,8 @@ dest: "{{ kolla_node_custom_config_path }}/{{ item.dest }}" mode: 0640 with_items: + - { src: ceph.conf.j2, dest: ceph.conf, enabled: "{{ kolla_enable_ceph }}" } + - { src: cinder.conf.j2, dest: cinder.conf, enabled: "{{ kolla_enable_cinder }}" } - { src: glance.conf.j2, dest: glance.conf, enabled: "{{ kolla_enable_glance }}" } - { src: heat.conf.j2, dest: heat.conf, enabled: "{{ kolla_enable_heat }}" } - { src: ironic.conf.j2, dest: ironic.conf, enabled: "{{ kolla_enable_ironic }}" } diff --git a/ansible/roles/kolla-openstack/templates/ceph.conf.j2 b/ansible/roles/kolla-openstack/templates/ceph.conf.j2 new file mode 100644 index 000000000..cb043a62d --- /dev/null +++ b/ansible/roles/kolla-openstack/templates/ceph.conf.j2 @@ -0,0 +1,9 @@ +# {{ ansible_managed }} + +{% if kolla_extra_ceph %} +####################### +# Extra configuration +####################### + +{{ kolla_extra_ceph }} +{% endif %} diff --git a/ansible/roles/kolla-openstack/templates/cinder.conf.j2 b/ansible/roles/kolla-openstack/templates/cinder.conf.j2 new file mode 100644 index 000000000..9acf122df --- /dev/null +++ b/ansible/roles/kolla-openstack/templates/cinder.conf.j2 @@ -0,0 +1,9 @@ +# {{ ansible_managed }} + +{% if kolla_extra_cinder %} +####################### +# Extra configuration +####################### + +{{ kolla_extra_cinder }} +{% endif %} diff --git a/ansible/roles/kolla-openstack/vars/main.yml b/ansible/roles/kolla-openstack/vars/main.yml index c6f374e8c..f7a9cde32 100644 --- a/ansible/roles/kolla-openstack/vars/main.yml +++ b/ansible/roles/kolla-openstack/vars/main.yml @@ -14,6 +14,11 @@ kolla_openstack_custom_config: dest: "{{ kolla_node_custom_config_path }}/ceph" patterns: "*" enabled: "{{ kolla_enable_ceph }}" + # Cinder. + - src: "{{ kolla_extra_config_path }}/cinder" + dest: "{{ kolla_node_custom_config_path }}/cinder" + patterns: "*" + enabled: "{{ kolla_enable_cinder }}" # Fluentd filters. - src: "{{ kolla_extra_config_path }}//fluentd/filter" dest: "{{ kolla_node_custom_config_path }}/fluentd/filter"