Skip to content
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

myql and sqlite3 schema path/filename variable add #98

Closed
wants to merge 4 commits into from

Conversation

npmdnl
Copy link
Contributor

@npmdnl npmdnl commented Apr 22, 2021

In order to avoid problems with the previous rules that forged the path/filename for the DB schema switching by case for different platform/version etc. I am proposing a fixed variable way to setup the path/filename using eg. vars/Debian.yml line entry.
Case one will be for ArchLinux platform case two for RH and Debian/Ubuntu platform.
In every case we have a different schema filename for mysql or sqlite3 obviously.

@giannipace
Copy link
Contributor

Looks good, please add the new variables in the Readme.md

@@ -52,7 +38,7 @@
- block:

- name: Create the PowerDNS SQLite databases on Debian
shell: "sqlite3 {{ item }} < /usr/share/doc/pdns-backend-sqlite3/schema.sqlite3.sql"
shell: "sqlite3 {{ item }} < {{ pdns_deb_sqlite3_schema_file }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see why we'd have a separate variable name for each distro type, this is why we have the vars file that set this. I would prefer to have a pdns_sqlite3_schema_file (etc.) that are set in the vars by defaults.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I get it well you propose just two (sqlite3 and mysql schemas variables) in the defaults/main.yml file that will look like the following. Correct?

pdns_mysql_schema_file: "/usr/share/doc/pdns-backend-mysql/schema.mysql.sql"
pdns_sqlite3_schema_file: "/usr/share/doc/pdns-backend-sqlite3/schema.sqlite3.sql"

Copy link
Contributor

Choose a reason for hiding this comment

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

Indedd, whose values are set via an underscore var from the vars/* files

@npmdnl npmdnl requested a review from pieterlexis May 10, 2021 15:13
npmdnl and others added 2 commits May 11, 2021 11:14
…riable per db. No more switch case for different db engine version
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.

3 participants