-
Notifications
You must be signed in to change notification settings - Fork 3
consul ansible role files added #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AnithaAnnem
wants to merge
412
commits into
master
Choose a base branch
from
0.0.3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
412 commits
Select commit
Hold shift + click to select a range
b3fbe1f
Update main.yml
AnithaAnnem ef015cc
Update rbac.yml
AnithaAnnem 5cb31db
Update acl.yml
AnithaAnnem 6a0489c
Update acl_policies.yml
AnithaAnnem cb1af43
Update acl_tokens.yml
AnithaAnnem 9e8dc38
Update acl.yml
AnithaAnnem db8d88a
Update acl_policies.yml
AnithaAnnem 49c8104
Update acl_tokens.yml
AnithaAnnem 8813fcf
Update rbac.yml
AnithaAnnem 61f9b26
Update server.hcl.j2
AnithaAnnem d27f876
Update server.hcl.j2
AnithaAnnem c7ce2ee
Update server.hcl.j2
AnithaAnnem a0f178b
Update acl.yml
AnithaAnnem c17397b
Update server.hcl.j2
AnithaAnnem 81e6185
Update acl.yml
AnithaAnnem 25a212e
Update acl_policies.yml
AnithaAnnem b53f066
Update acl_tokens.yml
AnithaAnnem ed1f50b
Update rbac.yml
AnithaAnnem f2194cf
Update main.yml
AnithaAnnem 7e52d2b
Update server.hcl.j2
AnithaAnnem 185f068
Update server.hcl.j2
AnithaAnnem 5ff4caa
Update server.hcl.j2
AnithaAnnem 258a045
Update acl.yml
AnithaAnnem bf48dd6
Update acl_policies.yml
AnithaAnnem 5f05250
Update acl_tokens.yml
AnithaAnnem 47cf278
Update rbac.yml
AnithaAnnem 08aa190
Update server.hcl.j2
AnithaAnnem 2949b4f
Update acl.yml
AnithaAnnem 2833680
Update acl_policies.yml
AnithaAnnem 043f37e
Update acl_tokens.yml
AnithaAnnem fa5e162
Update rbac.yml
AnithaAnnem 97c4d4d
Update and rename tls.crt to consul-agent-ca.pem
AnithaAnnem e5e9dc1
Update and rename tls.key to dc1-server-consul-0.pem
AnithaAnnem 73b4a4f
Create dc1-server-consul-0-key.pem
AnithaAnnem a32eb13
Update config.yml
AnithaAnnem 8c420a4
Update server.hcl.j2
AnithaAnnem 60cf490
Update acl.yml
AnithaAnnem 90077be
Update acl_policies.yml
AnithaAnnem 85782e5
Update rbac.yml
AnithaAnnem d1c5978
Update acl_policies.yml
AnithaAnnem 731b41a
Update consul-agent-ca.pem
AnithaAnnem 984356d
Update dc1-server-consul-0-key.pem
AnithaAnnem 1676465
Update dc1-server-consul-0.pem
AnithaAnnem eca8c16
Delete consul-role/files/consul-agent-ca.pem
AnithaAnnem 9ded9e0
Delete consul-role/files/dc1-server-consul-0-key.pem
AnithaAnnem 2701f0b
Delete consul-role/files/dc1-server-consul-0.pem
AnithaAnnem c460b4c
Create tls.crt
AnithaAnnem 0c6e209
Create tls.key
AnithaAnnem 6b6f268
Update acl.yml
AnithaAnnem 5afac80
Update acl_policies.yml
AnithaAnnem fa3abe4
Update acl_tokens.yml
AnithaAnnem 0af6e1c
Update config.yml
AnithaAnnem 590668e
Update rbac.yml
AnithaAnnem f18841a
Update server.hcl.j2
AnithaAnnem f76d0ee
Update server.hcl.j2
AnithaAnnem 99a4bcc
Update read-policy.hcl
AnithaAnnem 42e6f96
Update main.yml
AnithaAnnem 998fbc5
Update read-policy.hcl
AnithaAnnem b593bb5
Update main.yml
AnithaAnnem 8387744
Update server.hcl.j2
AnithaAnnem 1db7e12
Create monitoring-policy.hcl.j2
AnithaAnnem 96071b8
Update acl_policies.yml
AnithaAnnem 3c3009d
Update acl_tokens.yml
AnithaAnnem 2eb1869
Update acl_policies.yml
AnithaAnnem b753817
Update acl_tokens.yml
AnithaAnnem bc19e91
Update acl_tokens.yml
AnithaAnnem fe81b1b
Create prometheus-consul.yml.j2
AnithaAnnem 098bc8a
Update acl_tokens.yml
AnithaAnnem d44ee3b
Update acl_tokens.yml
AnithaAnnem 3156d4a
Update acl_tokens.yml
AnithaAnnem 1076834
Update main.yml
AnithaAnnem f9942f0
Create keycloak-service.json.j2
AnithaAnnem 42b7c83
Update config.yml
AnithaAnnem ef53ef9
Update keycloak-service.json.j2
AnithaAnnem e90feda
Update config.yml
AnithaAnnem 2ee4ac9
Update keycloak-service.json.j2
AnithaAnnem 6801ff6
Update keycloak-service.json.j2
AnithaAnnem 744e856
Update keycloak-service.json.j2
AnithaAnnem 10fc05c
Update keycloak-service.json.j2
AnithaAnnem 630defe
Update main.yml
AnithaAnnem 28ab8c9
Update config.yml
AnithaAnnem fd1ecda
Update acl_policies.yml
AnithaAnnem 5f9560c
Update acl_tokens.yml
AnithaAnnem e0375e3
Update server.hcl.j2
AnithaAnnem 6f37d27
Update server.hcl.j2
AnithaAnnem aa8c5ee
Update server.hcl.j2
AnithaAnnem d34412e
Update acl.yml
AnithaAnnem 93cd30d
Update acl_policies.yml
AnithaAnnem 7e2134f
Update acl_tokens.yml
AnithaAnnem c2ae456
Update rbac.yml
AnithaAnnem e68e8c1
Update acl.yml
AnithaAnnem ea001c9
Update acl_policies.yml
AnithaAnnem c976cca
Update rbac.yml
AnithaAnnem dd95ba8
Update acl_tokens.yml
AnithaAnnem b181031
Update acl.yml
AnithaAnnem 8923765
Delete consul-role/templates/keycloak-service.json.j2
AnithaAnnem 8c4e263
Update main.yml
AnithaAnnem 6065d42
Update config.yml
AnithaAnnem 97178d1
Update acl.yml
AnithaAnnem 3712ab4
Update acl_policies.yml
AnithaAnnem 24a56ff
Update acl_tokens.yml
AnithaAnnem ab1b9b6
Update rbac.yml
AnithaAnnem ce24736
Update acl.yml
AnithaAnnem 441adcc
Update acl.yml
AnithaAnnem ba8fb08
Update acl_policies.yml
AnithaAnnem fbcde4c
Update acl_tokens.yml
AnithaAnnem 6b3c217
Update rbac.yml
AnithaAnnem ceb4955
Update acl.yml
AnithaAnnem 016610b
Update acl_policies.yml
AnithaAnnem c63ee43
Update acl_tokens.yml
AnithaAnnem 8a9479f
Update rbac.yml
AnithaAnnem 3e8b3bf
Update server.hcl.j2
AnithaAnnem 3e45dbd
Update acl_policies.yml
AnithaAnnem 00b3cf6
Update acl.yml
AnithaAnnem a61def9
Update acl_tokens.yml
AnithaAnnem 034bddd
Update rbac.yml
AnithaAnnem f6cbca6
Update acl_policies.yml
AnithaAnnem 8a39a83
Update acl_policies.yml
AnithaAnnem ed3789a
Update acl_tokens.yml
AnithaAnnem 7e33c80
Update rbac.yml
AnithaAnnem 7fef5d3
Update rbac.yml
AnithaAnnem f340a20
Update acl.yml
AnithaAnnem 0811bd2
Update acl_policies.yml
AnithaAnnem c2a6357
Update acl_tokens.yml
AnithaAnnem 6d0b1a0
Delete consul-role/files/tls.key
AnithaAnnem de3d7d4
Delete consul-role/files/tls.crt
AnithaAnnem 9851cad
Update acl_policies.yml
AnithaAnnem c1eb7ee
Update acl_tokens.yml
AnithaAnnem 5c3b26d
Update rbac.yml
AnithaAnnem e5c46e7
Update server.hcl.j2
AnithaAnnem 8e0a4fd
Update config.yml
AnithaAnnem c825db2
Update server.hcl.j2
AnithaAnnem 4bca5c5
Update server.hcl.j2
AnithaAnnem 18f613c
Update acl_policies.yml
AnithaAnnem d7351e5
Update acl_policies.yml
AnithaAnnem 0d64548
Update acl_policies.yml
AnithaAnnem 1e20fa8
Update acl_tokens.yml
AnithaAnnem c67d980
Update rbac.yml
AnithaAnnem 4006ff2
Update acl_policies.yml
AnithaAnnem 54fe8af
Update acl_tokens.yml
AnithaAnnem 92a16af
Update rbac.yml
AnithaAnnem 988e4dc
Update server.hcl.j2
AnithaAnnem 5ee44ec
Update install.yml
AnithaAnnem 66a174a
Update config.yml
AnithaAnnem 1bf70a0
Update config.yml
AnithaAnnem 7caceea
Update main.yml
AnithaAnnem 2411124
Update acl.yml
AnithaAnnem 97221cb
Update acl.yml
AnithaAnnem 15e01d4
Update acl_policies.yml
AnithaAnnem 1bc2fd0
Update acl_tokens.yml
AnithaAnnem 16bffc6
Update rbac.yml
AnithaAnnem e102ba2
Update main.yml
AnithaAnnem 24ecdc8
Update main.yml
AnithaAnnem a365bba
Update acl_tokens.yml
AnithaAnnem addc389
moving all the files out from the consul-role directory
AnnemAnitha7989 8913df8
deleting the consul-role
AnnemAnitha7989 bb70e41
Create consul-readme.md
AnithaAnnem a9f2977
Update consul-readme.md
AnithaAnnem 61ce8c9
Update consul-readme.md
AnithaAnnem d59011a
Update main.yml
AnithaAnnem 7b09b6f
Update main.yml
AnithaAnnem c8d7cb7
Delete tasks/directories.yml
AnithaAnnem d60bead
Update service.yml
AnithaAnnem ab02cb5
Update acl.yml
AnithaAnnem 257b2ec
Update rbac.yml
AnithaAnnem f85c92b
Update server.hcl.j2
AnithaAnnem 12219a1
Update consul-readme.md
AnithaAnnem 2723bcd
Update rbac.yml
AnithaAnnem b74d31e
Update rbac.yml
AnithaAnnem 38ad655
Update server.hcl.j2
AnithaAnnem 463d425
Rename consul-readme.md to Readme.md
AnithaAnnem 45fba5e
Update main.yml
AnithaAnnem 4dd9078
Update acl_tokens.yml
AnithaAnnem bf19715
Create backup.yml
AnithaAnnem 38dc798
Update main.yml
AnithaAnnem 84fa78d
Update main.yml
AnithaAnnem 2028602
Update backup.yml
AnithaAnnem 10a81e2
Update backup.yml
AnithaAnnem 886d9c2
Update main.yml
AnithaAnnem fe66150
Update backup.yml
AnithaAnnem 8f4f8f5
Create consul-backup-config.yml.j2
AnithaAnnem 8fb7520
Update backup.yml
AnithaAnnem 3707dd7
Update consul-backup-config.yml.j2
AnithaAnnem e452dd1
Delete templates/consul-backup-config.yml.j2
AnithaAnnem adcf8ba
Update backup.yml
AnithaAnnem 6b81786
Update backup.yml
AnithaAnnem 2ff2fd9
Update backup.yml
AnithaAnnem d1b78e9
Update backup.yml
AnithaAnnem 86134b3
Update backup.yml
AnithaAnnem ca916af
Update backup.yml
AnithaAnnem a8b6d6b
Update main.yml
AnithaAnnem 6548b60
Update main.yml
AnithaAnnem f8d211b
Update main.yml
AnithaAnnem f97f569
Update main.yml
AnithaAnnem 899a529
Update backup.yml
AnithaAnnem fee2997
Update main.yml
AnithaAnnem b2d3cd4
Update backup.yml
AnithaAnnem 6b91d27
Update backup.yml
AnithaAnnem 810ea8b
Update main.yml
AnithaAnnem 56f9c80
Update backup.yml
AnithaAnnem 0748de7
Update main.yml
AnithaAnnem bd32edd
Update backup.yml
AnithaAnnem dec580d
Update main.yml
AnithaAnnem b7d0ceb
Update main.yml
AnithaAnnem b7f5128
Update main.yml
AnithaAnnem bc2ffc7
Update server.hcl.j2
AnithaAnnem 4f64c8f
Create oidc.yml
AnithaAnnem 1a74a3e
Update main.yml
AnithaAnnem e813129
Update oidc.yml
AnithaAnnem 058c96d
Update oidc.yml
AnithaAnnem 4f02f02
Update oidc.yml
AnithaAnnem d90db28
Update oidc.yml
AnithaAnnem fdbcb37
Update main.yml
AnithaAnnem 3e188f0
Update main.yml
AnithaAnnem 173ce96
Update oidc.yml
AnithaAnnem c34bd6c
Update oidc.yml
AnithaAnnem 7c6da86
Update oidc.yml
AnithaAnnem e3c58d3
Update main.yml
AnithaAnnem afd63a0
Update main.yml
AnithaAnnem 7b169db
Update main.yml
AnithaAnnem adb9598
Update oidc.yml
AnithaAnnem 5eb89bb
Update main.yml
AnithaAnnem 5bc9d62
Update oidc.yml
AnithaAnnem 23a4aa5
Update oidc.yml
AnithaAnnem 8f6c619
Update main.yml
AnithaAnnem b66f63a
Update main.yml
AnithaAnnem 2a51997
Update main.yml
AnithaAnnem bb64cdb
Update oidc.yml
AnithaAnnem 4138694
Update oidc.yml
AnithaAnnem 7a6c67e
Update oidc.yml
AnithaAnnem 85bb84a
Update oidc.yml
AnithaAnnem 540118d
Update oidc.yml
AnithaAnnem 07f63ff
Update oidc.yml
AnithaAnnem 354189f
Update main.yml
AnithaAnnem 201e606
Update main.yml
AnithaAnnem 9abb709
Update oidc.yml
AnithaAnnem bce53f9
Update oidc.yml
AnithaAnnem d4ea5c6
Update oidc.yml
AnithaAnnem 68eccde
Update oidc.yml
AnithaAnnem 5245ff7
Update oidc.yml
AnithaAnnem 7b0a663
Update oidc.yml
AnithaAnnem 08ffd3b
Update oidc.yml
AnithaAnnem 4c00e3e
Update oidc.yml
AnithaAnnem 5e77c61
Update oidc.yml
AnithaAnnem 7db952f
Update oidc.yml
AnithaAnnem efb83b6
Update oidc.yml
AnithaAnnem de4e2df
Update oidc.yml
AnithaAnnem 3607974
Update oidc.yml
AnithaAnnem 6b93973
Update oidc.yml
AnithaAnnem e719725
Update main.yml
AnithaAnnem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,357 @@ | ||
|
|
||
| # Consul Ansible Role | ||
|
|
||
| <img width="413" height="122" alt="image" src="https://github.com/user-attachments/assets/c650148d-68c8-46cf-899c-f5966bafdfa3" /> | ||
|
|
||
|
|
||
| ## Table of Contents | ||
|
|
||
| 1. [Overview](#1-overview) | ||
| 2. [Supported Operating Systems](#2-supported-operating-systems) | ||
| 3. [Prerequisites & Known Limitations](#3-prerequisites--known-limitations) | ||
| 4. [Architecture & Core Components](#4-architecture--core-components) | ||
| 5. [Configuration Overview](#5-configuration-overview) | ||
| 6. [Installation Flow](#6-installation-flow) | ||
| 7. [Running Consul](#7-running-consul) | ||
| 8. [Validation & Testing](#8-validation--testing) | ||
| 9. [Best Practices Followed](#9-best-practices-followed) | ||
| 10. [Troubleshooting](#10-troubleshooting) | ||
| 11. [Conclusion](#11-conclusion) | ||
| 12. [References](#12-references) | ||
| 13. [Author](#13-author) | ||
|
|
||
| ## 1. Overview | ||
|
|
||
| **HashiCorp Consul** is a service networking platform that enables: | ||
|
|
||
| - Service Discovery | ||
| - Service Mesh | ||
| - Health Checking | ||
| - Key-Value Storage | ||
| - Secure Service-to-Service Communication | ||
|
|
||
| It is widely used in distributed systems and microservices architectures to provide dynamic infrastructure management. | ||
|
|
||
| ### Problems Consul Solves | ||
|
|
||
| - How do services find each other? | ||
| - How do we secure service communication? | ||
| - How do we monitor service health? | ||
| - How do we manage configuration centrally? | ||
|
|
||
| ### Supported Environments | ||
|
|
||
| Consul works across: | ||
|
|
||
| - Virtual Machines | ||
| - Kubernetes | ||
| - Hybrid environments | ||
| - Multi-cloud deployments | ||
|
|
||
| --- | ||
|
|
||
| ## 2. Supported Operating Systems | ||
|
|
||
| Consul supports multiple operating systems: | ||
|
|
||
| ### Linux | ||
| - Ubuntu | ||
| - Debian | ||
| - RHEL | ||
| - CentOS | ||
| - Amazon Linux | ||
|
|
||
| ### Other Platforms | ||
| - Windows | ||
| - macOS | ||
| - Kubernetes environments | ||
| - Cloud platforms: | ||
| - AWS | ||
| - Azure | ||
| - GCP | ||
|
|
||
| > Consul is written in **Go** and distributed as a single binary. | ||
|
|
||
| --- | ||
|
|
||
| ## 3. Prerequisites & Known Limitations | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Network connectivity between cluster nodes | ||
| - Minimum **3 nodes** for production cluster (recommended) | ||
| - Proper firewall configuration (ports **8300–8600**) | ||
| - Stable DNS or IP addressing | ||
| - TLS certificates (for secure production environments) | ||
|
|
||
| ### Known Limitations | ||
|
|
||
| - Requires quorum for leader election | ||
| - Performance depends on cluster size and network latency | ||
| - Misconfigured ACLs can block cluster operations | ||
| - Not a replacement for full configuration management tools | ||
|
|
||
| --- | ||
|
|
||
| ## 4. Architecture & Core Components | ||
|
|
||
| Consul architecture consists of the following components: | ||
|
|
||
| ### 4.1 Servers | ||
|
|
||
| - Maintain cluster state | ||
| - Participate in **Raft consensus** | ||
| - Handle leader election | ||
|
|
||
| ### 4.2 Clients (Agents) | ||
|
|
||
| - Run on application nodes | ||
| - Register services | ||
| - Perform health checks | ||
|
|
||
| ### 4.3 Datacenter | ||
|
|
||
| - Logical grouping of nodes in a specific environment | ||
|
|
||
| ### 4.4 Gossip Protocol | ||
|
|
||
| - Used for node membership | ||
| - Handles failure detection | ||
|
|
||
| ### 4.5 Raft Consensus | ||
|
|
||
| - Provides strong consistency | ||
| - Manages leader election among servers | ||
|
|
||
| ### 4.6 Key-Value Store | ||
|
|
||
| - Stores configuration data centrally | ||
| - Used for dynamic application configuration | ||
|
|
||
| ### 4.7 Service Mesh (Connect) | ||
|
|
||
| - Provides secure service-to-service communication | ||
| - Uses **mTLS (Mutual TLS)** | ||
| - Enables zero-trust networking between services | ||
|
|
||
| --- | ||
|
|
||
|
|
||
|
|
||
| ## Role Structure | ||
| ``` | ||
| . | ||
| ├── inventory.ini | ||
| ├── site.yml | ||
| └── roles/ | ||
| └── consul/ | ||
| ├── defaults/ | ||
| │ └── main.yml | ||
| ├── files/ | ||
| │ └── read-policy.hcl | ||
| ├── handlers/ | ||
| │ └── main.yml | ||
| ├── meta/ | ||
| │ └── main.yml | ||
| ├── tasks/ | ||
| │ ├── acl.yml | ||
| │ ├── acl_policies.yml | ||
| │ ├── acl_tokens.yml | ||
| │ ├── config.yml | ||
| │ ├── directories.yml | ||
| │ ├── install.yml | ||
| │ ├── main.yml | ||
| │ ├── rbac.yml | ||
| │ └── service.yml | ||
| ├── templates/ | ||
| │ ├── consul.service.j2 | ||
| │ ├── prometheus-consul.yml.j2 | ||
| │ ├── server.hcl.j2 | ||
| │ └── policies/ | ||
| │ ├── agent-policy.hcl.j2 | ||
| │ ├── monitoring-policy.hcl.j2 | ||
| │ ├── readonly-policy.hcl.j2 | ||
| │ └── service-policy.hcl.j2 | ||
| ├── tests/ | ||
| │ └── test.yml | ||
| └── vars/ | ||
| └── main.yml | ||
| ``` | ||
|
|
||
| ## 5. Configuration Overview | ||
|
|
||
| Consul can be configured using: | ||
|
|
||
| - HCL files | ||
| - JSON configuration files | ||
| - Command-line flags | ||
| - Environment variables | ||
|
|
||
| ### Important Configuration Parameters | ||
|
|
||
| | Parameter | Description | | ||
| |-------------------|------------| | ||
| | `node_name` | Unique node identifier | | ||
| | `bind_addr` | Address to bind Consul to | | ||
| | `data_dir` | Directory for Consul data | | ||
| | `server` | Defines server or client mode (`true/false`) | | ||
| | `bootstrap_expect` | Number of servers expected for cluster formation | | ||
| | `retry_join` | List of nodes to join cluster | | ||
| | `acl` | Enables Access Control Lists | | ||
| | `ui_config` | UI configuration settings | | ||
|
|
||
| ### ACL Configuration Includes | ||
|
|
||
| - Enable/Disable ACLs | ||
| - Default policies | ||
| - Token management | ||
| - Token persistence | ||
|
|
||
| --- | ||
|
|
||
| ## 6. Installation Flow | ||
| ### Step 1: Download Binary | ||
| ``` | ||
| wget https://releases.hashicorp.com/consul/1.17.0/consul_1.17.0_linux_amd64.zip | ||
| ``` | ||
|
|
||
| ### Step 2: Unzip | ||
| ``` | ||
| unzip consul_1.17.0_linux_amd64.zip | ||
| ``` | ||
|
|
||
| ### Step 3: Move Binary | ||
| ``` | ||
| sudo mv consul /usr/local/bin/ | ||
| ``` | ||
|
|
||
| ### Step 4: Verify Installation | ||
| ``` | ||
| consul --version | ||
| ``` | ||
|
|
||
| ## 7. Running the Playbook | ||
| ``` | ||
| ansible-playbook -i inventory.ini site.yml | ||
| ``` | ||
|
|
||
| ## 8. Validation & Testing | ||
| ## Check Cluster Members | ||
| ``` | ||
| consul members | ||
| ``` | ||
| ## Check Leader | ||
| ``` | ||
| consul operator raft list-peers | ||
| ``` | ||
| ## Check Services | ||
| ``` | ||
| consul catalog services | ||
| ``` | ||
| ## Access UI | ||
|
|
||
| Default UI URL: | ||
|
|
||
| ``` | ||
| http://<server-ip>:8500 | ||
| ``` | ||
|
|
||
| ## Vault Usage (IMPORTANT) | ||
|
|
||
| Sensitive values like: | ||
|
|
||
| - consul_master_token | ||
|
|
||
| - consul_gossip_key | ||
|
|
||
| are stored using Ansible Vault. | ||
|
|
||
| ### To Run Playbook: | ||
| ``` | ||
| ansible-playbook -i inventory.ini site.yml --ask-vault-pass | ||
| ``` | ||
|
|
||
| ### OR using password file: | ||
| ``` | ||
| ansible-playbook -i inventory.ini site.yml --vault-password-file vault_pass.txt | ||
| ``` | ||
|
|
||
| ## 9. Best Practices Followed | ||
|
|
||
| - Always use minimum 3 server nodes | ||
|
|
||
| - Enable ACLs in production | ||
|
|
||
| - Use TLS encryption | ||
|
|
||
| - Avoid running in -dev mode in production | ||
|
|
||
| - Monitor health checks continuously | ||
|
|
||
| - Secure gossip communication | ||
|
|
||
| - Use proper token management | ||
|
|
||
| # 10. Troubleshooting | ||
| ## Consul Not Starting | ||
|
|
||
| - Check systemd logs | ||
|
|
||
| ``` | ||
| journalctl -u consul | ||
| ``` | ||
| ## No Leader Elected | ||
|
|
||
| - Ensure minimum quorum | ||
|
|
||
| - Verify bootstrap_expect value | ||
|
|
||
| - Check network connectivity | ||
|
|
||
| ## ACL Errors | ||
|
|
||
| - Verify bootstrap token | ||
|
|
||
| - Ensure token persistence is enabled | ||
|
|
||
| - Check default policy | ||
|
|
||
| ## Node Not Joining | ||
|
|
||
| - Verify retry_join | ||
|
|
||
| - Check firewall ports | ||
|
|
||
| - Validate bind address | ||
|
|
||
| # 11. Conclusion | ||
|
|
||
| HashiCorp Consul is a powerful service networking solution designed for modern distributed systems. | ||
|
|
||
| It provides: | ||
|
|
||
| - Reliable service discovery | ||
|
|
||
| - Secure service communication | ||
|
|
||
| - Centralized configuration | ||
|
|
||
| - High availability clustering | ||
|
|
||
| Consul simplifies infrastructure complexity and enables scalable microservices architecture. | ||
|
|
||
| # 12. References | ||
|
|
||
|
|
||
| | Purpose | Link | | ||
| |---------|------| | ||
| | Consul Official Documentation | https://developer.hashicorp.com/consul/docs | | ||
| | Consul Installation Guide | https://developer.hashicorp.com/consul/docs/install | | ||
| | Consul ACL Documentation | https://developer.hashicorp.com/consul/docs/security/acl | | ||
| | Consul Service Mesh Guide | https://developer.hashicorp.com/consul/docs/connect | | ||
|
|
||
| # 13. Author | ||
|
|
||
| **Author**: Annem Anitha | ||
| **Last Updated:** 25-Feb-2026 | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File name should be Readme.md instead of consul-readme.md