diff --git a/ansible/roles/nova/handlers/main.yml b/ansible/roles/nova/handlers/main.yml index e34c6ad37f..9c07db7c63 100644 --- a/ansible/roles/nova/handlers/main.yml +++ b/ansible/roles/nova/handlers/main.yml @@ -287,6 +287,7 @@ or nova_conf.changed | bool or policy_overwriting.changed | bool or vcenter_ca_file | bool + or nova_compute_release_file | bool or nova_compute_container.changed | bool - name: Restart nova-compute-ironic container diff --git a/ansible/roles/nova/tasks/config.yml b/ansible/roles/nova/tasks/config.yml index 9c9a2e75ae..22c537b1cd 100644 --- a/ansible/roles/nova/tasks/config.yml +++ b/ansible/roles/nova/tasks/config.yml @@ -178,6 +178,25 @@ notify: - Restart nova-compute container +- name: Copying 'release' file for nova_compute + vars: + service: "{{ nova_services['nova-compute'] }}" + copy: + src: "{{ item }}" + dest: "{{ node_config_directory }}/nova-compute/release" + with_first_found: + - files: + - "{{ node_custom_config }}/nova_compute/{{ inventory_hostname }}/release" + - "{{ node_custom_config }}/nova_compute/release" + - "{{ node_custom_config }}/nova/release" + skip: true + register: nova_compute_release_file + when: + - inventory_hostname in groups[service.group] + - service.enabled | bool + notify: + - Restart nova-compute container + - name: Copying over existing policy file become: true vars: diff --git a/ansible/roles/nova/templates/nova-compute.json.j2 b/ansible/roles/nova/templates/nova-compute.json.j2 index c0f125e01c..61305c3794 100644 --- a/ansible/roles/nova/templates/nova-compute.json.j2 +++ b/ansible/roles/nova/templates/nova-compute.json.j2 @@ -24,7 +24,14 @@ "dest": "/etc/nova/vmware_ca", "owner": "nova", "perm": "0600" - }{% endif %} + }{% endif %}, + { + "source": "{{ container_config_directory }}/release", + "dest": "/etc/nova/release", + "owner": "nova", + "perm": "0600", + "optional": true + } ], "permissions": [ { diff --git a/releasenotes/notes/config-nova-release-97e6fc526a94740e.yaml b/releasenotes/notes/config-nova-release-97e6fc526a94740e.yaml new file mode 100644 index 0000000000..a09227278b --- /dev/null +++ b/releasenotes/notes/config-nova-release-97e6fc526a94740e.yaml @@ -0,0 +1,12 @@ +--- +features: + - | + You can customise vendor info that is used through out Nova via the + 'release' file. To do this place a file called 'release' in one of the + following locations: + /etc/kolla/config/nova/release + /etc/kolla/config/nova_compute/release + /etc/kolla/config/nova_compute/{{ inventory_hostname }}/release + + An example of the file can be seen at + https://github.com/openstack/nova/blob/master/etc/nova/release.sample