Support deleting vhosts

This commit is contained in:
uumas
2024-07-28 00:45:20 +03:00
parent 9a94786bec
commit 1dbb9eac4c
3 changed files with 18 additions and 5 deletions

View File

@@ -8,16 +8,25 @@ argument_specs:
description: A unique identifier for this vhost. Not visible to end users.
type: str
required: true
vhost_state:
description: Whether the vhost should exist or not
type: str
required: false
default: present
choices:
- present
- absent
vhost_type:
type: str
required: true
required: "{{ vhost_state == 'present' }}"
choices:
- reverse_proxy
- redirect
- respond
- absent
vhost_domains:
type: list
required: true
required: "{{ vhost_state == 'present' }}"
elements: str
web_server:
description: Defines which server software to use for vhost. This role does nothing if set to none
@@ -47,7 +56,7 @@ argument_specs:
proxy_target_port:
description: Port where to proxy requests to. Only applicable if vhost_type is reverse_proxy
type: int
required: "{{ vhost_type == 'reverse_proxy' }}"
required: "{{ vhost_state == 'present' and vhost_type == 'reverse_proxy' }}"
proxy_target_host:
description: Host where to proxy requests to. Only applicable if vhost_type is reverse_proxy
type: str
@@ -65,7 +74,7 @@ argument_specs:
redirect_target:
description: "Only applicable if vhost_type is redirect. Example: https://www.domain.tld/location"
type: str
required: "{{ vhost_type == 'redirect' }}"
required: "{{ vhost_state == 'present' and vhost_type == 'redirect' }}"
redirect_preserve_path:
description: Whether to keep the original request path
type: bool
@@ -83,7 +92,7 @@ argument_specs:
respond_content:
description: Content to respond with. Json content can be set as yaml as long as respond_content_type is set to json
type: str
required: "{{ vhost_type == 'respond' }}"
required: "{{ vhost_state == 'present' and vhost_type == 'respond' }}"
respond_content_type:
description: Type of the respond content
type: str