66 lines
1.5 KiB
Python
66 lines
1.5 KiB
Python
|
DOCUMENTATION = '''
|
||
|
---
|
||
|
module: opnsense_reconfigure_unbound
|
||
|
short_description: Ansible action plugin for triggering a reconfiguration of Unbound service in OPNsense.
|
||
|
description:
|
||
|
- This Ansible action plugin interacts with the OPNsense API to trigger a reconfiguration of the Unbound service.
|
||
|
version_added: "2.9"
|
||
|
requirements:
|
||
|
- Ansible 2.9 or later
|
||
|
- Python 2.7 or later
|
||
|
- The `requests` library for Python (`pip install requests`)
|
||
|
options:
|
||
|
opnsense_url:
|
||
|
description:
|
||
|
- The URL of the OPNsense instance.
|
||
|
required: true
|
||
|
type: str
|
||
|
attributes:
|
||
|
- configurable
|
||
|
api_key:
|
||
|
description:
|
||
|
- The API key for authentication.
|
||
|
required: true
|
||
|
type: str
|
||
|
attributes:
|
||
|
- no_log
|
||
|
api_secret:
|
||
|
description:
|
||
|
- The API secret for authentication.
|
||
|
required: true
|
||
|
type: str
|
||
|
attributes:
|
||
|
- no_log
|
||
|
'''
|
||
|
|
||
|
EXAMPLES = '''
|
||
|
- name: Trigger Unbound reconfiguration
|
||
|
opnsense_reconfigure_unbound:
|
||
|
opnsense_url: http://your-opnsense-ip
|
||
|
api_key: your-api-key
|
||
|
api_secret: your-api-secret
|
||
|
check_mode: false
|
||
|
register: result
|
||
|
'''
|
||
|
|
||
|
RETURN = '''
|
||
|
changed:
|
||
|
description: Indicates whether the Unbound service was reconfigured.
|
||
|
type: bool
|
||
|
api_response:
|
||
|
description: The response from the OPNsense API.
|
||
|
type: dict
|
||
|
failed:
|
||
|
description: Indicates whether the task failed.
|
||
|
type: bool
|
||
|
msg:
|
||
|
description: An error message if the task failed.
|
||
|
type: str
|
||
|
status_code:
|
||
|
description: The HTTP status code of the API response.
|
||
|
type: int
|
||
|
body:
|
||
|
description: The JSON body of the API response.
|
||
|
type: dict
|
||
|
'''
|