diff --git a/packer/hashibox.pkr.hcl b/packer/hashibox.pkr.hcl index c1c3155..4fd6381 100644 --- a/packer/hashibox.pkr.hcl +++ b/packer/hashibox.pkr.hcl @@ -102,7 +102,11 @@ build { # Provision Nomad and Consul CA's that can be later used for agent cert provisioning. "sudo mkdir /etc/consul.d/certs && cd /etc/consul.d/certs ; sudo consul tls ca create", - "sudo mkdir /etc/nomad.d/certs && cd /etc/nomad.d/certs ; sudo consul tls ca create", + "sudo mkdir /etc/nomad.d/certs && cd /etc/nomad.d/certs ; sudo nomad tls ca create", + + # Set permissions for the certs directory + "sudo chown consul:consul /etc/consul.d/certs", + "sudo chown nomad:nomad /etc/nomad.d/certs" # Enabling of the services is the responsibility of the instance provisioning scripts. "sudo systemctl disable docker consul nomad"