From 959e29f563432f56dcf629a69a56be933e106d7a Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Thu, 21 Sep 2023 10:46:29 +0200 Subject: [PATCH] Fix dest path of the neutron-sriov-agent config dir It seems that neutron loads automatically user config files from the /etc/neutron/conf.d directory instead of /etc/neutron.conf.d. So this patch changes where edpm_neutron_sriov role places custom neutron config files so they can be used by the running agent. --- roles/edpm_neutron_sriov/defaults/main.yml | 2 +- .../molecule/default/verify.yml | 38 +++++++++++++++---- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/roles/edpm_neutron_sriov/defaults/main.yml b/roles/edpm_neutron_sriov/defaults/main.yml index 25613143c..66da98a22 100644 --- a/roles/edpm_neutron_sriov/defaults/main.yml +++ b/roles/edpm_neutron_sriov/defaults/main.yml @@ -25,7 +25,7 @@ edpm_neutron_sriov_image: "quay.io/podified-antelope-centos9/openstack-neutron-s edpm_neutron_sriov_common_volumes: - /lib/modules:/lib/modules:ro - /dev:/dev - - "{{ edpm_neutron_sriov_agent_config_dir }}:/etc/neutron.conf.d:z" + - "{{ edpm_neutron_sriov_agent_config_dir }}:/etc/neutron/conf.d:z" - /var/lib/neutron:/var/lib/neutron:shared,z - /var/lib/kolla/config_files/neutron_sriov_agent.json:/var/lib/kolla/config_files/config.json:ro - /var/log/containers/neutron:/var/log/neutron:z diff --git a/roles/edpm_neutron_sriov/molecule/default/verify.yml b/roles/edpm_neutron_sriov/molecule/default/verify.yml index 8fe6985b9..562c84ced 100644 --- a/roles/edpm_neutron_sriov/molecule/default/verify.yml +++ b/roles/edpm_neutron_sriov/molecule/default/verify.yml @@ -38,16 +38,40 @@ - log_file.stat.exists fail_msg: "File /var/log/containers/neutron/neutron-sriov-nic-agent.log does not exist" - - name: Ensure that 10-neutron-sriov.conf was copied into the container + - name: Ensure that all neutron sriov agent config files were copied into the container block: - - name: sriov config file exists + - name: "check if sriov config file 01-neutron.conf exists" become: true ansible.builtin.stat: - path: "/var/lib/config-data/ansible-generated/neutron-sriov-agent/10-neutron-sriov.conf" - register: sriov_config + path: "/var/lib/config-data/ansible-generated/neutron-sriov-agent/01-neutron.conf" + register: neutron_conf - - name: assert that the config exists + - name: "assert that the config file 01-neutron.conf exists" ansible.builtin.assert: that: - - sriov_config.stat.exists - fail_msg: "sriov agent config file does not exist" + - neutron_conf.stat.exists + fail_msg: "sriov agent config file 01-neutron.conf does not exist" + + - name: "check if sriov config file 01-rootwrap.conf exists" + become: true + ansible.builtin.stat: + path: "/var/lib/config-data/ansible-generated/neutron-sriov-agent/01-rootwrap.conf" + register: rootwrap_conf + + - name: "assert that the config file 01-rootwrap.conf exists" + ansible.builtin.assert: + that: + - rootwrap_conf.stat.exists + fail_msg: "sriov agent config file 01-rootwrap.conf does not exist" + + - name: "check if sriov config file 01-neutron-sriov-agent.conf exists" + become: true + ansible.builtin.stat: + path: "/var/lib/config-data/ansible-generated/neutron-sriov-agent/01-neutron-sriov-agent.conf" + register: neutron_sriov_agent_conf + + - name: "assert that the config file 01-neutron-sriov-agent.conf exists" + ansible.builtin.assert: + that: + - neutron_sriov_agent_conf.stat.exists + fail_msg: "sriov agent config file 01-neutron-sriov-agent.conf does not exist"