maxhoesel.caddy.caddy_config_info (1.1.0) — module

Get the current Caddy configuration for a given path

| "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

Returns the currently running configuration for any given path


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get config for an HTTP server
  maxhoesel.caddy.caddy_config_info:
    path: apps/http/servers/myserver
  register: myserver_cfg
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug:
    msg: "{{ myserver_cfg.config }}"

Inputs

    
path:
    aliases:
    - name
    description: 'Path from which the configuration content will be read. Note that C(config/)
      is automatically appended. Example: "apps/http/servers/myservice"

      '
    required: true
    type: path

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

Outputs

config:
  description: Configuration at the requested path as a mapping/list
  returned: success
  type: dict