An Ansible role to deploy and configure HashiCorp Vault.
This role does not have any additional requirements.
- Name of system user to add that Vault will run as.
- Comment/GECOS string of the Vault user.
- Folder to place the Vault binary and configuration file.
vault_download_fullurl
: "{{ vault_download_url }}/{{ vault_version }}/vault_{{ vault_version }}_linux_amd64.zip"
- Full URL that Vault will be downloaded from.
- Override this variable if you would like to download the Vault zipfile from a custom source.
- Version of Vault to install.
- Used to construct
vault_download_fullurl
. - Used in the systemd service file.
vault_download_baseurl
: https://releases.hashicorp.com/vault/
- Website and path to download Vault from.
- Only used to construct
vault_download_fullurl
.
- Where to create a symbolic link to the Vault binary. Should be in the $PATH.
- Where to place the Vault systemd service file.
These variables are used to generate the Vault configuration file. Check out the Vault documentation for more information.
- The name of the Vault cluster. By default this is unset, and Vault will automatically generate a cluster name. Set this variable if you want a custom cluster name.
- Whether the HTTP UI should be enabled.
- Whether to set up high availability for Vault. Should only be true if using Consul as the storage backend.
- The address that will be advertised to other Vault servers in the cluster for
client redirection. Only used when
vault_ha
is set to true.
- The address that will be advertised to other Vault servers in the cluster for
request forwarding. Only used when
vault_ha
is set to true.
- Whether cluster features like request forwarding are enabled. Only used when
vault_ha
is set to true.
These variables are used to configure the TCP listener in the Vault configuration file. Only one listener is currently supported. Check out the Vault documentation for more information.
- The address to listen on for client connections.
- The address to listen on for connections from servers in the cluster.
- Whether to listen on HTTPS for all connections.
- The path to the certificate that will be used for HTTPS.
- The path to the private key that will be used for HTTPS.
These variables are used to configure the storage backend. The only backends that are currently supported are Consul, Filesystem, and In-Memory. Check out the Vault documentation for more information on each storage backend.
- Which storage backend to use.
- The following values are supported:
- "consul": uses the Consul backend
- "file": uses the Filesystem backend
- "inmem": uses the In-Memory backend
- The path on the filesystem to which Vault will store data.
- A new directory named
vault/
will be created under this path. - Only used when
vault_storage_backend
is set to "file".
- The address of the Consul agent to communicate with.
- Only used when
vault_storage_backend
is set to "consul".
- Whether Vault should register itself with Consul.
- Only used when
vault_storage_backend
is set to "consul".
- The path in Consul's key-vaul store where Vault data will be stored.
- Only used when
vault_storage_backend
is set to "consul".
- The scheme to use when communicating with Consul. Supported values are "http" and "https".
- Only used when
vault_storage_backend
is set to "consul".
- The name of the service to register in Consul.
- Only used when
vault_storage_backend
is set to "consul".
- A comma-separated list of tags to attach to the service registration in Consul.
- Only used when
vault_storage_backend
is set to "consul".
- A Consul ACL token with read/write permissions to the path specified in
vault_consul_path
. - Only used when
vault_storage_backend
is set to "consul".
- The CA certificate used for Consul communication. Only used when the Consul scheme is https.
- Only used when
vault_storage_backend
is set to "consul".
- The certificate used for Consul communication. Only used when the Consul scheme is https.
- Only used when
vault_storage_backend
is set to "consul".
- The private key used for Consul communication. Only used when the Consul scheme is https.
- Only used when
vault_storage_backend
is set to "consul".
- The minimum TLS version to be used for Consul communication. Only used when the Consul scheme is https.
- Only used when
vault_storage_backend
is set to "consul".
This role does not depend on any other roles.
- hosts: all
become: true
vars:
vault_ui: "true"
vault_tcp_address: "0.0.0.0:8200"
vault_tcp_tls_disable: "true"
vault_filesystem_path: "/tmp"
roles:
- vault
BSD
Author: RITSEC Operations Program