Consul template vault pki

Hi All hoping someone figured out before , trying to insert hostname as variable in issuing certificate but getting : idna: invalid label “.exampledomain” (retry attempt 8 after “32s”)
consul template as below:

{{ $host := printf “common_name=%s.exampledomain” (env “attr.unique.hostname”) }}
{{ with secret “pki_int/issue/domain-role” “ttl=2m” $host }}
{{ .Data.certificate }}
{{ .Data.issuing_ca }}{{ end }}