practical-ansible.nginx_project
Nginx Project for Ansible
This is a basic setup for all the Nginx roles from Practical Ansible. It handles initial tasks, such as creating a working directory for your project and getting an SSL certificate. You can also try other roles that use this one:
Features
- Sets up a workspace for your project on your server
- Gets an SSL certificate from Let's Encrypt
- Configures Nginx to show a simple static HTML page
- Designed to be expandable - it does not overwrite existing Nginx configuration
Prerequisites
- User with permission to configure Nginx
Installation
ansible-galaxy install practical-ansible.nginx_project
Reference Manual
Basic library for other Practical Ansible projects
Table of Contents
Default Variables
admin_email
Email address of the project manager. Used by Let's Encrypt for account verification.
Default Value
admin_email: ''
group
Unix group name that runs the project on the target machine.
Default Value
group: www-data
present
Determines if the project is deployed or not. Options: 'present', 'disabled', 'absent'
Example Usage
state: disabled
project_environment
Name of the project's environment (e.g., production or staging). This allows hosting multiple application instances on one machine, using descriptive names.
Default Value
project_environment: production
project_name
Name of the project for file system reference. The role will try to read this from package manager info, like npm.
Default Value
project_name: ''
Example Usage
project_name: 'my-app'
project_version
Version of the project being deployed.
Default Value
project_version: ''
Example Usage
project_version: '1.1.0'
project_version: '2'
projects_directory
Directory for storing projects on the target machine.
Default Value
projects_directory: /var/lib/practical-ansible
server_names
List of hostnames for the application that will be proxied.
Default Value
server_names: ''
Example Usage
server_names: 'mysite.example.com,mysite.example.cz'
ssl_sign_by
Authority that issues the SSL certificate for the application. Options: 'letsencrypt', 'self'
Default Value
ssl_sign_by: letsencrypt
state
Default Value
state: present
use_ssl
Configures Nginx to use SSL when forwarding requests to the Docker setup.
Default Value
use_ssl: true
Example Usage
use_ssl: false
user
Username for the project on the target machine.
Default Value
user: www-data
Dependencies
None.
License
MIT
Author
Pavel Žák
ansible-galaxy install practical-ansible.nginx_project