nginx_certbot

Ansible Role: Nginx Certbot

This Ansible role automates the setup of Nginx web servers using Certbot to deploy HTTPS encryption using Let's Encrypt certificates.

Requirements

  • Ansible installed on the control node.
  • Domain name(s) pointed to the server(s) where Nginx is running.

Role Variables

Below are the variables used in this role, along with their descriptions:

  • nginx_certbot_domain_name: The domain name for which the SSL certificate will be obtained.
  • nginx_certbot_certbot_email: Email address to use for Let's Encrypt certificate registration.
  • nginx_certbot_deny_http: Whether to deny HTTP access after enabling HTTPS. Default is false.
  • nginx_certbot_proxy_protocol: Whether to enable support for the nginx PROXY protocol. Default is false.
  • nginx_certbot_app: Configuration for the application served by Nginx:
    • name: Name of the application.
    • url: URL where the application is hosted.
    • http_template_name: Name of the Nginx HTTP template. Some examples are available in templates dir
    • upstream_template_name: Name of the Nginx upstream template. Some examples are available in templates dir

These variables can be customized in your playbook to match your specific environment and configuration requirements.

Dependencies

None.

Example Playbook

- hosts: web_servers
  roles:
    - role: chadek.nginx_certbot
      vars:
        nginx_certbot_domain_name: app.example.com
        nginx_certbot_certbot_email: [email protected]
        nginx_certbot_deny_http: false
        nginx_certbot_proxy_protocol: false
        nginx_certbot_app:
          name: app
          url: "http://localhost:2000"
          http_template_name: root
          upstream_template_name: root_upstream

License

This role is licensed under the MIT License.

Author Information

This role was created by Chadek.

Feedback and Contributions

Please feel free to open an issue or submit a pull request on GitHub if you have any feedback or would like to contribute.

About

ansible role to install and setup nginx with https server templates using certbot for linux

Install
ansible-galaxy install chadek/ansible-role-nginx-certbot
GitHub repository
License
gpl-3.0
Downloads
188
Owner