consul
consul
This role installs consul as either a server or a client in AWS.
Requirements
None.
Role Variables
Default
For most people, the default variables that are set should be fine, but there are use cases for changing them. They are:
consul_group: # Default group name (consul)
consul_gid: # Default gid (10010)
consul_user: # Default username (consul)
consul_uid: # Default uid (10010)
consul_version: # Default consul version (1.2.2)
consul_start: # Start Service by Default (True)
Playbook Variables
Within your playbook, you should set the following variables:
consul_role: # Set to client or server
consul_datacenter: # name for the cluster
consul_encryptkey: # key generated by consul keygen
consul_cert: # SSL Certificate for the cluster
consul_key: # SSL Key for the cluster
ca_cert: # Intermediate SSL Cert for the cluster
Dependencies
This role is written to run in AWS using the AWS provider for the retry_join configuration parameter using the role: consul parameter.
"retry_join": ["provider=aws tag_key=role tag_value=consul"]
If you want to run it outside of AWS, you will need to update the retry_join value to use a different method.
Example Playbook
You should define the required variables in your playbook and call the role:
- name: Converge
hosts: all
vars:
consul_role: server
consul_datacenter: "us-east-1"
consul_encryptkey: "YKbtX0Gc3mnJ7QwaNwNYtg=="
consul_cert: |
-----BEGIN CERTIFICATE-----
MIID0DCCArigAwIBAgIBCjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJVUzEO
MAwGA1UECAwFVGV4YXMxDzANBgNVBAcMBkF1c3RpbjEbMBkGA1UECgwSTWFjbWls
bGFuIExlYXJuaW5nMRcwFQYDVQQLDA5Db25zdWwgQ0EgQ2VydDAeFw0xNzEwMDUw
MjE3MjZaFw0xODEwMDUwMjE3MjZaMGkxHzAdBgNVBAMMFmNvbnN1bC5tYWNtaWxs
YW4uY2xvdWQxDjAMBgNVBAgMBVRleGFzMQswCQYDVQQGEwJVUzEbMBkGA1UECgwS
TWFjbWlsbGFuIExlYXJuaW5nMQwwCgYDVQQLDANTUkUwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDHa1FiN4520HHaCO7PyMy+DTJYciDxF7zdtLzujSkB
BKMF2xKyKRZE8QbQjP5zgvOzkGxpFlTaMudAYrNEGJTZctlBqOZxVOi1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Wc
oe0bp/5+d1i7Z/fes20k1kzjI7N3M3RUPf7hI3TV24ljGxHCGaqR/3Ozv0bhmm28
Mr1ScEwBY1BsDkuvGwZlkmU4sjZGrYQwv8DFHExAIQIDAQABMA0GCSqGSIb3DQEB
CwUAA4IBAQB4wyRZSwvs9qgHUb8fl83pSQAnFNg3qffqNN2wBQbNUcCFUtx/XL6d
J0i/AEvBmy9SXnTTSuN4udDkdxpznWtHtagIvC7CA70zRxF0PPdhOCBqInrAX0l3
vFSBXIONfI1wMxdUCkP/A3EZEAIsON0zhVpUhbwaNkiEeuMahG3VFv2VFt/ANE1L
QCulz7aUoUEXfXjDmpidVD/wzqBjUbJc0FEqTniaBDBNaN7bEogNZlRU/vGhZ2O1
KBn9wSWwYRXmLICv7s6GrsYMoOFit4FrXQdj42hzqpGugXbAlOTknV6KZbwptSuG
lEhOBOqUfdiXqUszPbSsRtFpmA+hA0vT
-----END CERTIFICATE-----
roles:
- role: austincloudguru.consul
License
MIT
Author Information
Mark Honomichl aka AustinCloudGuru Created in 2018
Install
ansible-galaxy install AustinCloudGuru/ansible-role-consul
License
mit
Downloads
5893
Owner