Skip to content

Commit

Permalink
Fix dest path of the neutron-sriov-agent config dir
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slawqo committed Sep 21, 2023
1 parent 993bd2b commit 959e29f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion roles/edpm_neutron_sriov/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 31 additions & 7 deletions roles/edpm_neutron_sriov/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 959e29f

Please sign in to comment.