Issue Cert

This role issues a new Vault certificate from the configured pki_int role.

Prerequisites

  • An existing Vault instance
  • (Optional) An existing consul-template instance
  • Ansible auth certificate on localhost

Setup

The role issues a new certificate from Vault and writes it to the host's filesystem at a chosen path. The role logins with an existing Ansible auth certificate with limited permissions from its configured policies.

The role also optionally adds a consul-template template stanza to automatically renew the certificate key pair.

Variables

VariableDescriptionTypeDefault
issue_cert_roleCertificate rolestringclient
issue_cert_common_nameCertificate common namestring""
issue_cert_ttlCertificate TTLstring24h
issue_cert_vault_addrVault instance addressstringhttps://localhost:8200
issue_cert_ownerCertificate key pair ownerstring""
issue_cert_groupCertificate key pair groupstring""
issue_cert_pathCertificate pathstringcert.crt
issue_cert_key_pathPrivate key pathstringkey.pem
issue_cert_ca_pathCA pathstringca.crt
issue_cert_auth_roleAuth role to write certificate tostring""
issue_cert_auth_policiesPolicies to add to auth rolestring""
issue_cert_add_templateAdd consul-template templatebooleantrue
issue_cert_consul_template_configconsul-template config file pathstring/etc/consul-template/consul-template.hcl
issue_cert_consul_template_markerconsul-template template markerstring# {mark} TLS
issue_cert_serviceService to restart after consul-template renews certstring""
  • issue_cert_auth_* variables are only used when issue_cert_role = "auth"