dataplaneapi icon indicating copy to clipboard operation
dataplaneapi copied to clipboard

Config files don't support environment variables

Open mdtomo opened this issue 3 years ago • 1 comments

I've tried adding environment variables to my config but it appears they aren't parsed. Example below for a sample yml config. The environment variables work correctly in haproxy.cfg as I tested this by putting the value for $PASSWORD directly into thedataplaneapi.yml config. I tried this with the hcl config type declaring a variable block but parsing failed on the line where type is declared.

variable "password" {
  type = string
}

Throws error unknown token: 6:10 IDENT string

dataplaneapi.yml

name: famous_condor
dataplaneapi:
  host: 0.0.0.0
  port: 8080
  user:
  - name: admin
    insecure: true
    password: ${PASSWORD}
  resources:
    maps_dir: /etc/haproxy/maps
    ssl_certs_dir: /etc/haproxy/ssl
    spoe_dir: /etc/haproxy/spoe
haproxy:
  config_file: /etc/haproxy/haproxy.cfg
  haproxy_bin: /usr/local/sbin/haproxy
  reload:
    reload_cmd: kill -SIGUSR2 1
    restart_cmd: kill -SIGUSR2 1

haproxy.cfg

userlist proxy-userlist
    user admin insecure-password "$PASSWORD"

I'm assuming environment variables in dataplane api config files aren't currently supported?

mdtomo avatar Sep 18 '22 03:09 mdtomo

Currently we are not supporting env variables in the config files. We can put that as a feature request.

mjuraga avatar Nov 28 '22 17:11 mjuraga