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
Vagrant.configure("2") do |config| | |
servers=[ | |
{ | |
:hostname => "database", | |
:box => "centos/7", | |
:ip => "192.168.56.101", | |
:ssh_port => '2210' | |
}, | |
{ | |
:hostname => "webserver-1", |
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
[database] | |
192.168.56.101 | |
[webservers] | |
192.168.56.102 | |
192.168.56.103 | |
[loadbalancer] | |
192.168.56.104 |
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
--- | |
- hosts: database | |
become: true | |
tasks: | |
- name: install tools | |
apt: name={{item}} state=present | |
with_items: | |
- python-mysqldb | |
tags: [ 'packages' ] |
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
- name: Create a new database with name 'laravel' | |
mysql_db: | |
name: laravel | |
state: present | |
- name: create laravel user | |
mysql_user: | |
name: laravel | |
password: laravel | |
priv: '*.*:ALL' |
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
- hosts: webservers | |
become: true | |
tasks: | |
- name: install packages for laravel | |
apt: name={{ item }} update_cache=yes state=latest | |
with_items: | |
- php7.2 | |
- libapache2-mod-php7.2 | |
- php7.2-mbstring |
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
- name: download composer and install on path | |
shell: curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer | |
args: | |
warn: no | |
- name: clone the app | |
git: | |
repo: https://github.com/gothinkster/laravel-realworld-example-app.git | |
dest: /var/www/html/ | |
clone: yes | |
update: yes |
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
APP_NAME=Laravel | |
APP_ENV=production | |
APP_KEY= | |
APP_DEBUG=false | |
APP_LOG_LEVEL=debug | |
APP_URL=http://localhost | |
DB_CONNECTION=mysql | |
DB_HOST=192.168.56.101 | |
DB_PORT=3306 |
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
- name: config on env | |
copy: | |
src: .env | |
dest: /var/www/html/ | |
owner: root | |
group: root | |
mode: 0755 | |
- name: resolving permission issues on laravel directory | |
file: |
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
<VirtualHost *:80> | |
ServerAdmin admin@example.com | |
DocumentRoot /var/www/html/MyProject/public | |
ServerName www.example-schirbel.com | |
<Directory /var/www/html/MyProject/public> | |
Options +FollowSymlinks | |
AllowOverride All | |
Require all granted | |
</Directory> |
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
- name: create a virtualhost on apache | |
file: | |
src: laravel.conf | |
path: /etc/apache2/sites-available/ | |
owner: root | |
group: root | |
mode: 0755 | |
- name: a2ensite laravel | |
command: a2ensite laravel |
OlderNewer