{"id":18663103,"url":"https://github.com/asapdotid/ansible-role-nginx","last_synced_at":"2026-05-04T12:41:33.588Z","repository":{"id":187219624,"uuid":"666331514","full_name":"asapdotid/ansible-role-nginx","owner":"asapdotid","description":"Ansible Role NGINX  (open source)","archived":false,"fork":false,"pushed_at":"2023-10-17T12:01:00.000Z","size":86,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T16:43:08.686Z","etag":null,"topics":["ansible","ansible-playbook","ansible-role","nginx","nginx-proxy","webserver"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asapdotid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-14T08:50:20.000Z","updated_at":"2023-08-14T02:35:20.000Z","dependencies_parsed_at":"2023-08-09T13:10:15.251Z","dependency_job_id":"57da4e65-ff79-49fb-9c8d-b8b2c6aefc43","html_url":"https://github.com/asapdotid/ansible-role-nginx","commit_stats":null,"previous_names":["asapdotid/ansible-role-nginx"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asapdotid%2Fansible-role-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asapdotid%2Fansible-role-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asapdotid%2Fansible-role-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asapdotid%2Fansible-role-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asapdotid","download_url":"https://codeload.github.com/asapdotid/ansible-role-nginx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239487306,"owners_count":19646984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-playbook","ansible-role","nginx","nginx-proxy","webserver"],"created_at":"2024-11-07T08:15:00.869Z","updated_at":"2025-11-06T07:30:36.643Z","avatar_url":"https://github.com/asapdotid.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e \u003cimg src=\"https://user-images.githubusercontent.com/34257858/129839002-15e3f2c7-3f75-46d4-afae-0fd207d7fdde.png\" width=\"100\" height=\"100\"\u003e\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n    Ansible Role Nginx\n\u003c/h1\u003e\n\n\u003cp align=\"center\" style=\"font-size: 1.2rem;\"\u003e\n    Ansible NGINX Role (open source)\n\u003c/p\u003e\n\n\u003e This role custom from official release [Ansible NGINX [here](https://github.com/nginxinc/ansible-role-nginx-config).]\n\nThis role installs NGINX Open Source, or the NGINX Amplify agent on your target host.\n\n## Requirements\n\n### Ansible\n\n-   This role is developed and tested with [maintained](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) versions of Ansible core (above `2.12`).\n-   When using Ansible core, you will also need to install the following collections:\n\n    ```yaml\n    ---\n    collections:\n        - name: ansible.posix\n          version: 1.5.4\n        - name: community.general\n          version: 6.4.0\n        - name: community.crypto # Only required if you plan to install NGINX Plus\n          version: 2.14.1\n        - name: community.docker # Only required if you plan to use Molecule (see below)\n          version: 3.4.7\n    ```\n\n    **Note:** You can alternatively install the Ansible community distribution (what is known as the \"old\" Ansible) if you don't want to manage individual collections.\n\n-   You will need to run this role as a root user using Ansible's `become` parameter. Make sure you have set up the appropriate permissions on your target hosts.\n-   Instructions on how to install Ansible can be found in the [Ansible website](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#upgrading-ansible-from-version-2-9-and-older-to-version-2-10-or-later).\n\n### Jinja2\n\n-   This role uses Jinja2 templates. Ansible core installs Jinja2 by default, but depending on your install and/or upgrade path, you might be running an outdated version of Jinja2. The minimum version of Jinja2 required for the role to properly function is `3.1`.\n-   Instructions on how to install Jinja2 can be found in the [Jinja2 website](https://jinja.palletsprojects.com/en/3.1.x/intro/#installation).\n\n## Installation\n\n### Ansible Galaxy\n\n### Git\n\nTo pull the latest edge commit of the role from GitHub, use:\n\n```bash\ngit clone https://github.com/nginxinc/ansible-role-nginx.git\n```\n\n## Platforms\n\nThe NGINX Ansible role supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html), [NGINX Plus](https://docs.nginx.com/nginx/technical-specs/), and the [NGINX Amplify agent](https://github.com/nginxinc/nginx-amplify-doc/blob/master/amplify-faq.md#21-what-operating-systems-are-supported):\n\n### NGINX Open Source\n\n```yaml\nAlmaLinux:\n    - 8\n    - 9\nAlpine:\n    - 3.15\n    - 3.16\n    - 3.17\n    - 3.18\nAmazon Linux:\n    - 2\nCentOS:\n    - 7.4+\nDebian:\n    - bullseye (11)\n    - bookworm (12)\nOracle Linux:\n    - 7\n    - 8\n    - 9\nRed Hat:\n    - 7.4+\n    - 8\n    - 9\nRocky Linux:\n    - 8\n    - 9\nSUSE/SLES:\n    - 12\n    - 15\nUbuntu:\n    - focal (20.04)\n    - jammy (22.04)\n    - kinetic (22.10)\n    - lunar (23.04)\n```\n\n### NGINX Amplify Agent\n\n```yaml\nAmazon Linux 2:\n    - any\nDebian:\n    - buster (10)\n    - bullseye (11)\nRed Hat:\n    - 8\nUbuntu:\n    - bionic\n    - focal\n```\n\n**Note:** You can also use this role to compile NGINX Open Source from source, install NGINX Open Source on compatible yet unsupported platforms, or install NGINX Open Source on BSD systems at your own risk.\n\n## Role Variables\n\nThis role has multiple variables. The descriptions and defaults for all these variables can be found in the **[`defaults/main/`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/)** folder in the following files:\n\n| Name                                                                                                        | Description                                         |\n| ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |\n| **[`main.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/main.yml)**           | NGINX installation variables                        |\n| **[`amplify.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/amplify.yml)**     | NGINX Amplify agent installation variables          |\n| **[`bsd.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/bsd.yml)**             | BSD installation variables                          |\n| **[`logrotate.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/logrotate.yml)** | Logrotate configuration variables                   |\n| **[`selinux.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/selinux.yml)**     | SELinux configuration variables                     |\n| **[`systemd.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/systemd.yml)**     | Systemd configuration variables                     |\n| **[`directory.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/directory.yml)** | NGINX information directory configuration variables |\n| **[`modify.yml`](https://github.com/nginxinc/ansible-role-nginx/blob/main/defaults/main/modify.yml)**       | Modify systemd configuration variables              |\n\n## Sample\n\n```yaml\n- hosts: haproxy\n  become: true\n  gather_facts: true\n\n  vars:\n      ### Nginx config\n      nginx_branch: stable\n      nginx_custom_enable: true\n      nginx_ssl_dhparam_enable: true\n      # proxy\n      nginx_proxy_sites_config:\n          jogjascript.com:\n              available: true\n              enable: false\n              protocol: https # site protocol http/https\n              hsts_max_age: 63072000\n              domains:\n                  - app.jogjascript.com\n              listen: 9000\n              access_log: false\n              error_log: false\n              upstreams:\n                  method: \"\" # default empty == `round-robin` (round-robin/least-connected/ip-hash)\n                  servers:\n                      - {\n                            backend_address: 192.168.0.100,\n                            backend_port: 80,\n                            backend_args: \"weight=3\",\n                        }\n                      - {\n                            backend_address: 192.168.0.101,\n                            backend_port: 8080,\n                            backend_args: \"\",\n                        }\n                  options:\n                      - check interval=5000 rise=1 fall=3 timeout=4000\n              client_max_body_size: \"256M\"\n              proxy_read_timeout: \"360\"\n              connection_upgrade: true\n              # auth:\n              #   username: myusername\n              #   password: mysecretpassword\n\n  roles:\n      - asapdotid.nginx\n```\n\n## License\n\nApache License, Version 2.0\n\n## Author Information\n\nThis Ansible role was created in 2023 by [Asapdotid](https://github.com/asapdotid).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasapdotid%2Fansible-role-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasapdotid%2Fansible-role-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasapdotid%2Fansible-role-nginx/lists"}