Ansible playbook for initial ubuntu 16.04 webserver setup and Laravel zero time deployment
Ansible playbook to setup web server and playbook to deploy laravel project with zero time.
/path/to/domain
current
-> /link/to/latest/release
persistent
storage
releases
2017-08-10-10-00-00
2017-08-11-10-00-00
2017-08-12-10-00-00
/path/to/release/storage
to /path/to/domain/persistent/storage
/path/to/release/.env
to /path/to/domain/persistent/.env
/path/to/domain/current
to /path/to/domain/releases/new-release
If build fails
/path/to/domain/current
to /path/to/domain/releases/last-success-release
Create inventory
file in project root. You should specify ip address of your
server in this file.
[web]
46.101.210.137
ansible-galaxy install -r requirements.yml
Copy vars/main.yml.example
to vars/main.yml
and change variable values for
your needs. For security reasons you may want to encrypt this file using
ansible-vault:
ansible-vault encrypt vars/main.yml
And then edit this file with
ansible-vault edit vars/main.yml
To see all available variables take a look at roles/*/defaults/main.yml
. Also
visit external roles github page for additional documentation.
To generate password for your user use
sudo apt-get install -y whois
mkpasswd --method=SHA-512
roles/nginx/templates/yoursite.j2
roles/php/templates/yoursite.conf.j2
By default on ubuntu 16.04 there is no python 2 and aptitude. Without those programs ansible cannot work. To fix it run:
ansible-playbook initial-setup.yml
Beside it this playbook also creates user and configures ssh server.
This playbook setup nginx, php-fpm, mysql, nodejs, etc.
ansible-playbook setup.yml
ansible-playbook setup.yml --tags=user,nginx
ansible-playbook setup.yml --skip-tags=user,nginx
ansible-playbook deploy.yml
If you discover any security related issues, please email [email protected] instead of using the issue tracker.