-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review config file load order, location support #3
Comments
I think a good intermediate step would be to go ahead and rename the current "live" config files to |
Current results from quick hacking on the code/files. Posting here as a reminder for where I left off when I pick up and finish the work later. In short, I expected this error, just wanted to remind myself of the specifics before working further. |
Test output from some work to use template files for testing purposes. On the first run the files are not present, on a follow-up run they are from the prior run.
Already up-to-date.
HEAD is now at 7eea346 Fix fall-back filter behavior
Already on 'deactivate-template-config-files'
Your branch is up-to-date with 'origin/deactivate-template-config-files'.
Already up-to-date.
ownership of '/var/cache/mysql2sqlite/mailserver.db' retained as ubuntu:ubuntu
ownership of '/var/cache/mysql2sqlite' retained as ubuntu:ubuntu
Deploying template config files
'/tmp/mysql2sqlite/mysql2sqlite_general.ini.tmpl' -> '/tmp/mysql2sqlite/mysql2sqlite_general.ini'
'/tmp/mysql2sqlite/mysql2sqlite_queries.ini.tmpl' -> '/tmp/mysql2sqlite/mysql2sqlite_queries.ini'
Successfully generated SQLite db file.
Run python3 /tmp/mysql2sqlite-dev/bin/validate_dbs.py next to confirm db was created properly.
Already up-to-date.
HEAD is now at 7eea346 Fix fall-back filter behavior
Already on 'deactivate-template-config-files'
Your branch is up-to-date with 'origin/deactivate-template-config-files'.
Already up-to-date.
ownership of '/var/cache/mysql2sqlite/mailserver.db' retained as ubuntu:ubuntu
ownership of '/var/cache/mysql2sqlite' retained as ubuntu:ubuntu
Configuration files found in /tmp/mysql2sqlite. Using those files.
Successfully generated SQLite db file.
Run python3 /tmp/mysql2sqlite-dev/bin/validate_dbs.py next to confirm db was created properly. |
Wrapper script accepts cmdline option in order to mimic main script functionality and to pass-through to main script. cmdline option takes precedence over other locations. refs WhyAskWhy#2 refs WhyAskWhy/mysql2sqlite#3
- repo-provided INI files have been renamed to *.tmpl in order to prevent them from being used as-is or risk clobbering local/custom config files if user opts to install directly from Git repo. - Adjust log formatters to include line number for messages - Replace explicit exit calls from within our library function calls. - Adjust system-wide config path from /etc/DOMAIN/PROJECT to just /etc/PROJECT in order to better match the norm for /etc content layout. - Improve exception handling for config file parsing issues - Provide support for user-level config files - cmdline - $HOME/.config/PROJECT - Fall back to logging warning/error messages to the console if settings object is not provided to constructor. Adjust filter for handler later once the settings object is properly constructed. refs WhyAskWhy/mysql2sqlite-dev#2 refs WhyAskWhy#3
- repo-provided INI files have been renamed to *.tmpl in order to prevent them from being used as-is or risk clobbering local/custom config files if user opts to install directly from Git repo. - Adjust log formatters to include line number for messages - Replace explicit exit calls from within our library function calls. - Adjust system-wide config path from /etc/DOMAIN/PROJECT to just /etc/PROJECT in order to better match the norm for /etc content layout. - Improve exception handling for config file parsing issues - Provide support for user-level config files - cmdline - $HOME/.config/PROJECT - Fall back to logging warning/error messages to the console if settings object is not provided to constructor. Adjust filter for handler later once the settings object is properly constructed. refs WhyAskWhy/mysql2sqlite-dev#2 refs WhyAskWhy#3
Look for config files in the paths specified on commandline and by environment variable. If found, skip deploying template files prior to attempting generation of SQLite file. refs WhyAskWhy/mysql2sqlite#3
Look for config files in the paths specified on command-line and by environment variable. If found, skip deploying template files prior to attempting generation of SQLite file. refs WhyAskWhy/mysql2sqlite#3
I was watching an Ansible training video earlier today and saw this list of supported paths for the Ansible configuration file:
Ansible_Config
environment variableansible.cfg
file in current directory.ansible.cfg
file in user's home directory/etc/ansible/ansible.cfg
default settings filein addition to those, I think we can/should add support for one more:
I've not researched whether the files are merged with settings in one overriding settings in others or if just one file is used. For our purposes, just going with one file is probably sufficient.
Without looking at the code, I think we're already handling points 2 and 4, shouldn't be too hard to add support for the others.
The text was updated successfully, but these errors were encountered: