Skip to content

Add additional files to neutron-sanity-check#82

Open
tomassedovic wants to merge 1 commit intomasterfrom
neutron-sanity-check
Open

Add additional files to neutron-sanity-check#82
tomassedovic wants to merge 1 commit intomasterfrom
neutron-sanity-check

Conversation

@tomassedovic
Copy link
Collaborator

neutron-sanity-check expects to be passed all the --config-file/--config-dir
options the Neutron services receive.

Unfortunately, when we pass in a file/directory that doesn't exist, the script
crashes. So we're building the list of existing files/dirs in a shell script
and pass only the ones they're present.

We could do the same in Ansible, but that would generate a lot of duplicate
output and be more confusing to the users.

neutron-sanity-check expects to be passed all the --config-file/--config-dir
options the Neutron services receive.

Unfortunately, when we pass in a file/directory that doesn't exist, the script
crashes. So we're building the list of existing files/dirs in a shell script
and pass only the ones they're present.

We could do the same in Ansible, but that would generate a lot of duplicate
output and be more confusing to the users.
tasks:
- name: Run neutron-sanity-check
command: neutron-sanity-check --config-file /etc/neutron/neutron.conf
script: files/neutron-sanity-check '"{{config_files|join(" ")}}" "{{config_dirs|join(" ")}}"'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script expects 2 arguments, you need to remove the single quotes otherwise you'll get an unbound variable $2 error when running the script.

@mandre
Copy link
Collaborator

mandre commented Jul 5, 2016

So, I've looked at how neutron-sanity-check works, and it appears it enables checks based on what it finds in the config files. The thing is, we cannot blindly pass all the configuration files and directories we find on the machine, but instead we should only pass the ones that will appear when calling the neutron binaries. One more thing to consider: the order of --config-file and --config-dir options is important.

I'm not exactly sure what is the best way to get the list of options passed to neutron binaries.

@tomassedovic
Copy link
Collaborator Author

Hm, right. So the authoritative place for these is the systemd unit files. Although in HA setup, we're managing some services via pacemaker and I'm not sure if Neutron is one of them.

We could try to read this list from the unit files (that's how I built this list manually), but that would be platform-specific (TripleO only supports only RHEL and CentOS so we should be fine for now). A lot of these config files and directories passed to neutron don't actually exist which is why I had to add the shell script.

What I tried to do here is to have a default list that can be overridden, but I get your point.

So, do you have any ideas on how to proceed with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants