{"id":13753608,"url":"https://github.com/nginxinc/ansible-role-nginx","last_synced_at":"2025-03-23T09:04:33.276Z","repository":{"id":37550202,"uuid":"117019566","full_name":"nginxinc/ansible-role-nginx","owner":"nginxinc","description":"Ansible role for installing NGINX","archived":false,"fork":false,"pushed_at":"2025-03-14T13:56:47.000Z","size":1378,"stargazers_count":670,"open_issues_count":12,"forks_count":355,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-03-16T08:03:22.252Z","etag":null,"topics":["ansible","ansible-code-bot-scan","ansible-role","nginx","nginx-plus"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/nginxinc/nginx","language":"Shell","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/nginxinc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-10T22:37:00.000Z","updated_at":"2025-03-15T00:50:02.000Z","dependencies_parsed_at":"2023-09-23T10:36:36.339Z","dependency_job_id":"66edd197-868e-4033-9cda-123edab300fc","html_url":"https://github.com/nginxinc/ansible-role-nginx","commit_stats":{"total_commits":701,"total_committers":60,"mean_commits":"11.683333333333334","dds":0.4764621968616263,"last_synced_commit":"eb60ddf302d0e614558ed0145060e47779d6310b"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nginxinc%2Fansible-role-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nginxinc%2Fansible-role-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nginxinc%2Fansible-role-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nginxinc%2Fansible-role-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nginxinc","download_url":"https://codeload.github.com/nginxinc/ansible-role-nginx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245075982,"owners_count":20557015,"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-code-bot-scan","ansible-role","nginx","nginx-plus"],"created_at":"2024-08-03T09:01:25.622Z","updated_at":"2025-03-23T09:04:33.255Z","avatar_url":"https://github.com/nginxinc.png","language":"Shell","funding_links":[],"categories":["nginx","Shell"],"sub_categories":[],"readme":"[![Ansible Galaxy](https://img.shields.io/badge/galaxy-nginxinc.nginx-5bbdbf.svg)](https://galaxy.ansible.com/nginxinc/nginx)\n[![Molecule CI/CD](https://github.com/nginxinc/ansible-role-nginx/workflows/Molecule%20CI/CD/badge.svg)](https://github.com/nginxinc/ansible-role-nginx/actions/workflows/molecule.yml)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/nginxinc/ansible-role-nginx/badge)](https://securityscorecards.dev/viewer/?uri=github.com/nginxinc/ansible-role-nginx)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![Community Support](https://badgen.net/badge/support/community/cyan?icon=awesome)](/SUPPORT.md)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](/CODE_OF_CONDUCT.md)\n[![License](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n# 👾 *Help make the NGINX Ansible role better by participating in our [survey](https://forms.office.com/Pages/ResponsePage.aspx?id=L_093Ttq0UCb4L-DJ9gcUKLQ7uTJaE1PitM_37KR881UM0NCWkY5UlE5MUYyWU1aTUcxV0NRUllJSC4u)!* 👾\n\n# Ansible NGINX Role\n\nThis role installs NGINX (NGINX Open Source), NGINX Plus, NGINX Agent and/or the NGINX Amplify agent on your target host(s).\n\n\u003e [!IMPORTANT]\n\u003e This role is still in active development. There may be unidentified issues and the role variables may change as development continues.\n\n## Role Requirements\n\n### NGINX\n\nDepending on your target NGINX use case, you might need to obtain a license or API key/token before being able to use the role:\n\n| Product | Requirements |\n|---------|--------------|\n| NGINX | None |\n| NGINX Plus | NGINX Plus license (both a license key and crt files) |\n| NGINX Agent | A compatible control plane and (optionally) an NGINX One SaaS console data plane token |\n| NGINX Amplify | API key found within the NGINX Amplify SaaS console |\n\n### Ansible\n\nIf you want to use this role, you will need to use a supported version of Ansible core and Jinja2 as well as a few Ansible collections.\n\nFor ease of use, you can install and/or upgrade Ansible core, Jinja2, and the aforementioned Ansible collections by running the following four commands on your Ansible host:\n\n```bash\npip install --upgrade -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx/main/.github/workflows/requirements/requirements_ansible.txt\ncurl -O https://raw.githubusercontent.com/nginxinc/ansible-role-nginx/main/.github/workflows/requirements/requirements_collections.yml\nansible-galaxy install --force -r requirements_collections.yml\nrm -f requirements_collections.yml\n```\n\nThis will also ensure you are deploying/running this role with a fully tested version of the aforementioned packages/collections.\n\n#### Ansible core\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 and Python.\n\n  ***Note:** Ansible `2.18` does no longer support the `yum` module and as such, is not supported by this role until Amazon Linux 2 reaches EoL.*\n- Instructions on how to install Ansible core can be found in the [Ansible](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) docs.\n- When using Ansible core, you will also need to install the following Ansible collections:\n\n  ```yaml\n  ---\n  collections:\n    - name: ansible.posix\n      version: 2.0.0\n    - name: community.general\n      version: 10.4.0\n    - name: community.crypto # Only required if you plan to install NGINX Plus\n      version: 2.26.0\n    - name: community.docker # Only required if you plan to use Molecule (see below)\n      version: 4.5.1\n  ```\n\n- Instructions on how to install Ansible collections can be found in the [Ansible collections](https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html) guide.\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\n\u003e [!TIP]\n\u003e You can alternatively install the [Ansible community distribution](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#selecting-an-ansible-package-and-version-to-install) (what is still known Ansible -- instead of Ansible core) if you don't want to manage individual collections.\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### Testing suite (Optional)\n\nIf you want to contribute to this role, you will also need to install Ansible Lint and Molecule.\n\n#### Ansible Lint (Optional)\n\n- Ansible Lint is used to lint the role for both Ansible best practices and potential Ansible/YAML issues.\n- Instructions on how to install Ansible Lint can be found in the [Ansible Lint website](https://ansible.readthedocs.io/projects/lint/installing/).\n- Once installed, using Ansible Lint is as easy as running:\n\n  ```bash\n  ansible-lint\n  ```\n\n- For ease of use, you can install and/or upgrade Ansible Lint by running the following command on your Ansible host:\n\n  ```bash\n  pip install -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx/main/.github/workflows/requirements/requirements_ansible_lint.txt\n  ```\n\n#### Molecule (Optional)\n\n- Molecule is used to test the various functionalities of the role.\n- Instructions on how to install Molecule can be found in the [Molecule website](https://molecule.readthedocs.io/en/latest/installation.html). *You will also need to install the Molecule plugins package and the Docker Python SDK.*\n- To run any of the NGINX Plus Molecule tests, you must first copy your NGINX Plus license to the role's [`files/license`](/files/license/) directory.\n\n  You can alternatively add your NGINX Plus repository certificate and key to the local environment. Run the following commands to export these files as base64-encoded variables and execute the Molecule tests:\n\n  ```bash\n  export NGINX_CRT=$( cat \u003cpath to your certificate file\u003e | base64 )\n  export NGINX_KEY=$( cat \u003cpath to your key file\u003e | base64 )\n  molecule test -s plus\n  ```\n\n- For ease of use, you can install and/or upgrade Molecule, the Molecule plugins package, and the Docker Python SDK by running the following command on your Ansible host:\n\n  ```bash\n  pip install --upgrade -r https://raw.githubusercontent.com/nginxinc/ansible-role-nginx/main/.github/workflows/requirements/requirements_molecule.txt\n  ```\n\n## Role Installation\n\nThis role can be installed via either Ansible Galaxy (the Ansible community marketplace) or by cloning this repo. Once installed, you will need to include the role in your Ansible playbook using [the `roles` keyword, the `import_role` module, or the `include_role` module](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#using-roles).\n\n### Ansible Galaxy\n\nTo install the latest stable release of the role on your system, use:\n\n```bash\nansible-galaxy install nginxinc.nginx\n```\n\nAlternatively, if you have already installed the role, you can update the role to the latest release by using:\n\n```bash\nansible-galaxy install -f nginxinc.nginx\n```\n\nTo use the role, include the following task in your playbook:\n\n```yaml\n- name: Install NGINX\n  ansible.builtin.include_role:\n    name: nginxinc.nginx\n```\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\nTo use the role, include the following task in your playbook:\n\n```yaml\n- name: Install NGINX\n  ansible.builtin.include_role:\n    name: \u003cpath/to/repo\u003e # e.g. \u003croles/ansible-role-nginx\u003e if you clone the repo inside your project's roles directory\n```\n\n## Platforms\n\nThe NGINX Ansible role aims to work on all platforms supported by the latest mainline/stable release of [NGINX Open Source](https://nginx.org/en/linux_packages.html), [NGINX Plus](https://docs.nginx.com/nginx/technical-specs/), [NGINX Agent](https://docs.nginx.com/nginx-agent/technical-specifications/), and the [NGINX Amplify agent](https://github.com/nginxinc/nginx-amplify-doc/blob/master/amplify-faq.md#21-what-operating-systems-are-supported).\n\nOlder releases might work, but keep in mind that NGINX Open Source only actively develops against the [latest release of the mainline and stable branches](https://www.f5.com/company/blog/nginx/nginx-1-18-1-19-released), and NGINX Plus only [officially supports releases for two years](https://docs.nginx.com/nginx/releases/#support-for-current-and-previous-releases).\n\n\u003e [!NOTE]\n\u003e Due to the release pipeline of the various projects supported by this role, there is usually a short delay between new releases and support for the release in this role.\n\n### NGINX Open Source\n\n```yaml\nAlmaLinux:\n  - 8\n  - 9\nAlpine:\n  - 3.18\n  - 3.19\n  - 3.20\nAmazon Linux:\n  - 2\n  - 2023\nDebian:\n  - bullseye (11)\n  - bookworm (12)\nOracle Linux:\n  - 8\n  - 9\nRed Hat:\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  - noble (24.04)\n  - oracular (24.10)\n```\n\n### NGINX Plus\n\n```yaml\nAlmaLinux:\n  - 8\n  - 9\nAlpine:\n  - 3.17\n  - 3.18\n  - 3.19\n  - 3.20\nAmazon Linux:\n  - 2\n  - 2023\nDebian:\n  - bullseye (11)\n  - bookworm (12)\nFreeBSD:\n  - 13\n  - 14\nOracle Linux:\n  - 8.1+\n  - 9\nRed Hat:\n  - 8.1+\n  - 9\nRocky Linux:\n  - 8\n  - 9\nSUSE/SLES:\n  - 12\n  - 15\nUbuntu:\n  - focal (20.04)\n  - jammy (22.04)\n  - noble (24.04)\n```\n\n### NGINX Agent\n\n```yaml\nAlmaLinux:\n  - 8\n  - 9\nAlpine:\n  - 3.17\n  - 3.18\n  - 3.19\n  - 3.20\nAmazon Linux:\n  - 2\n  - 2023\nDebian:\n  - bullseye (11)\n  - bookwork (12)\nFreeBSD:\n  - 13\n  - 14\nOracle Linux:\n  - 8\n  - 9\nRed Hat:\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  - noble (24.04)\n```\n\n### NGINX Amplify Agent\n\n```yaml\nAmazon Linux:\n  - 2\nDebian:\n  - buster (10)\n  - bullseye (11)\nRed Hat:\n  - 8\n  - 9\nUbuntu:\n  - bionic (18.04)\n  - focal (20.04)\n  - jammy (22.04)\n```\n\n\u003e [!WARNING]\n\u003e At your own risk, you can also use this role to compile NGINX Open Source from source, install NGINX Open Source on \"compatible\" yet unsupported platforms, install NGINX from your respective distribution package manager, or install NGINX Open Source on BSD systems.\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/`](/defaults/main/)** directory in the following files:\n\n| Name | Description |\n| ---- | ----------- |\n| **[`main.yml`](/defaults/main/main.yml)** | NGINX installation variables |\n| **[`agent.yml`](/defaults/main/agent.yml)** | NGINX Agent installation variables |\n| **[`amplify.yml`](/defaults/main/amplify.yml)** | NGINX Amplify agent installation variables |\n| **[`bsd.yml`](/defaults/main/bsd.yml)** | BSD installation variables |\n| **[`logrotate.yml`](/defaults/main/logrotate.yml)** | Logrotate configuration variables |\n| **[`selinux.yml`](/defaults/main/selinux.yml)** | SELinux configuration variables |\n| **[`systemd.yml`](/defaults/main/systemd.yml)** | Systemd configuration variables |\n\nSimilarly, descriptions and defaults for preset variables can be found in the **[`vars/`](/vars/)** directory in the following files:\n\n| Name | Description |\n| ---- | ----------- |\n| **[`main.yml`](/vars/main.yml)** | List of supported NGINX platforms, modules, and Linux installation variables |\n\n## Example Playbooks\n\nWorking functional playbook examples can be found in the **[`molecule/`](/molecule/)** folder in the following files:\n\n| Name | Description |\n| ---- | ----------- |\n| **[`agent/converge.yml`](/molecule/agent/converge.yml)** | Install and configure NGINX Agent to connect to the NGINX One SaaS control plane on F5 Distributed Cloud |\n| **[`amplify/converge.yml`](/molecule/amplify/converge.yml)** | Install and configure the NGINX Amplify agent |\n| **[`default/converge.yml`](/molecule/default/converge.yml)** | Install a specific version of NGINX, install various NGINX supported modules, tweak systemd and set up logrotate |\n| **[`distribution/converge.yml`](/molecule/distribution/converge.yml)** | Install NGINX from the distribution's package repository instead of NGINX's package repository |\n| **[`downgrade/converge.yml`](/molecule/downgrade/converge.yml)** | Downgrade to a specific version of NGINX |\n| **[`downgrade-plus/converge.yml`](/molecule/downgrade-plus/converge.yml)** | Downgrade to a specific version of NGINX Plus |\n| **[`plus/converge.yml`](/molecule/plus/converge.yml)** | Install NGINX Plus and various NGINX Plus supported modules |\n| **[`source/converge.yml`](/molecule/source/converge.yml)** | Install NGINX from source |\n| **[`stable/converge.yml`](/molecule/stable/converge.yml)** | Install NGINX using the latest stable release |\n| **[`uninstall/converge.yml`](/molecule/uninstall/converge.yml)** | Uninstall NGINX |\n| **[`uninstall-plus/converge.yml`](/molecule/uninstall-plus/converge.yml)** | Uninstall NGINX Plus |\n| **[`upgrade/converge.yml`](/molecule/upgrade/converge.yml)** | Upgrade NGINX |\n| **[`upgrade-plus/converge.yml`](/molecule/upgrade-plus/converge.yml)** | Upgrade NGINX Plus |\n| **[`version/converge.yml`](/molecule/version/converge.yml)** | Install a specific version of NGINX and various NGINX modules |\n\n\u003e [!NOTE]\n\u003e If you install this repository via Ansible Galaxy, you will need to replace the `include_role` variable in the example playbooks from `ansible-role-nginx` to `nginxinc.nginx`.\n\n## Other NGINX Ansible Collections and Roles\n\nYou can find the Ansible NGINX Core collection of roles to install and configure NGINX Open Source, NGINX Plus, and NGINX App Protect [here](https://github.com/nginxinc/ansible-collection-nginx).\n\nYou can find the Ansible NGINX configuration role to configure NGINX [here](https://github.com/nginxinc/ansible-role-nginx-config).\n\nYou can find the Ansible NGINX App Protect role to install and configure NGINX App Protect WAF and NGINX App Protect DoS [here](https://github.com/nginxinc/ansible-role-nginx-app-protect).\n\n## License\n\n[Apache License, Version 2.0](/LICENSE)\n\n## Author Information\n\n[Alessandro Fael Garcia](https://github.com/alessfg)\n\n[Grzegorz Dzien](https://github.com/gdzien)\n\n[Tom Gamull](https://github.com/magicalyak)\n\n\u0026copy; [F5, Inc.](https://www.f5.com/) 2018 - 2024\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnginxinc%2Fansible-role-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnginxinc%2Fansible-role-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnginxinc%2Fansible-role-nginx/lists"}