Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
Fixes geerlingguy#146: Ensure PostgreSQL database is set up for Drupa…
Browse files Browse the repository at this point in the history
…l install.
  • Loading branch information
geerlingguy authored and kekkis committed Feb 23, 2017
1 parent fdf110e commit 1a482a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 0 additions & 7 deletions default.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,6 @@ mysql_slow_query_time: 2
mysql_wait_timeout: 300
adminer_install_filename: index.php

# PostgreSQL configuration.
postgresql_global_config_options:
- option: unix_socket_directories
value: '{{ postgresql_unix_socket_directories | join(",") }}'
- option: bytea_output
value: 'escape'

# Node.js configuration (if enabled above).
# Valid examples: "0.10", "0.12", "4.x", "5.x".
nodejs_version: "0.12"
Expand Down
10 changes: 10 additions & 0 deletions provisioning/tasks/install-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
changed_when: false
become: no

# See: https://www.drupal.org/node/2569365#comment-11680807
- name: Configure database correctly if using PostgreSQL.
command: psql -c "ALTER DATABASE {{ drupal_db_name }} SET bytea_output = 'escape';"
when: "'Successful' not in drupal_site_installed.stdout"
become: yes
become_user: "{{ postgresql_user }}"
# See: https://github.com/ansible/ansible/issues/16048#issuecomment-229012509
vars:
ansible_ssh_pipelining: true

- name: Install Drupal with drush.
command: >
{{ drush_path }} site-install {{ drupal_install_profile | default('standard') }} -y
Expand Down

0 comments on commit 1a482a5

Please sign in to comment.