juwai.laravel
Ansible Role: Laravel
This role sets up the necessary folders and files to run a Laravel project.
Requirements
Works with Ansible version 1.9 or later.
Role Variables
Here are the variables you can use with their default values (check defaults/main.yml
for details):
laravel_deploy_user
The user that owns the application code files.
Default: the value of ansible_user
.
laravel_deploy_group
The group that owns the application code files.
Default: the value of ansible_user
.
laravel_www_dir
The main directory for applications.
Default: /var/www
.
laravel_application_name
The name of the application used for folder names.
laravel_stage
The stage name used for folders.
Default: vagrant
.
laravel_env
The environment (options: vagrant
, staging
, or production
).
laravel_dot_env
An array of key-value pairs for application configuration.
laravel_server_name
The server name for Nginx.
Default: localhost
.
laravel_nginx_extra_config
Additional configuration block for Nginx.
Default: ''
(empty).
laravel_nginx_port
The port for Nginx.
Default: 80.
laravel_nginx_real_ip
Use the Nginx real IP module and include HTTP_X_REAL_IP in fastcgi_param.
Default: false.
laravel_generate_nginx_config
Whether to generate the Nginx configuration file.
Default: true.
laravel_rotate_nginx_log
Enable log rotation for Nginx log files.
Default: true.
laravel_rotate_nginx_log_retention
How long to keep log files before rotation.
Default: 30 days.
laravel_access_control_allow_credentials
Allow credentials for CORS (Cross-Origin Resource Sharing).
laravel_access_control_allow_origin
Enable CORS and specify allowed origins.
laravel_access_control_allow_methods
Methods allowed by CORS.
laravel_access_control_allow_headers
Custom headers allowed by CORS.
laravel_access_control_max_age
Time for which pre-flight requests are valid.
laravel_https_enabled
Enable HTTPS.
Default: false
.
laravel_https_cert_path
Path to the SSL certificate.
laravel_https_key_path
Path to the private key for the SSL certificate.
laravel_https_cert_data
Data for the SSL certificate.
laravel_https_chain_data
Intermediate certificate data.
laravel_https_privatekey_data
Private key data for the SSL certificate.
laravel_https_redirect
Redirect traffic from HTTP to HTTPS.
Default: false
.
laravel_https_redirect_by_x_forwarded_proto
Redirect from HTTP to HTTPS if http_x_forwarded_proto
is HTTP.
Default: false
.
Dependencies
- juwai.common
- juwai.nginx
- retr0h.logrotate
Example Playbook
- hosts: servers
roles:
- juwai.laravel
License
MIT License.
Author Information
This role was created in 2016 by Juwai Limited.