Configure missing nova services to expose vendordata over configdrive

Closes-Bug: #2049607

Change-Id: I14ae2be2e19ad06e3190e2e948bac7ce77e80d4b
(cherry picked from commit 0376f9dd8d)
This commit is contained in:
Grzegorz Koper 2024-01-17 10:56:13 +01:00 committed by Pierre Riteau
parent 10e68dcd17
commit c67aee482c
5 changed files with 54 additions and 0 deletions

View File

@ -40,6 +40,19 @@
when: when:
- nova_policy.results - nova_policy.results
- name: Check for vendordata file
stat:
path: "{{ node_custom_config }}/nova/vendordata.json"
delegate_to: localhost
run_once: True
register: vendordata_file
- name: Set vendordata file path
set_fact:
vendordata_file_path: "{{ vendordata_file.stat.path }}"
when:
- vendordata_file.stat.exists
- name: Copying over config.json files for services - name: Copying over config.json files for services
become: true become: true
template: template:
@ -201,3 +214,21 @@
with_dict: "{{ nova_cell_services }}" with_dict: "{{ nova_cell_services }}"
notify: notify:
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
- name: Copying over vendordata file to containers
vars:
service: "{{ nova_cell_services[item] }}"
copy:
src: "{{ vendordata_file_path }}"
dest: "{{ node_config_directory }}/{{ item }}/vendordata.json"
mode: "0660"
become: True
when:
- vendordata_file_path is defined
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify:
- "Restart {{ item }} container"
with_items:
- nova-compute
- nova-compute-ironic

View File

@ -12,6 +12,12 @@
"dest": "/etc/nova/{{ nova_policy_file }}", "dest": "/etc/nova/{{ nova_policy_file }}",
"owner": "nova", "owner": "nova",
"perm": "0600" "perm": "0600"
}{% endif %}{% if vendordata_file_path is defined %},
{
"source": "{{ container_config_directory }}/vendordata.json",
"dest": "/etc/nova/vendordata.json",
"owner": "nova",
"perm": "0600"
}{% endif %} }{% endif %}
], ],
"permissions": [ "permissions": [

View File

@ -67,6 +67,12 @@
"dest": "/etc/nova/provider_config/provider_config.yaml", "dest": "/etc/nova/provider_config/provider_config.yaml",
"owner": "nova", "owner": "nova",
"perm": "0600" "perm": "0600"
}{% endif %}{% if vendordata_file_path is defined %},
{
"source": "{{ container_config_directory }}/vendordata.json",
"dest": "/etc/nova/vendordata.json",
"owner": "nova",
"perm": "0600"
}{% endif %} }{% endif %}
], ],
"permissions": [ "permissions": [

View File

@ -36,6 +36,11 @@ compute_monitors=nova.compute.monitors.cpu.virt_driver
transport_url = {{ nova_cell_rpc_transport_url }} transport_url = {{ nova_cell_rpc_transport_url }}
{% if vendordata_file_path is defined and (service_name == 'nova-compute' or service_name == 'nova-compute-ironic') %}
[api]
vendordata_jsonfile_path = /etc/nova/vendordata.json
{% endif %}
[conductor] [conductor]
workers = {{ nova_cell_conductor_workers }} workers = {{ nova_cell_conductor_workers }}

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixes configuration of nova-compute and nova-compute-ironic,
that will enable exposing vendordata over configdrive.
`LP#2049607 <https://bugs.launchpad.net/kolla-ansible/+bug/2049607>`__