Skip to content

Config files don't support environment variables #268

Open
@mdtomo

Description

@mdtomo

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions