vbotka.nginx
nginx
Ansible role. Install and configure Nginx.
Feel free to share your feedback and report issues.
Requirements
Roles
Collections
- community.general
Variables
Review defaults and examples in vars.
Workflow
- Change shell to /bin/sh
shell> ansible webserver -e 'ansible_shell_type=csh ansible_shell_executable=/bin/csh' -a 'sudo pw usermod freebsd -s /bin/sh'
- Install the role and collections
shell> ansible-galaxy role install vbotka.nginx
shell> ansible-galaxy collection install community.general
- Change variables
Review defaults
Review OS specific variables in vars/defaults
Optionaly create custom OS specific variables in vars/. See tasks/vars.yml
Customize other variables in vars/main.yml
Create host's specific data in nginx_server_conf_dir
- default: "{{ role_path }}/files/servers"
- See tasks/conf.yml, templates/server.conf.j2 and
- Filter encode_nginx
- Create playbook and inventory
shell> cat nginx.yml
- hosts: webserver
roles:
- vbotka.nginx
shell> cat hosts
[webserver]
<webserver-ip-or-fqdn>
[webserver:vars]
ansible_connection=ssh
ansible_user=freebsd
ansible_become=yes
ansible_become_method=sudo
ansible_python_interpreter=/usr/local/bin/python3.6
ansible_perl_interpreter=/usr/local/bin/perl
- Install and configure Nginx
shell> ansible-playbook nginx.yml
Test the webserver
References
- nginx.org Documentation
- nginx.com Wiki
- nginx.com Linode Tutorial
- nginx.com Documentation
- nginx.com Documentation - Full Example Configuration
- digitalocean.com How to Install Nginx on FreeBSD 11.2
- digitalocean.com How To Secure Nginx with Let's Encrypt on FreeBSD
- Config Encoder Filters
- FreeBSD Nginx performance
License
Author Information
Install
ansible-galaxy install vbotka.nginxLicense
bsd-2-clause
Downloads
74
Owner
