This repository has been archived by the owner on Feb 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c40e805
commit 83c7fde
Showing
39 changed files
with
726 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,9 @@ | ||
Since Drupal VM is built in a modular fashion, you can swap out the database engine and use [PostgreSQL](https://www.postgresql.org/) instead of MySQL (as long as the version of Drupal you're using supports it!). | ||
|
||
To switch from MySQL to PostgreSQL, switch the `drupalvm_database` setting in your local `config.yml` to `pgsql`: | ||
|
||
```yaml | ||
drupalvm_database: mysql | ||
``` | ||
For more PostgreSQL configuration options, see the README included with the [`geerlingguy.postgresql](https://galaxy.ansible.com/geerlingguy/postgresql/) Ansible role. |
This file contains 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 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 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 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 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,46 @@ | ||
--- | ||
services: docker | ||
|
||
env: | ||
- distro: centos7 | ||
init: /usr/lib/systemd/systemd | ||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" | ||
- distro: ubuntu1604 | ||
init: /lib/systemd/systemd | ||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" | ||
|
||
before_install: | ||
# Pull container. | ||
- 'docker pull geerlingguy/docker-${distro}-ansible:latest' | ||
|
||
script: | ||
- container_id=$(mktemp) | ||
# Run container in detached state. | ||
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"' | ||
|
||
# Install dependencies. | ||
- 'docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/role_under_test/tests/requirements.yml' | ||
|
||
# Ansible syntax check. | ||
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check' | ||
|
||
# Test role. | ||
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml' | ||
|
||
# Test role idempotence. | ||
- idempotence=$(mktemp) | ||
- docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml | tee -a ${idempotence} | ||
- > | ||
tail ${idempotence} | ||
| grep -q 'changed=0.*failed=0' | ||
&& (echo 'Idempotence test: pass' && exit 0) | ||
|| (echo 'Idempotence test: fail' && exit 1) | ||
# Ensure PHP PostgreSQL support is enabled. | ||
- docker exec --tty "$(cat ${container_id})" env TERM=xterm php -i | grep 'PostgreSQL Support => enabled' | ||
|
||
after_failure: | ||
- docker exec --tty "$(cat ${container_id})" env TERM=xterm php -i | ||
|
||
notifications: | ||
webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
This file contains 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,42 @@ | ||
# Ansible Role: PHP-PostgreSQL | ||
|
||
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-php-pgsql.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-php-pgsql) | ||
|
||
Installs PHP [PostgreSQL](https://www.postgresql.org/) support on Linux. | ||
|
||
## Requirements | ||
|
||
None. | ||
|
||
## Role Variables | ||
|
||
Available variables are listed below, along with default values (see `defaults/main.yml`): | ||
|
||
php_enablerepo: "" | ||
|
||
(RedHat/CentOS only) If you have enabled any additional repositories (might I suggest geerlingguy.repo-epel or geerlingguy.repo-remi), those repositories can be listed under this variable (e.g. `remi,epel`). This can allow you to install later versions of PHP packages. | ||
|
||
php_pgsql_package: php-pgsql # RedHat | ||
php_pgsql_package: php7.0-pgsql # Debian | ||
|
||
The PHP PostgreSQL package to install via apt/yum. This should only be overridden if you need to install a unique/special package for PostgreSQL support, as in the case of using software collections on Enterprise Linux. | ||
|
||
## Dependencies | ||
|
||
- geerlingguy.php | ||
|
||
## Example Playbook | ||
|
||
- hosts: webservers | ||
roles: | ||
- geerlingguy.postgresql | ||
- geerlingguy.php | ||
- geerlingguy.php-pgsql | ||
|
||
## License | ||
|
||
MIT / BSD | ||
|
||
## Author Information | ||
|
||
This role was created in 2016 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). |
This file contains 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,3 @@ | ||
--- | ||
# Pass in a comma-separated list of repos to use (e.g. "remi,epel"). | ||
php_enablerepo: "" |
This file contains 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,26 @@ | ||
--- | ||
dependencies: | ||
- geerlingguy.php | ||
|
||
galaxy_info: | ||
author: geerlingguy | ||
description: PHP PostgreSQL support for Linux. | ||
company: "Midwestern Mac, LLC" | ||
license: "license (BSD, MIT)" | ||
min_ansible_version: 1.8 | ||
platforms: | ||
- name: EL | ||
versions: | ||
- all | ||
- name: Debian | ||
versions: | ||
- all | ||
- name: Ubuntu | ||
versions: | ||
- all | ||
galaxy_tags: | ||
- database | ||
- web | ||
- postgres | ||
- php | ||
- pgsql |
This file contains 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,29 @@ | ||
--- | ||
# Variable setup. | ||
- name: Include OS-specific variables. | ||
include_vars: "{{ ansible_os_family }}.yml" | ||
|
||
- name: Define php_pgsql_package. | ||
set_fact: | ||
php_pgsql_package: "{{ __php_pgsql_package }}" | ||
when: php_pgsql_package is not defined | ||
|
||
# Installation. | ||
- name: Install PHP PostgreSQL dependencies (RedHat). | ||
yum: | ||
name: "{{ php_pgsql_package }}" | ||
state: present | ||
enablerepo: "{{ php_enablerepo }}" | ||
notify: | ||
- restart webserver | ||
- restart php-fpm | ||
when: ansible_os_family == 'RedHat' | ||
|
||
- name: Install PHP PostgreSQL dependencies (Debian). | ||
apt: | ||
name: "{{ php_pgsql_package }}" | ||
state: present | ||
notify: | ||
- restart webserver | ||
- restart php-fpm | ||
when: ansible_os_family == 'Debian' |
5 changes: 5 additions & 0 deletions
5
provisioning/roles/geerlingguy.php-pgsql/tests/requirements.yml
This file contains 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,5 @@ | ||
--- | ||
- src: geerlingguy.repo-remi | ||
- src: geerlingguy.apache | ||
- src: geerlingguy.postgresql | ||
- src: geerlingguy.php |
This file contains 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,18 @@ | ||
--- | ||
- hosts: all | ||
|
||
vars: | ||
php_enablerepo: "remi,remi-php70" | ||
|
||
pre_tasks: | ||
- name: Update apt cache. | ||
apt: update_cache=yes | ||
when: ansible_os_family == 'Debian' | ||
|
||
roles: | ||
- role: geerlingguy.repo-remi | ||
when: ansible_os_family == 'RedHat' | ||
- geerlingguy.apache | ||
- geerlingguy.postgresql | ||
- geerlingguy.php | ||
- role_under_test |
This file contains 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,2 @@ | ||
--- | ||
__php_pgsql_package: php7.0-pgsql |
This file contains 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,2 @@ | ||
--- | ||
__php_pgsql_package: php-pgsql |
Oops, something went wrong.