vbotka.nginx

nginx

qualityBuild Status

Ansible role. Install and configure Nginx.

Feel free to share your feedback and report issues.

Contributions are welcome.

Requirements

Roles

Collections

  • community.general

Variables

Review defaults and examples in vars.

Workflow

  1. 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'
  1. Install the role and collections
shell> ansible-galaxy role install vbotka.nginx
shell> ansible-galaxy collection install community.general
  1. 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
  1. 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
  1. Install and configure Nginx
shell> ansible-playbook nginx.yml
  1. Test the webserver

References

License

license

Author Information

Vladimir Botka

About

Install and configure Nginx.

Install
ansible-galaxy install vbotka.nginx
GitHub repository
License
bsd-2-clause
Downloads
74