Skip to content

Latest commit

 

History

History
117 lines (89 loc) · 3.52 KB

File metadata and controls

117 lines (89 loc) · 3.52 KB

dokku_certs

Synopsis

Manages SSL certificates for a dokku app or globally.

Requirements

  • dokku-global-cert plugin (required only when global: true)

Export support

Partial - app and global certificate PEM material is exported (via certs:show and global-cert:show) and written to the companion vars-file.

Probe support

Partial - only whether a certificate is installed is probed; the certificate material is never read back, so replacing an existing certificate plans as in sync.

Identity

Keyed by app and global. Fields left empty are omitted from the address.

Parameters

Parameter Type Required Default Choices Description
app string no Name of the app. Required if Global is false.
global bool no Flag indicating if the certificate should be applied globally via the dokku-global-cert plugin
cert string no Path on the dokku server to the SSL certificate file. Mutually exclusive with cert_content. (sensitive)
key string no Path on the dokku server to the SSL certificate key file. Mutually exclusive with key_content. (sensitive)
cert_content string no PEM-encoded certificate contents. Mutually exclusive with cert. (sensitive)
key_content string no PEM-encoded private key contents. Mutually exclusive with key. (sensitive)
state string no present present, absent Desired state of the SSL configuration

Examples

Add an SSL certificate to an app

dokku_certs:
    app: node-js-app
    cert: /etc/nginx/ssl/node-js-app.crt
    key: /etc/nginx/ssl/node-js-app.key

Remove an SSL certificate from an app

dokku_certs:
    app: node-js-app
    state: absent

Add a global SSL certificate (requires the dokku-global-cert plugin)

dokku_certs:
    app: ""
    global: true
    cert: /etc/nginx/ssl/global.crt
    key: /etc/nginx/ssl/global.key

Remove the global SSL certificate

dokku_certs:
    app: ""
    global: true
    state: absent

Add an SSL certificate to an app from inline PEM

dokku_certs:
    app: node-js-app
    cert_content: |
        -----BEGIN CERTIFICATE-----
        ...
        -----END CERTIFICATE-----
    key_content: |
        -----BEGIN PRIVATE KEY-----
        ...
        -----END PRIVATE KEY-----

Add a global SSL certificate from inline PEM (requires the dokku-global-cert plugin)

dokku_certs:
    app: ""
    global: true
    cert_content: |
        -----BEGIN CERTIFICATE-----
        ...
        -----END CERTIFICATE-----
    key_content: |
        -----BEGIN PRIVATE KEY-----
        ...
        -----END PRIVATE KEY-----

Return Values

Available after the task runs when captured with register:, referenced as result.<Key> (or registered.<name>.<Key>).

Key Returned Type Description
Changed always bool Whether the task changed server state.
State always string Resulting state of the resource.
DesiredState always string The state the task targeted.
Message always string Human-readable result message (may be empty).
Commands when a subprocess ran list Resolved dokku command lines executed.
Stdout when a subprocess ran string Captured stdout of the final command.
Stderr when a subprocess ran string Captured stderr of the final command.
ExitCode when a subprocess ran int Exit code of the final command.