{"id":21075549,"url":"https://github.com/ribbinpo/ansible-nginx","last_synced_at":"2026-05-05T04:37:19.186Z","repository":{"id":242043707,"uuid":"807104086","full_name":"ribbinpo/ansible-nginx","owner":"ribbinpo","description":"template ansible to run nginx container","archived":false,"fork":false,"pushed_at":"2025-04-07T09:12:44.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T09:33:29.966Z","etag":null,"topics":["ansible","docker","docker-compose","nginx","template"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ribbinpo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-05-28T13:43:36.000Z","updated_at":"2025-04-07T09:12:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"407654c9-a84a-4252-bd4b-a8023b06ca1e","html_url":"https://github.com/ribbinpo/ansible-nginx","commit_stats":null,"previous_names":["ribbinpo/ansible-nginx"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ribbinpo/ansible-nginx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribbinpo%2Fansible-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribbinpo%2Fansible-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribbinpo%2Fansible-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribbinpo%2Fansible-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ribbinpo","download_url":"https://codeload.github.com/ribbinpo/ansible-nginx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ribbinpo%2Fansible-nginx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32635988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"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","docker","docker-compose","nginx","template"],"created_at":"2024-11-19T19:23:41.439Z","updated_at":"2026-05-05T04:37:19.159Z","avatar_url":"https://github.com/ribbinpo.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Nginx Setup with Docker-Compose\n\n## Overview\n\nThis project uses Ansible to automate the setup of an Nginx server with Docker Compose. It includes two playbooks to configure Nginx for HTTP and HTTPS with SSL.\n\n## Prerequisites\n\n- Python engine (can skip if you have ansible in your machine)\n- At least 1 server (OS: Ubuntu)\n- SSL certificate and private key (for HTTPS setup)\n\n## Installation\n\n1. create python enviroment\n\n```sh\npython3 -m venv env\n```\n\n2. Activate python enviroment\n\n```sh\nsource env/bin/activate # for macOS\n```\n\nfor deactivate `source deactivate`\n\n3. install ansible package\n\n```sh\npip3 install -r requirement.txt\n```\n\n4. install docker compose galaxy collection\n\n```sh\nansible-galaxy collection install community.docker --force\n```\n\n## Usage\n\n### For HTTP\n\n1. Create `inventory` file and write server connection\n\n```sh\ncp inventory_example inventory\n```\n\n2. Go to `host_vars/server01` file and fill in:\n\n```sh\ncp host_vars/server01_example host_vars/server01\n```\n\n- PRIVATE_IP: private ip on your server\n- PUBLIC_IP: public ip on your server\n- PORT: server port that you want mapping\n\n3. Run the http playbook\n\n```sh\nansible-playbook playbooks/nginx-http.yaml\n```\n\n### For HTTPS\n\n1. Create `inventory` file and write server connection\n\n```ini\n[all:vars]\nansible_user=\n\n[all]\nserver01 ansible_host=\nansible_password=\n```\n\n2. Go to `host_vars/server01` file and fill in:\n\n- PRIVATE_IP: private ip on your server\n- PUBLIC_IP: public ip on your server\n- PORT: server port that you want mapping\n- DOMAIN_NAME: your domain name that map to this server\n\n#### [1] Have own SSL\n\n3. Move certificate and private key file to `files/ssl` dicectory\n\n- change certificate filename to `certificate.crt`\n- change privatekey filename to `private.key`\n\n4. Run the https playbook\n\n```sh\nansible-playbook playbooks/nginx-https.yaml\n```\n\n#### [2] (Alternative) Generate ssl by Certbot with public registry\n\n3. Run the https playbook\n\n```sh\nansible-playbook playbooks/nginx-https-auto-ssl.yaml\n```\n\n#### [3] (Alternative) Generate ssl by Certbot with private registry\n\n```sh\nansible-playbook playbooks/nginx-https-auto-ssl-private.yaml\n```\n\n## Check syntax\n\n```sh\nansible-playbook --syntax-check playbooks/nginx-https.yaml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fribbinpo%2Fansible-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fribbinpo%2Fansible-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fribbinpo%2Fansible-nginx/lists"}