Last active
July 9, 2017 17:14
-
-
Save aeosys/9ea58d042b13ae12e07a1c993d1832b4 to your computer and use it in GitHub Desktop.
PHP7 dev server for Symfony
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
--- | |
- hosts: all | |
become: true | |
tasks: | |
- apt_repository: repo={{ item }} state=present | |
with_items: | |
- deb http://packages.dotdeb.org jessie all | |
- deb-src http://packages.dotdeb.org jessie all | |
- apt_key: | |
url: https://www.dotdeb.org/dotdeb.gpg | |
state: present | |
- name: Ensure apt has updated cache | |
apt: update_cache=yes | |
- name: Install packages | |
apt: name={{ item }} state=latest | |
with_items: | |
- git | |
- apache2 | |
- mariadb-server | |
- python-mysqldb | |
# Apache | |
- name: Enabled mod_rewrite | |
apache2_module: name=rewrite state=present | |
notify: | |
- restart apache2 | |
- name: Move Apache configuration to quest | |
copy: src=symfony.apache.conf dest=/etc/apache2/sites-available/symfony.conf | |
- name: Apply Apache configuration | |
command: a2ensite symfony | |
args: | |
creates: /etc/apache2/sites-enabled/symfony.conf | |
notify: | |
- restart apache2 | |
- name: Disable default Apache configuration | |
command: a2dissite 000-default | |
args: | |
removes: /etc/apache2/sites-enabled/000-default.conf | |
notify: | |
- restart apache2 | |
- name: Create db for symfony | |
mysql_db: name=symfony state=present | |
- name: Link www to home folder | |
file: src=/home/vagrant/site path=/var/www/symfony state=link force=yes | |
# PHP | |
- name: Install PHP7 | |
apt: name={{ item }} state=latest | |
with_items: | |
- php7.0 | |
- php7.0-apcu | |
- php7.0-bz2 | |
- php7.0-curl | |
- php7.0-cli | |
- php7.0-dba | |
- php7.0-dbg | |
- php7.0-imap | |
- php7.0-intl | |
- php7.0-json | |
- php7.0-mbstring | |
- php7.0-mcrypt | |
- php7.0-memcached | |
- php7.0-mysql | |
- php7.0-odbc | |
- php7.0-soap | |
- php7.0-ssh2 | |
- php7.0-xdebug | |
- php7.0-xml | |
- php7.0-zip | |
handlers: | |
- name: restart apache2 | |
service: name=apache2 state=restarted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment