{"id":19568797,"url":"https://github.com/buluma/ansible-role-haproxy","last_synced_at":"2025-02-26T10:18:14.053Z","repository":{"id":16878990,"uuid":"80800603","full_name":"buluma/ansible-role-haproxy","owner":"buluma","description":"Install and configure haproxy on your system.","archived":false,"fork":false,"pushed_at":"2024-07-23T07:23:03.000Z","size":310,"stargazers_count":4,"open_issues_count":6,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T01:58:54.610Z","etag":null,"topics":["haproxy","haproxy-configuration","networking"],"latest_commit_sha":null,"homepage":"https://buluma.github.io/ansible-role-haproxy/","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/buluma.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":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"buluma"}},"created_at":"2017-02-03T05:38:27.000Z","updated_at":"2024-07-23T07:23:04.000Z","dependencies_parsed_at":"2023-02-19T05:15:53.177Z","dependency_job_id":"bf383f4c-be5d-4541-b8e9-b324120dfefd","html_url":"https://github.com/buluma/ansible-role-haproxy","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buluma%2Fansible-role-haproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buluma%2Fansible-role-haproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buluma%2Fansible-role-haproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buluma%2Fansible-role-haproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buluma","download_url":"https://codeload.github.com/buluma/ansible-role-haproxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240831378,"owners_count":19864718,"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":["haproxy","haproxy-configuration","networking"],"created_at":"2024-11-11T06:06:21.304Z","updated_at":"2025-02-26T10:18:13.866Z","avatar_url":"https://github.com/buluma.png","language":"Jinja","funding_links":["https://github.com/sponsors/buluma"],"categories":[],"sub_categories":[],"readme":"# Ansible role [haproxy](https://galaxy.ansible.com/ui/standalone/roles/buluma/haproxy/documentation)\n\nInstall and configure haproxy on your system.\n\n|GitHub|Version|Issues|Pull Requests|Downloads|\n|------|-------|------|-------------|---------|\n|[![github](https://github.com/buluma/ansible-role-haproxy/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-haproxy/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-haproxy.svg)](https://github.com/buluma/ansible-role-haproxy/releases/)|[![Issues](https://img.shields.io/github/issues/buluma/ansible-role-haproxy.svg)](https://github.com/buluma/ansible-role-haproxy/issues/)|[![PullRequests](https://img.shields.io/github/issues-pr-closed-raw/buluma/ansible-role-haproxy.svg)](https://github.com/buluma/ansible-role-haproxy/pulls/)|[![Ansible Role](https://img.shields.io/ansible/role/d/buluma/haproxy)](https://galaxy.ansible.com/ui/standalone/roles/buluma/haproxy/documentation)|\n\n## [Example Playbook](#example-playbook)\n\nThis example is taken from [`molecule/default/converge.yml`](https://github.com/buluma/ansible-role-haproxy/blob/master/molecule/default/converge.yml) and is tested on each push, pull request and release.\n\n```yaml\n---\n- name: Converge\n  hosts: all\n  become: true\n  gather_facts: true\n\n  roles:\n    - role: buluma.haproxy\n      haproxy_frontends:\n        - name: http\n          address: \"*\"\n          port: 80\n          default_backend: backend\n        - name: https\n          address: \"*\"\n          port: 443\n          default_backend: backend\n          ssl: true\n          crts:\n            - /tmp/haproxy.keycrt\n        - name: smtp\n          address: \"*\"\n          port: 25\n          default_backend: smtp\n          mode: tcp\n      haproxy_backend_default_balance: roundrobin\n      haproxy_backends:\n        - name: backend\n          httpcheck: true\n          # You can tell how the health check must be done.\n          # This requires haproxy version 2\n          # http_check:\n          #   send:\n          #     method: GET\n          #     uri: /health.html\n          #   expect: status 200\n          balance: roundrobin\n          # You can refer to hosts in an Ansible group.\n          # The `ansible_default_ipv4` will be used as an address to connect to.\n          servers: \"{{ groups['all'] }}\"\n          port: 8080\n          options:\n            - check\n        - name: smtp\n          balance: leastconn\n          mode: tcp\n          # You can also refer to a list of servers.\n          servers:\n            - name: first\n              address: \"127.0.0.1\"\n              port: 25\n            - name: second\n              address: \"127.0.0.2\"\n              port: 25\n          port: 25\n        - name: vault\n          mode: tcp\n          httpcheck: GET /v1/sys/health HTTP/1.1\n          servers: \"{{ groups['all'] }}\"\n          http_send_name_header: Host\n          port: 8200\n          options:\n            - check\n            - check-ssl\n            - ssl verify none\n\n      haproxy_listen_default_balance: roundrobin\n      haproxy_listens:\n        - name: listen\n          address: \"*\"\n          httpcheck: true\n          listen_port: 8081\n          balance: roundrobin\n          # You can refer to hosts in an Ansible group.\n          # The `ansible_default_ipv4` will be used as an address to connect to.\n          servers: \"{{ groups['all'] }}\"\n          port: 8080\n          options:\n            - maxconn 100000\n```\n\nThe machine needs to be prepared. In CI this is done using [`molecule/default/prepare.yml`](https://github.com/buluma/ansible-role-haproxy/blob/master/molecule/default/prepare.yml):\n\n```yaml\n---\n- name: Prepare\n  hosts: all\n  become: true\n  gather_facts: false\n\n  roles:\n    - role: buluma.bootstrap\n    - role: buluma.core_dependencies\n    - role: buluma.epel\n    - role: buluma.buildtools\n    - role: buluma.python_pip\n    - role: buluma.openssl\n      openssl_key_directory: /tmp\n      openssl_items:\n        - name: haproxy\n          common_name: \"{{ ansible_fqdn }}\"\n    # This role is applied to serve as a mock \"backend\" server. See `molecule/default/verify.yml`.\n    - role: buluma.httpd\n      httpd_port: 8080\n\n  vars:\n    ansible_python_interpreter: /usr/bin/python3\n    _httpd_data_directory:\n      default: /var/www/html\n      Alpine: /var/www/localhost/htdocs\n      Suse: /srv/www/htdocs\n\n    httpd_data_directory: \"{{ _httpd_data_directory[ansible_os_family] | default(_httpd_data_directory['default'] ) }}\"\n  post_tasks:\n    - name: Place health check\n      ansible.builtin.copy:\n        content: 'ok'\n        dest: \"{{ httpd_data_directory }}/health.html\"\n\n    - name: Place sample page\n      ansible.builtin.copy:\n        content: 'Hello world!'\n        dest: \"{{ httpd_data_directory }}/index.html\"\n```\n\nAlso see a [full explanation and example](https://buluma.github.io/how-to-use-these-roles.html) on how to use these roles.\n\n## [Role Variables](#role-variables)\n\nThe default values for the variables are set in [`defaults/main.yml`](https://github.com/buluma/ansible-role-haproxy/blob/master/defaults/main.yml):\n\n```yaml\n---\n# defaults file for haproxy\n\n# Configure stats in HAProxy?\nhaproxy_stats: true\nhaproxy_stats_port: 1936\nhaproxy_stats_bind_addr: \"0.0.0.0\"\n\n# Default setttings for HAProxy.\nhaproxy_retries: 3\nhaproxy_timeout_http_request: 10s\nhaproxy_timeout_connect: 10s\nhaproxy_timeout_client: 1m\nhaproxy_timeout_server: 1m\nhaproxy_timeout_http_keep_alive: 10s\nhaproxy_timeout_check: 10s\nhaproxy_maxconn: 3000\n\n# A list of frontends. See `molecule/\nhaproxy_frontends: []\nhaproxy_backend_default_balance: roundrobin\nhaproxy_backends: []\n\n# For the listening lists:\nhaproxy_listen_default_balance: roundrobin\nhaproxy_listens: []\n```\n\n## [Requirements](#requirements)\n\n- pip packages listed in [requirements.txt](https://github.com/buluma/ansible-role-haproxy/blob/master/requirements.txt).\n\n## [State of used roles](#state-of-used-roles)\n\nThe following roles are used to prepare a system. You can prepare your system in another way.\n\n| Requirement | GitHub | Version |\n|-------------|--------|--------|\n|[buluma.bootstrap](https://galaxy.ansible.com/buluma/bootstrap)|[![Ansible Molecule](https://github.com/buluma/ansible-role-bootstrap/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-bootstrap/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-bootstrap.svg)](https://github.com/shadowwalker/ansible-role-bootstrap)|\n|[buluma.buildtools](https://galaxy.ansible.com/buluma/buildtools)|[![Ansible Molecule](https://github.com/buluma/ansible-role-buildtools/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-buildtools/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-buildtools.svg)](https://github.com/shadowwalker/ansible-role-buildtools)|\n|[buluma.core_dependencies](https://galaxy.ansible.com/buluma/core_dependencies)|[![Ansible Molecule](https://github.com/buluma/ansible-role-core_dependencies/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-core_dependencies/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-core_dependencies.svg)](https://github.com/shadowwalker/ansible-role-core_dependencies)|\n|[buluma.epel](https://galaxy.ansible.com/buluma/epel)|[![Ansible Molecule](https://github.com/buluma/ansible-role-epel/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-epel/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-epel.svg)](https://github.com/shadowwalker/ansible-role-epel)|\n|[buluma.httpd](https://galaxy.ansible.com/buluma/httpd)|[![Ansible Molecule](https://github.com/buluma/ansible-role-httpd/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-httpd/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-httpd.svg)](https://github.com/shadowwalker/ansible-role-httpd)|\n|[buluma.openssl](https://galaxy.ansible.com/buluma/openssl)|[![Ansible Molecule](https://github.com/buluma/ansible-role-openssl/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-openssl/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-openssl.svg)](https://github.com/shadowwalker/ansible-role-openssl)|\n|[buluma.python_pip](https://galaxy.ansible.com/buluma/python_pip)|[![Ansible Molecule](https://github.com/buluma/ansible-role-python_pip/actions/workflows/molecule.yml/badge.svg)](https://github.com/buluma/ansible-role-python_pip/actions/workflows/molecule.yml)|[![Version](https://img.shields.io/github/release/buluma/ansible-role-python_pip.svg)](https://github.com/shadowwalker/ansible-role-python_pip)|\n\n## [Context](#context)\n\nThis role is a part of many compatible roles. Have a look at [the documentation of these roles](https://buluma.github.io/) for further information.\n\nHere is an overview of related roles:\n\n![dependencies](https://raw.githubusercontent.com/buluma/ansible-role-haproxy/png/requirements.png \"Dependencies\")\n\n## [Compatibility](#compatibility)\n\nThis role has been tested on these [container images](https://hub.docker.com/u/buluma):\n\n|container|tags|\n|---------|----|\n|[EL](https://hub.docker.com/r/buluma/enterpriselinux)|8, 9|\n|[Debian](https://hub.docker.com/r/buluma/debian)|all|\n|[Fedora](https://hub.docker.com/r/buluma/fedora)|38, 39, 40|\n|[opensuse](https://hub.docker.com/r/buluma/opensuse)|all|\n|[Ubuntu](https://hub.docker.com/r/buluma/ubuntu)|jammy, focal, bionic, noble|\n\nThe minimum version of Ansible required is 2.12, tests have been done to:\n\n- The previous version.\n- The current version.\n- The development version.\n\nIf you find issues, please register them in [GitHub](https://github.com/buluma/ansible-role-haproxy/issues)\n\n## [Changelog](#changelog)\n\n[Role History](https://github.com/buluma/ansible-role-haproxy/blob/master/CHANGELOG.md)\n\n## [License](#license)\n\n[Apache-2.0](https://github.com/buluma/ansible-role-haproxy/blob/master/LICENSE)\n\n## [Author Information](#author-information)\n\n[Shadow Walker](https://buluma.github.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuluma%2Fansible-role-haproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuluma%2Fansible-role-haproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuluma%2Fansible-role-haproxy/lists"}