dokku / ansible-dokku

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

dokku_config: allow config:set --global #52

Open decentral1se opened 4 years ago

decentral1se commented 4 years ago
dokku config:set --global DOKKU_LETSENCRYPT_EMAIL=your@email.tld

AFAICT, it isn't possible now and only scoped to an app?

Up for accepting a PR to allow for global config setting?

Very useful for initial provisioning of a host when letsencrypt is installed also.

decentral1se commented 4 years ago

API could be:

- name: set LE global email
  dokku_config:
    global: True
    config:
      DOKKU_LETSENCRYPT_EMAIL: your@email.tld
josegonzalez commented 4 years ago

Partial PR here: https://github.com/dokku/ansible-dokku/pull/51

But an alternate implementation is always welcome.

nerg4l commented 4 years ago

By looking at the linked PR and the code it seems it is doable at the moment by setting --global for the app name. It is a dirty hack but should work until a proper implementation.

- name: set LE global email
  dokku_config:
    app: '--global'
    config:
      DOKKU_LETSENCRYPT_EMAIL: your@email.tld
iloveitaly commented 1 year ago

Worth noting that DOKKU_LETSENCRYPT_EMAIL doesn't work anymore, you'll need to do something like

    - name: set letsencrypt email and request certificate
      block:
        - name: Your pre-task (dependency for dokku_letsencrypt)
          ansible.builtin.shell: dokku letsencrypt:set app email email@domain

        - name: letsencrypt
          dokku_letsencrypt:
            app: *appname

Would be great if we could add an email param to dokku_letsencrypt!