Skip to content

Commit 81c47c6

Browse files
committed
Update Drupal playbook example to use modern PHP 7.0, MySQL 5.7, etc.
1 parent 13b49e1 commit 81c47c6

File tree

4 files changed

+41
-28
lines changed

4 files changed

+41
-28
lines changed

drupal/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
**For a fully-featured VM environment for Drupal, please check out [Drupal VM](http://www.drupalvm.com/).**
44

5-
This project makes local Drupal test/development environment management quick and easy. It installs the following on an Ubuntu 12.04 linux VM:
5+
This project makes local Drupal test/development environment management quick and easy. It installs the following on an Ubuntu 16.04 linux VM:
66

7-
- Apache 2.2.x
8-
- PHP 5.4.x
9-
- MySQL 5.5.x
10-
- Drush 7.x (latest dev release)
11-
- Drupal 6.x, 7.x, or 8.0.x (configurable)
7+
- Apache 2.4.x
8+
- PHP 7.0.x
9+
- MySQL 5.7.x
10+
- Drush 8.x
11+
- Drupal 8.1.x
1212

1313
It takes 5-10 minutes to build or rebuild the VM from scratch on a decent broadband connection.
1414

@@ -45,4 +45,4 @@ Note: *If there are any errors during the course of running `vagrant up`, and it
4545

4646
## About the Author
4747

48-
This project was created by [Jeff Geerling](http://jeffgeerling.com/) as an example for [Ansible for DevOps](http://www.ansiblefordevops.com/).
48+
This project was created by [Jeff Geerling](http://www.jeffgeerling.com/) as an example for [Ansible for DevOps](http://www.ansiblefordevops.com/).

drupal/Vagrantfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
VAGRANTFILE_API_VERSION = "2"
55

66
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
7-
config.vm.box = "geerlingguy/ubuntu1404"
7+
config.vm.box = "geerlingguy/ubuntu1604"
88
config.vm.network :private_network, ip: "192.168.88.8"
9+
config.vm.hostname = "drupaltest.dev"
910
config.ssh.insert_key = false
1011

1112
config.vm.provider :virtualbox do |v|
12-
v.memory = 512
13+
v.memory = 1024
1314
end
1415

1516
# Ansible provisioning.

drupal/provisioning/playbook.yml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,20 @@
2929
- curl
3030
- sendmail
3131
- apache2
32-
- php5
33-
- php5-common
34-
- php5-mysql
35-
- php5-cli
36-
- php5-curl
37-
- php5-gd
38-
- php5-dev
39-
- php5-mcrypt
40-
- php5-apcu
41-
- php-pear
32+
- php7.0-common
33+
- php7.0-cli
34+
- php7.0-dev
35+
- php7.0-gd
36+
- php7.0-curl
37+
- php7.0-json
38+
- php7.0-opcache
39+
- php7.0-xml
40+
- php7.0-mbstring
41+
- php7.0-pdo
42+
- php7.0-mysql
43+
- php-apcu
44+
- libpcre3-dev
45+
- libapache2-mod-php7.0
4246
- python-mysqldb
4347
- mysql-server
4448

@@ -55,7 +59,7 @@
5559
apache2_module: name=rewrite state=present
5660
notify: restart apache
5761

58-
- name: Add Apache virtualhost for Drupal 8 development.
62+
- name: Add Apache virtualhost for Drupal 8.
5963
template:
6064
src: "templates/drupal.dev.conf.j2"
6165
dest: "/etc/apache2/sites-available/{{ domain }}.dev.conf"
@@ -73,24 +77,32 @@
7377

7478
- name: Remove default virtualhost file.
7579
file:
76-
path: "/etc/apache2/sites-enabled/000-default"
80+
path: "/etc/apache2/sites-enabled/000-default.conf"
7781
state: absent
7882
notify: restart apache
7983

80-
- name: Enable upload progress via APC.
84+
- name: Adjust OpCache memory setting.
8185
lineinfile:
82-
dest: "/etc/php5/apache2/conf.d/20-apcu.ini"
83-
regexp: "^apc.rfc1867"
84-
line: "apc.rfc1867 = 1"
86+
dest: "/etc/php/7.0/apache2/conf.d/10-opcache.ini"
87+
regexp: "^opcache.memory_consumption"
88+
line: "opcache.memory_consumption = 96"
8589
state: present
8690
notify: restart apache
8791

8892
- name: Remove the MySQL test database.
8993
mysql_db: db=test state=absent
9094

91-
- name: Create a database for Drupal.
95+
- name: Create a MySQL database for Drupal.
9296
mysql_db: "db={{ domain }} state=present"
9397

98+
- name: Create a MySQL user for Drupal.
99+
mysql_user:
100+
name: "{{ domain }}"
101+
password: "1234"
102+
priv: "{{ domain }}.*:ALL"
103+
host: localhost
104+
state: present
105+
94106
- name: Download Composer installer.
95107
get_url:
96108
url: https://getcomposer.org/installer
@@ -142,7 +154,7 @@
142154
drush si -y --site-name="{{ drupal_site_name }}"
143155
--account-name=admin
144156
--account-pass=admin
145-
--db-url=mysql://root@localhost/{{ domain }}
157+
--db-url=mysql://{{ domain }}:1234@localhost/{{ domain }}
146158
chdir={{ drupal_core_path }}
147159
creates={{ drupal_core_path }}/sites/default/settings.php
148160
notify: restart apache

drupal/provisioning/vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ drupal_core_path: "/var/www/drupal-{{ drupal_core_version }}-dev"
99
domain: "drupaltest"
1010

1111
# Your Drupal site name.
12-
drupal_site_name: "D8 Test"
12+
drupal_site_name: "Drupal Test"

0 commit comments

Comments
 (0)