maxhoesel.caddy.caddy_load (1.1.0) — module

Load a new configuration into Caddy

| "added in version" 0.1.0 of maxhoesel.caddy"

Authors: Max Hösel (@maxhoesel)

Install collection

Install with ansible-galaxy collection install maxhoesel.caddy:==1.1.0


Add to requirements.yml

  collections:
    - name: maxhoesel.caddy
      version: 1.1.0

Description

This module pushes a caddy configuration to the server via the C(/load) API endpoint. If no change between the currently running and future configuration is found, no changes will be made.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Load Caddy config
  maxhoesel.caddy.caddy_load:
    content:
      apps:
        http:
          servers:
            example:
              listen:
                - ":80"
              routes:
                - handle:
                    - handler: "static_response"
                      body: "Hello, world!"

Inputs

    
force:
    default: false
    description: 'By default, this module only pushes configurations if changes have been
      made compared to the currently running config. Set I(force=True) if you always want
      to push the configuration, even if no changes will be made. Settings this will cause
      the module to always return C(changed=True)

      '
    type: bool

content:
    aliases:
    - config
    - value
    description: Configuration for caddy. Needs to be a mapping corresponding to the API
      JSON format.
    type: raw

caddy_host:
    default: http://localhost:2019
    description: Address of the caddy API endpoint
    type: str