maxhoesel.caddy.caddy_config_info module – Get the current Caddy configuration for a given path

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_config_info.

New in maxhoesel.caddy 0.1.0

Synopsis

  • Returns the currently running configuration for any given path

Requirements

The below requirements are needed on the host that executes this module.

  • requests must be installed on the host executing the query

Parameters

Parameter

Comments

caddy_host

string

Address of the caddy API endpoint

Default: "http://localhost:2019"

path

aliases: name

path / required

Path from which the configuration content will be read. Note that config/ is automatically appended. Example: “apps/http/servers/myservice”

Examples

- name: Get config for an HTTP server
  maxhoesel.caddy.caddy_config_info:
    path: apps/http/servers/myserver
  register: myserver_cfg
- debug:
    msg: "{{ myserver_cfg.config }}"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

config

dictionary

Configuration at the requested path as a mapping/list

Returned: success

Authors

  • Max Hösel (@maxhoesel)