klips/ansible/roles/nginx
Shaun Reed eade1bfd94 Add README for ansible/roles/nginx 2021-05-21 13:22:01 -04:00
..
defaults Update core, docker, nginx roles 2020-04-15 23:03:42 +00:00
files Add README for ansible/roles/nginx 2021-05-21 13:22:01 -04:00
handlers Ansible nginx role using ansible-galaxy 2019-08-18 03:18:41 +00:00
meta Ansible nginx role using ansible-galaxy 2019-08-18 03:18:41 +00:00
tasks Update to more recent Ansible roles 2020-11-25 11:38:20 +00:00
vars Ansible nginx role using ansible-galaxy 2019-08-18 03:18:41 +00:00
README.md Add README for ansible/roles/nginx 2021-05-21 13:22:01 -04:00

README.md

NGINX

A role to install nginx and start a default webserver on a remote host.

Requirements

None

Role Variables

packages: [nginx]

  • A list of packages to install. Feel free to add more here if needed, separated by commas - package: [nginx, apache2]

domain_name: "localhost"

  • The domain name to use within nginx.conf configurations. If you do not own a domain name, use localhost or your public IP here.

nginx_root_dir: "/var/www/html/"

  • Used in `nginx.conf to define the root directory of content to be served on the nginx webserver.

index_files: "index.html index.htm"

  • Used in nginx.conf to define index files

Dependencies

A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.

Example Playbook

First, make sure all settings within defaults/main.yml are correct for your server. All settings and their purposes are outline in the section above.

Create a new ansible play. You can name it whatever you want, but this example play will simply be named nginx.yml.

---
- hosts: testserver
  become: yes
  roles:
  - nginx

Make sure the IP for testserver is correct in the /etc/ansible/hosts file -

[testserver]
123.123.123.123:22

Run the play!

ansible-playbook nginx.yml

License

BSD

Author Information

Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0

TODO: Add optional task for configuring SSL