dokku / ansible-dokku

Ansible modules for installing and configuring Dokku
MIT License
169 stars 44 forks source link

Request: --alias support for dokku_service_link #68

Open jbothma opened 4 years ago

jbothma commented 4 years ago

Description of problem

The service support is awesome, thanks!

The --alias argument to link is awesome to that apps don't need to have dokku-specific environment variable names.

It would be great to be able to specify the alias to the dokku_service_link task e.g.

- name: App is linked to rabbitmq instance
  dokku_service_link:
    app: "{{ app_name }}"
    name: "{{ app_name }}"
    service: rabbitmq
    alias: CELERY_BROKER_URL

would effectively be

dokku redis:link writeinpublic writeinpublic --alias CELERY_BROKER_URL
nerg4l commented 3 years ago

Can I suggest a more generic approach for link-flags? Something like the following:

- name: App is linked to rabbitmq instance
  dokku_service_link:
    app: "{{ app_name }}"
    name: "{{ app_name }}"
    service: rabbitmq
    flags:
      alias: CELERY_BROKER_URL
      querystring "pool=5"

Which would be executed as:

dokku redis:link writeinpublic writeinpublic --alias "CELERY_BROKER_URL" --querystring "pool=5"

This would allow any custom flag for third party plugins and might make the feature a bit more future proof.