maxhoesel.caddy.caddy_load module – Load a new configuration into Caddy
Note
This module is part of the maxhoesel.caddy collection (version 1.1.0).
To install it, use: ansible-galaxy collection install maxhoesel.caddy.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: maxhoesel.caddy.caddy_load.
New in maxhoesel.caddy 0.1.0
Synopsis
This module pushes a caddy configuration to the server via the
/loadAPI endpoint. If no change between the currently running and future configuration is found, no changes will be made.
Requirements
The below requirements are needed on the host that executes this module.
requestsmust be installed on the host executing the query
Parameters
Parameter |
Comments |
|---|---|
Address of the caddy API endpoint Default: |
|
Configuration for caddy. Needs to be a mapping corresponding to the API JSON format. |
|
By default, this module only pushes configurations if changes have been made compared to the currently running config. Set 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 Choices:
|
Notes
Note
Check mode is supported.
Examples
- name: Load Caddy config
maxhoesel.caddy.caddy_load:
content:
apps:
http:
servers:
example:
listen:
- ":80"
routes:
- handle:
- handler: "static_response"
body: "Hello, world!"