Is there a way to use variables for rancher-nfs driver options?

Is it possible to use variables on the ‘host’ and ‘export’ (rancher-nfs) driver options?

When defined static in docker-compose it works:

volumes:  
 uploads:
    driver: rancher-nfs
    driver_opts:
        host: gimli.thuis.breekeenbeen.nl
        export: /volume2/uploads

If I try it with variables:

volumes:
  uploads:
    external: false
    driver: ${uploads-storage_driver}
    driver_opts:
        host: ${uploads-host}
        export: ${uploads-folder}

I get this error in the UI: Error (yaml: line 9: found character that cannot start any token)

Thanks in advance.

I don’t have the answer, but have you tried with % which is the way to call variable in yaml ?
For example: %{uploads-folder}

Unfortunately this doesn’t work.

Seems that $ is the correct character for Rancher, since with the % sign it already goes wrong on the driver: ${uploads-storage_driver} line, with the $ on the host: ${uploads-host} line.

OK noted. At least we tried :slight_smile:
By our side, we do replacement by coding in NodeJS before calling Rancher API.