vhost: Prefix variables with role name
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
---
|
||||
|
||||
argument_specs:
|
||||
main:
|
||||
short_description: Sets up a vhost
|
||||
description:
|
||||
- Sets up a vhost on a web server.
|
||||
- Supports reverse proxies, redirects and simple resonses.
|
||||
- Currently only supports caddy.
|
||||
options:
|
||||
vhost_id:
|
||||
description: A unique identifier for this vhost. Not visible to end users.
|
||||
@@ -28,8 +31,8 @@ argument_specs:
|
||||
type: list
|
||||
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
|
||||
vhost_web_server:
|
||||
description: Defines which server software to use for vhost. This role does nothing if set to none.
|
||||
type: str
|
||||
required: false
|
||||
default: caddy
|
||||
@@ -59,16 +62,16 @@ argument_specs:
|
||||
required: false
|
||||
default: {}
|
||||
|
||||
proxy_target_port:
|
||||
vhost_proxy_target_port:
|
||||
description: Port where to proxy requests to. Only applicable if vhost_type is reverse_proxy
|
||||
type: int
|
||||
required: "{{ vhost_state == 'present' and vhost_type == 'reverse_proxy' }}"
|
||||
proxy_target_host:
|
||||
vhost_proxy_target_host:
|
||||
description: Host where to proxy requests to. Only applicable if vhost_type is reverse_proxy
|
||||
type: str
|
||||
required: false
|
||||
default: localhost
|
||||
proxy_target_protocol:
|
||||
vhost_proxy_target_protocol:
|
||||
description: Protocol to use for proxy requests. Only applicable if vhost_type is reverse_proxy
|
||||
type: str
|
||||
required: false
|
||||
@@ -76,18 +79,18 @@ argument_specs:
|
||||
choices:
|
||||
- http
|
||||
- https
|
||||
proxy_delete_headers:
|
||||
vhost_proxy_delete_headers:
|
||||
description: List of headers to delete from proxied requests
|
||||
type: list
|
||||
elements: str
|
||||
required: false
|
||||
default: []
|
||||
|
||||
redirect_target:
|
||||
vhost_redirect_target:
|
||||
description: "Only applicable if vhost_type is redirect. Example: https://www.domain.tld/location"
|
||||
type: str
|
||||
required: "{{ vhost_state == 'present' and vhost_type == 'redirect' }}"
|
||||
redirect_preserve_path:
|
||||
vhost_redirect_preserve_path:
|
||||
description: Whether to keep the original request path
|
||||
type: bool
|
||||
required: false
|
||||
@@ -101,11 +104,11 @@ argument_specs:
|
||||
- temporary
|
||||
- permanent
|
||||
|
||||
respond_content:
|
||||
description: Content to respond with. Json content can be set as yaml as long as respond_content_type is set to json
|
||||
vhost_respond_content:
|
||||
description: Content to respond with. Json content can be set as yaml as long as vhost_respond_content_type is set to json
|
||||
type: str
|
||||
required: "{{ vhost_state == 'present' and vhost_type == 'respond' }}"
|
||||
respond_content_type:
|
||||
vhost_respond_content_type:
|
||||
description: Type of the respond content
|
||||
type: str
|
||||
required: false
|
||||
@@ -159,17 +162,17 @@ argument_specs:
|
||||
description: Port where to proxy requests to. Only applicable if type is reverse_proxy.
|
||||
type: int
|
||||
required: false
|
||||
default: "{{ proxy_target_port if vhost_type == 'reverse_proxy' else 0 }}"
|
||||
default: "{{ vhost_proxy_target_port if vhost_type == 'reverse_proxy' else 0 }}"
|
||||
proxy_target_host:
|
||||
description: Host where to proxy requests to. Only applicable if type is reverse_proxy
|
||||
type: str
|
||||
required: false
|
||||
default: "{{ proxy_target_host }}"
|
||||
default: "{{ vhost_proxy_target_host }}"
|
||||
proxy_target_protocol:
|
||||
description: Protocol to use for proxy requests. Only applicable if type is reverse_proxy
|
||||
type: str
|
||||
required: false
|
||||
default: "{{ proxy_target_protocol }}"
|
||||
default: "{{ vhost_proxy_target_protocol }}"
|
||||
choices:
|
||||
- http
|
||||
- https
|
||||
@@ -178,23 +181,23 @@ argument_specs:
|
||||
type: list
|
||||
elements: str
|
||||
required: false
|
||||
default: "{{ proxy_delete_headers }}"
|
||||
default: "{{ vhost_proxy_delete_headers }}"
|
||||
|
||||
redirect_target:
|
||||
description: "Only applicable if vhost_type is redirect. Example: https://www.domain.tld/location"
|
||||
type: str
|
||||
required: false
|
||||
default: "{{ redirect_target if vhost_type == 'redirect' else '' }}"
|
||||
default: "{{ vhost_redirect_target if vhost_type == 'redirect' else '' }}"
|
||||
redirect_preserve_path:
|
||||
description: Whether to keep the original request path
|
||||
type: bool
|
||||
required: false
|
||||
default: "{{ redirect_preserve_path }}"
|
||||
redirect type:
|
||||
default: "{{ vhost_redirect_preserve_path }}"
|
||||
redirect_type:
|
||||
description: Only applicable if vhost_type is reverse_proxy
|
||||
type: str
|
||||
required: false
|
||||
default: "{{ redirect_type }}"
|
||||
default: "{{ vhost_redirect_type }}"
|
||||
choices:
|
||||
- temporary
|
||||
- permanent
|
||||
@@ -203,12 +206,12 @@ argument_specs:
|
||||
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: false
|
||||
default: "{{ respond_content if vhost_type == 'respond' else '' }}"
|
||||
default: "{{ vhost_respond_content if vhost_type == 'respond' else '' }}"
|
||||
respond_content_type:
|
||||
description: Type of the respond content
|
||||
type: str
|
||||
required: false
|
||||
default: "{{ respond_content_type }}"
|
||||
default: "{{ vhost_respond_content_type }}"
|
||||
choices:
|
||||
- plain
|
||||
- json
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
dependencies:
|
||||
- role: caddy
|
||||
when: web_server == 'caddy'
|
||||
when: vhost_web_server == 'caddy'
|
||||
|
||||
Reference in New Issue
Block a user