{"id":16058345,"url":"https://github.com/shey/consul-vault-haproxy","last_synced_at":"2025-07-24T15:07:56.416Z","repository":{"id":139469934,"uuid":"396905528","full_name":"shey/consul-vault-haproxy","owner":"shey","description":"Ansible Playbooks to build a HA Vault service with Consul and HAProxy","archived":false,"fork":false,"pushed_at":"2021-08-16T21:22:52.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T15:50:46.991Z","etag":null,"topics":["ansible","consul","devops","haproxy","vagrant","vault"],"latest_commit_sha":null,"homepage":"","language":"Jinja","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/shey.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}},"created_at":"2021-08-16T17:45:13.000Z","updated_at":"2021-08-16T21:22:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"8126918b-66d7-479d-9dfa-883b820effb0","html_url":"https://github.com/shey/consul-vault-haproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shey%2Fconsul-vault-haproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shey%2Fconsul-vault-haproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shey%2Fconsul-vault-haproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shey%2Fconsul-vault-haproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shey","download_url":"https://codeload.github.com/shey/consul-vault-haproxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305946,"owners_count":20917208,"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","consul","devops","haproxy","vagrant","vault"],"created_at":"2024-10-09T03:20:59.405Z","updated_at":"2025-04-05T08:15:56.792Z","avatar_url":"https://github.com/shey.png","language":"Jinja","readme":"# consul-vault-haproxy\n\nAnsible playbooks that install and configure Vault with Consul backend-- behind HAProxy.\n\n## Notes\n\n1. This demo requires `Vagrant` and `VirtualBox`.\n1. The consul encryption key is hardcoded in ansible-vault.\n1. Initializing and unsealing the vault is a manual step.\n1. Vagrant assumes your public key is available at ~/.ssh/id_rsa.pub\n\n## Instructions\n\n### Prepare the env\n1. run ```make setup``` to install vagrant-hostmanager and generate the encryption key for Ansible vault.\n\n### Setup a HAProxy loadbalancer\n1. run ```ENV=vagrant make build-proxies```\n\n### Prepare hosts to become consul servers\n1. run ```make start-vms``` to start vagrant boxes and setup /etc/hosts.\n1. run ```ENV=vagrant make build-consul-servers``` to install base packages and consul on the hosts\n\n#### Bootstrapping and clustering Consul\n1. run ```ENV=vagrant make bootstrap-consul``` to deploy the bootstrap config to the host and start consul in bootstrapped mode.\n1. run ```ENV=vagrant make cluster-consul``` to generate the server configs and have the consul servers join together to form a more perfect union.\n1. run ```ENV=vagrant make verify-cluster``` to check consul membership. You should see all three servers listed.\n\n### Setup Consul clients and Vault servers\n1. run ```ENV=vagrant make buid-vault-servers```\n\n### Initializing and unsealing vaults\n\n1. On one of the vault machines, run the following command to initialize the vault. Upon initialization, Vault will return the unsealing keys and the master token.\n\n```vault operator init```\n\n1. Each vault requires three keys to unseal. Each vault must be unsealed individually.\n\n```vault unseal \u003ckey$\u003e```\n\n## Author and  License\nCopyright (c) 2021 Shey Sewani, MIT License\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshey%2Fconsul-vault-haproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshey%2Fconsul-vault-haproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshey%2Fconsul-vault-haproxy/lists"}