{"id":15080743,"url":"https://github.com/zstyblik/ansible-role-apache","last_synced_at":"2026-02-21T02:39:00.884Z","repository":{"id":251513934,"uuid":"829411228","full_name":"zstyblik/ansible-role-apache","owner":"zstyblik","description":"Ansible role for management of apache2","archived":false,"fork":false,"pushed_at":"2026-01-19T16:24:38.000Z","size":93,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-19T22:46:42.369Z","etag":null,"topics":["ansible-role","httpd","linux"],"latest_commit_sha":null,"homepage":"","language":"Python","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/zstyblik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["zstyblik"]}},"created_at":"2024-07-16T11:27:01.000Z","updated_at":"2026-01-19T16:23:41.000Z","dependencies_parsed_at":"2025-01-28T09:23:57.996Z","dependency_job_id":"87a58c06-c69d-4d38-9c3b-1ecccca99e1c","html_url":"https://github.com/zstyblik/ansible-role-apache","commit_stats":null,"previous_names":["zstyblik/ansible-role-apache"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zstyblik/ansible-role-apache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zstyblik%2Fansible-role-apache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zstyblik%2Fansible-role-apache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zstyblik%2Fansible-role-apache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zstyblik%2Fansible-role-apache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zstyblik","download_url":"https://codeload.github.com/zstyblik/ansible-role-apache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zstyblik%2Fansible-role-apache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"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-role","httpd","linux"],"created_at":"2024-09-25T05:30:28.612Z","updated_at":"2026-02-21T02:39:00.855Z","avatar_url":"https://github.com/zstyblik.png","language":"Python","funding_links":["https://github.com/sponsors/zstyblik"],"categories":[],"sub_categories":[],"readme":"# Ansible role apache\n\n**READ ME FIRST:** Probably for the last 50 people or so which are still using\nAnsible I wholeheartedly recommend to use [geerlingguy.apache] role. Why?\nBecause it's tested, maintained and covers a lot of, if not the most of, use\ncases.\n\n---\n\nThis is yet another ansible role for management of Apache's [httpd]. Inspiration\nfor this role was and is [puppetlabs-apache] module. Another one is\naforementioned Geerlingguy's ansible role [geerlingguy.apache].\n\nSince nobody is going to use this anyway(Ansible isn't used anymore and neither\nis httpd) I'm afraid that's it. Only supported OS at this moment is Debian.\nI might add support for some other OS, if and when I'm bored.\n\n#### Features\n\n* richer httpd and virtual host configuration(perhaps it's too much)\n* generate `ports.conf` from virtual hosts\n* allow to enable/disable config files\n* allow to enable/disable modules\n\n#### Known limitations\n\n##### Ports\n\n* if there are no virtual hosts, httpd should listen at port 80 and 443 as is\n  by default in Debian.\n* ports are generated **ONLY** from managed(defined) virtual hosts. It's\n  possible to define additional `Listen` directives via `apache_confs`.\n\n##### Virtual Hosts\n\nVirtual host filename is assembled from priority, protocol and servername. If\nany of these change, new filename will be created and the old one will be left\nbehind since unmanaged stuff is left alone. This is kind of suboptimal.\n\nOne way around this is either duplicate the whole virtual host configuration or\ncreate a minimal stub with identical combination of port, servername and\nssl/no-ssl and `state: absent`. Then the former virtual host should get\ndisabled and new one deployed.\n\n## Requirements\n\nNone.\n\n## Role variables\n\nSee `defaults/main.yml`. There is also `specs/apache_vhost_argument_specs.yml`\nwhich should give you some idea about configuration options and possibilities\nregarding virtual hosts.\n\n## Dependencies\n\nThere are no extra dependencies as far as Ansible goes.\n\n## Example Playbook\n\n```\n- hosts: all\n  vars:\n    apache_vhosts:\n      - servername: \"local1.dev\"\n        port: 80\n        docroot: \"/var/www/html\"\n        rewrites:\n          - rewrite_rule: [\"^/.*$ https://localhost1 [R=302,L]\"]\n\n      - servername: \"localhost1\"\n        serveradmin: \"root@example.com\"\n        port: 443\n        docroot: \"/var/www/html\"\n        directories:\n          - path: \"/var/www/html\"\n            allowoverride: [\"None\"]\n            directoryindex: \"index.php\"\n            require: \"all granted\"\n            addhandlers:\n              - handler: \"application/x-httpd-php\"\n                extensions:\n                  - \"\\.php\"\n\n          - provider: \"location\"\n            path: \"/README\"\n            require: \"all denied\"\n        ssl:\n          - ssl_cert: \"/etc/ssl/certs/ssl-cert-snakeoil.pem\"\n            ssl_key: \"/etc/ssl/private/ssl-cert-snakeoil.key\"\n            ssl_cacerts_dir: \"/etc/ssl/certs\"\n\n      - servername: \"local2.dev\"\n        state: absent\n        listen_ip: \"127.0.0.1\"\n        port: 8080\n        docroot: \"/var/www/html\"\n        error_log_format24:\n          - format: \"[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M\"\n          - flag: request\n            format: \"[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T\"\n\n    apache_mods:\n      - name: rewrite\n        state: present\n      - name: ssl\n        conf_content: |\n          SSLProtocol all -SSLv2 -SSLv3 -TLSv1\n\n    apache_confs:\n      - name: serve-cgi-bin\n        state: absent\n      - name: my_config\n        conf_content: |\n          TraceEnable On\n  roles:\n     - role: zstyblik.apache\n```\n\n## License\n\nMIT\n\n[geerlingguy.apache]: https://github.com/geerlingguy/ansible-role-apache/tree/master\n[httpd]: https://httpd.apache.org\n[puppetlabs-apache]: https://forge.puppet.com/modules/puppetlabs/apache/readme\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzstyblik%2Fansible-role-apache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzstyblik%2Fansible-role-apache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzstyblik%2Fansible-role-apache/lists"}