{"id":18469103,"url":"https://github.com/sansible/consul","last_synced_at":"2026-04-28T13:32:56.099Z","repository":{"id":74439353,"uuid":"68614681","full_name":"sansible/consul","owner":"sansible","description":"Installs and configures Consul for Debian systems","archived":false,"fork":false,"pushed_at":"2017-06-28T13:28:50.000Z","size":11,"stargazers_count":1,"open_issues_count":4,"forks_count":1,"subscribers_count":9,"default_branch":"develop","last_synced_at":"2025-05-07T19:53:13.572Z","etag":null,"topics":["ansible","ansible-role","ansible-roles","consul","installs-consul"],"latest_commit_sha":null,"homepage":null,"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/sansible.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":"2016-09-19T14:37:58.000Z","updated_at":"2017-02-03T07:58:57.000Z","dependencies_parsed_at":"2023-02-26T18:31:46.698Z","dependency_job_id":null,"html_url":"https://github.com/sansible/consul","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sansible/consul","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sansible%2Fconsul","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sansible%2Fconsul/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sansible%2Fconsul/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sansible%2Fconsul/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sansible","download_url":"https://codeload.github.com/sansible/consul/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sansible%2Fconsul/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263421460,"owners_count":23464012,"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","ansible-role","ansible-roles","consul","installs-consul"],"created_at":"2024-11-06T10:08:57.505Z","updated_at":"2026-04-28T13:32:51.075Z","avatar_url":"https://github.com/sansible.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Consul\n\nMaster: [![Build Status](https://travis-ci.org/sansible/consul.svg?branch=master)](https://travis-ci.org/sansible/consul)\nDevelop: [![Build Status](https://travis-ci.org/sansible/consul.svg?branch=develop)](https://travis-ci.org/sansible/consul)\n\n* [Overview](#overview)\n* [ansible.cfg](#ansible-cfg)\n* [Installation and Dependencies](#installation-and-dependencies)\n* [Tags](#tags)\n* [Settings](#settings)\n* [Examples](#examples)\n\nThis roles installs Consul.\n\nFor more information on Consul please visit [consul.io](https://www.consul.io/).\n\n\n\n\n## Overview\n\nThis role can install Consul in either agent or server mode. An AWS\nautodiscovery script is included so Consul servers can be auto\ndetected using AWS tags.\n\nIf you want to use Consul as a nameserver there is also an option\nto install Dnsmasq and set Consul as the main nameserver.\n\nBy default leave_on_terminate is set to true, this is so machines that\nget recycled by an AWS Autoscaling group will leave the cluster properly.\n\n\n\n\n## ansible.cfg\n\nThis role is designed to work with merge \"hash_behaviour\". Make sure your\nansible.cfg contains these settings\n\n```INI\n[defaults]\nhash_behaviour = merge\n```\n\n\n\n\n## Installation and Dependencies\n\nTo install run `ansible-galaxy install sansible.consul` or add this to your\n`roles.yml`:\n\n```YAML\n- name: sansible.consul\n  version: v1.0\n```\n\nand run `ansible-galaxy install -p ./roles -r roles.yml`\n\n\n\n\n## Tags\n\nThis role uses two tags: **build** and **configure**\n\n* `build` - Installs Consul and all it's dependencies.\n* `configure` - Configure and ensures that the Consul service is running.\n\n\n\n\n## Settings\n\n```YAML\n---\n\nconsul:\n  # Used to lookup consul server machines in AWS\n  # Both agents and servers need to be able to lookup\n  aws_ips_autodiscover:\n    enabled: false\n    lookup_filter: \"Name=tag:Environment,Values={ENV} Name=tag:Role,Values=consul_server\"\n  # Useful when you have multiple private interfaces\n  bind_interface: eth0\n  checksum: \"abdf0e1856292468e2c9971420d73b805e93888e006c76324ae39416edcf0627\"\n  directories:\n    config_dir: \"/etc/consul.d\"\n    data_dir: \"/var/lib/consul\"\n    install_dir: \"/usr/share/consul\"\n    log_dir: \"/var/log/consul\"\n  # These get written to json config file\n  settings:\n    bootstrap: \"false\"\n    bootstrap_expect: \"1\"\n    datacenter: \"aws-eu-west-1\"\n    enable_debug: \"false\"\n    leave_on_terminate: \"true\"\n    log_level: \"warn\"\n    node_name: \"{{ ansible_fqdn }}\"\n    rejoin_after_leave: \"true\"\n    ports: {}\n    server: \"false\"\n    start_join: []\n  startopts: \"\"\n  # If set to true will install dnsmasq and set as resolver\n  use_as_nameserver: no\n  version: \"0.6.4\"\n```\n\n\n\n\n## Examples\n\nTo install in server mode:\n\n```YAML\n- name: Install and configure Consul Server\n  hosts: \"somehost\"\n\n  roles:\n    - role: sansible.consul\n      consul:\n        settings:\n          bootstrap_expect: 3\n          server: \"true\"\n          start_join: [ \"some-host\" ]\n```\n\nTo install in agent mode:\n\n```YAML\n- name: Install and configure Consul Agent\n  hosts: \"somehost\"\n\n  roles:\n    - role: sansible.consul\n      consul:\n        settings:\n          server: \"false\"\n          start_join: [ \"some-host\" ]\n```\n\nTo use AWS autodiscovery:\n\n```YAML\n- name: Install and configure Consul Server\n  hosts: \"somehost\"\n\n  roles:\n    - role: sansible.consul\n      consul:\n        aws_ips_autodiscover:\n          enabled: true\n          lookup_filter: \"Name=tag:Environment,Values=dev Name=tag:Role,Values=consul_server\"\n        settings:\n          bootstrap_expect: 3\n          server: \"true\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsansible%2Fconsul","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsansible%2Fconsul","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsansible%2Fconsul/lists"}