This repository was archived by the owner on Feb 13, 2023. It is now read-only.
-
- Notifications
You must be signed in to change notification settings - Fork 634
[WIP] Support PostgreSQL #490
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits Select commit Hold shift + click to select a range
ff83b1a Add support for PostgreSQL
oxyc 2d77b45 Fix incorrect database variable used for drush si
oxyc 86c0133 Add drush debug info to travis
oxyc 636fd61 Add docs about PostgreSQL
oxyc e03ce17 Support both mysql and pgsql
oxyc fec5a2a Change drupal database variable names be more generic
oxyc 2b32861 fix incorrect mysql root password in dashboard
oxyc cde7d41 Limit postgresql testing to one limited build
oxyc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| By default Drupal VM uses the package managers version of MySQL. If you're using RedHat 7 or CentOS 7 there is no MySQL package available and you need to use MariaDB instead. | ||
| | ||
| ## Using MySQL | ||
| | ||
| This is the default setup for Drupal VM but for reference you need the following configuration in your `config.yml` | ||
| | ||
| ```yaml | ||
| # The database engine to use. Can be either 'mysql' or 'pgsql'. | ||
| drupal_database_engine: mysql | ||
| | ||
| # MySQL Databases and users. If build_makefile: is true, first database will | ||
| # be used for the makefile-built site. | ||
| mysql_databases: | ||
| - name: "{{ drupal_database_name }}" | ||
| encoding: utf8 | ||
| collation: utf8_general_ci | ||
| | ||
| mysql_users: | ||
| - name: "{{ drupal_database_user }}" | ||
| host: "%" | ||
| password: "{{ drupal_database_password }}" | ||
| priv: "{{ drupal_database_name }}.*:ALL" | ||
| | ||
| installed_extras: | ||
| - ... | ||
| - mysql | ||
| ``` | ||
| | ||
| ## Using MariaDB | ||
| | ||
| Since Drupal VM is built in a modular fashion, and the upstream Ansible Role that installs and configures MySQL is built in a way that works with any MySQL-compatible replacement, you can easily swap out MySQL for MariaDB. | ||
| | ||
| The simplest way is to add the following lines after the `# MySQL Configuration.` line in `config.yml`: | ||
| | ||
| ```yaml | ||
| mysql_packages: | ||
| - mariadb-client | ||
| - mariadb-server | ||
| - python-mysqldb | ||
| ``` | ||
| | ||
| This set of packages works out of the box with the default Ubuntu 14.04 installation that comes with Drupal VM. | ||
| | ||
| Alternatively, if you want to use RedHat 7 or CentOS 7 instead of Ubuntu, you can set the following variables to install and configure MariaDB instead of MySQL: | ||
| | ||
| ```yaml | ||
| mysql_packages: | ||
| - mariadb | ||
| - mariadb-server | ||
| - mariadb-libs | ||
| - MySQL-python | ||
| - perl-DBD-MySQL | ||
| mysql_daemon: mariadb | ||
| mysql_socket: /var/lib/mysql/mysql.sock | ||
| mysql_log_error: /var/log/mariadb/mariadb.log | ||
| mysql_syslog_tag: mariadb | ||
| mysql_pid_file: /var/run/mariadb/mariadb.pid | ||
| ``` | ||
| | ||
| The configurations are the same as for MySQL and you can find out more options in the [`geerlingguy.mysql` Ansible role's README](https://github.com/geerlingguy/ansible-role-mysql#readme). | ||
| | ||
| ## Using PostgreSQL | ||
| | ||
| If you prefer to use PostgreSQL instead of MySQL/MariaDB you can install it by changing the `drupal_database_engine` variable to `pgsql`: | ||
| | ||
| ```yaml | ||
| drupal_database_engine: pgsql | ||
| ``` | ||
| | ||
| And adding `pgsql` to `installed_extras` list: | ||
| | ||
| ```yaml | ||
| installed_extras: | ||
| - ... | ||
| - pgsql | ||
| ``` | ||
| | ||
| To create the drupal database and the database user also add this to your `config.yml`: | ||
| | ||
| ```yaml | ||
| # PostgreSQL | ||
| postgresql_databases: | ||
| - name: "{{ drupal_database_name }}" | ||
| owner: "{{ drupal_database_user }}" | ||
| | ||
| postgresql_users: | ||
| - name: "{{ drupal_database_user }}" | ||
| pass: "{{ drupal_database_password }}" | ||
| encrypted: no | ||
| | ||
| postgresql_user_privileges: | ||
| - name: "{{ drupal_database_user }}" | ||
| db: "{{ drupal_database_user }}" | ||
| priv: "ALL" | ||
| ``` | ||
| | ||
| For more configuration options see the [`ANXS.postgresql` Ansible role's README](https://github.com/ANXS/postgresql#readme). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| --- | ||
| - src: ANXS.postgresql | ||
| - src: arknoll.selenium | ||
| - src: geerlingguy.adminer | ||
| - src: geerlingguy.apache | ||
| | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'd like to follow the pattern of setting this up in a separate role. Will try to get to that soon.