{"id":17149836,"url":"https://github.com/tinyblargon/ansible-role-nginx","last_synced_at":"2026-05-09T04:34:11.165Z","repository":{"id":206823903,"uuid":"716706576","full_name":"Tinyblargon/ansible-role-nginx","owner":"Tinyblargon","description":"Ansible role to install and configure nginx.","archived":false,"fork":false,"pushed_at":"2026-04-13T21:02:54.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-13T22:30:20.183Z","etag":null,"topics":["ansible","debian","nginx"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/ui/standalone/roles/tinyblargon/nginx/","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tinyblargon.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-09T17:43:06.000Z","updated_at":"2026-04-13T20:59:56.000Z","dependencies_parsed_at":"2023-11-24T11:28:29.300Z","dependency_job_id":"418189e6-be89-436d-bfd0-b6c796e0106c","html_url":"https://github.com/Tinyblargon/ansible-role-nginx","commit_stats":null,"previous_names":["tinyblargon/ansible-role-nginx"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Tinyblargon/ansible-role-nginx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinyblargon%2Fansible-role-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinyblargon%2Fansible-role-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinyblargon%2Fansible-role-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinyblargon%2Fansible-role-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tinyblargon","download_url":"https://codeload.github.com/Tinyblargon/ansible-role-nginx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinyblargon%2Fansible-role-nginx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32807266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","debian","nginx"],"created_at":"2024-10-14T21:34:14.153Z","updated_at":"2026-05-09T04:34:11.159Z","avatar_url":"https://github.com/Tinyblargon.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Role: nginx\n\n[![CI](https://github.com/Tinyblargon/ansible-role-nginx/actions/workflows/ci.yml/badge.svg)](https://github.com/Tinyblargon/ansible-role-nginx)\n\nInstall and configure nginx.\n\nThis solution addresses the circular dependency problem between nginx and Letsencrypt's Certbot. If certificate files are missing, the system substitutes them with `nginx_default_cert:` and `nginx_default_key:` in the nginx configuration. Once the actual certificates are installed on the system, re-running this role will direct nginx to use these new certificates, replacing the temporary ones.\n\nTo safeguard your nginx configuration, a backup is created before any changes are made. If the nginx configuration test fails, the system will restore the configuration from the backup.\n\n## Requirements\n\nN/A\n\n## Role Variables\n\n### Defaults\n\n| **Variable Name**   | **Type**| **Default Value**                       | **Description**\n| :-------------------| :------:| :--------------------------------------:| :--------------\n| nginx_vhosts:       | list map| []                                      | List of vhosts, see:[Nginx_vhosts](#nginx_vhosts).\n| nginx_vhosts_remove:| bool    | false                                   | When `true` all vhosts that are not in `nginx_vhosts:` will be removed.\n| nginx_state:        | string  | \"present\"                               | When `\"present\"` nginx will be installed and configured, when `\"absent\"` nginx will be removed.\n| nginx_backup:       | bool    | true                                    | When `true` the nginx config will be backed up prior to modification and restored when a config error is detected.\n| nginx_backup_file:  | string  | \"/etc/nginx.backup/nginx.tar.gz\"        | Location of the nginx backup archive.\n| nginx_default_cert: | string  | \"/etc/ssl/certs/ssl-cert-snakeoil.pem\"  | The path to the default cert file. When `ssl_certificate` has a nonexistent file configured it will be substituted for this cert.\n| nginx_default_key:  | string  | \"/etc/ssl/private/ssl-cert-snakeoil.key\"| The path to the default key file. When `ssl_certificate_key` has a nonexistent file configured it will be substituted for this key.\n\n### Nginx_vhosts\n\n| **Variable Name**| **Required**| **Type**| **Default Value**| **Description**\n| :----------------| :----------:| :------:| :---------------:| :--------------\n| name:            | yes         | string  | \"\"               | This is the name of the vhost/config file and should be unique.\n| content:         | no          | string  | \"\"               | Normal nginx config is expected here and can be obtained with a file lookup.\n| enabled:         | no          | bool    | true             | If the vhost should be enabled or not.\n| state:           | no          | string  | \"present\"        | When `\"present\"` the vhost will be created, when `\"absent\"` the vhost will be removed.\n\n**Note:** `Content:` is only optional when `state:` is `\"absent\"`\n\n## Dependencies\n\nN/A\n\n## Example Playbook\n\n```yaml\n- hosts: all\n  roles:\n    - role: tinyblargon.nginx\n      vars:\n        nginx_vhosts:\n          - name: \"site-1\"\n            content: \"{{ lookup('file', 'sites/site-1.nginx.conf') }}\"\n          - name: \"site-2\"\n            content: \"{{ lookup('file', 'sites/site-2.nginx.conf') }}\"\n            enabled: false\n          - name: \"default\"\n            state: \"absent\"\n        nginx_vhosts_remove: true\n        nginx_state: \"present\"\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyblargon%2Fansible-role-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinyblargon%2Fansible-role-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyblargon%2Fansible-role-nginx/lists"}