-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'latest' into unbound_dnsbl
- Loading branch information
Showing
13 changed files
with
280 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,15 +38,27 @@ ansible-galaxy collection install ansibleguy.opnsense | |
|
||
See: [Docs](https://opnsense.ansibleguy.net) | ||
|
||
You want a simple Ansible GUI? Check-out my [Ansible WebUI](https://github.com/ansibleguy/webui) | ||
|
||
---- | ||
|
||
## Sponsor | ||
## Advertisement | ||
|
||
* Need **professional support** using Ansible or OPNSense? Contact us: | ||
|
||
E-Mail: [[email protected]](mailto:[email protected]) | ||
|
||
Tel: [+43 720 302 5732](tel:+437203025732) | ||
|
||
Web: [EN](https://www.o-x-l.com) | [DE](https://www.oxl.at) | ||
|
||
Language: German or English | ||
|
||
* You want a simple **Ansible GUI**? | ||
|
||
Check-out this [Ansible WebUI](https://github.com/ansibleguy/webui) | ||
|
||
It was a lot of work (100+ hours) to get those modules working. | ||
* It was a lot of work (100+ hours) to get those modules working. | ||
|
||
If you are happy with the functionality they provide: please [consider donating a few bucks](https://ko-fi.com/ansible0guy) | ||
If you are happy with the functionality they provide: please [consider donating a few bucks](https://ko-fi.com/ansible0guy) | ||
|
||
---- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from ansible.module_utils.basic import AnsibleModule | ||
|
||
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.api import \ | ||
Session | ||
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.cls import BaseModule | ||
|
||
|
||
class Loopback(BaseModule): | ||
FIELD_ID = 'description' | ||
CMDS = { | ||
'add': 'addItem', | ||
'del': 'delItem', | ||
'set': 'setItem', | ||
'search': 'get', | ||
} | ||
API_KEY_PATH = 'loopback.loopback' | ||
API_MOD = 'interfaces' | ||
API_CONT = 'loopback_settings' | ||
API_CMD_REL = 'reconfigure' | ||
FIELDS_CHANGE = [] | ||
FIELDS_ALL = [FIELD_ID] | ||
FIELDS_TYPING = {} | ||
EXIST_ATTR = 'interface' | ||
|
||
def __init__(self, module: AnsibleModule, result: dict, session: Session = None): | ||
BaseModule.__init__(self=self, m=module, r=result, s=session) | ||
self.interface = {} | ||
|
||
def check(self) -> None: | ||
self._base_check() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright: (C) 2024, AnsibleGuy <[email protected]> | ||
# GNU General Public License v3.0+ (see https://www.gnu.org/licenses/gpl-3.0.txt) | ||
|
||
# template to be copied to implement new modules | ||
|
||
from ansible.module_utils.basic import AnsibleModule | ||
|
||
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.handler import \ | ||
module_dependency_error, MODULE_EXCEPTIONS | ||
|
||
try: | ||
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.helper.wrapper import module_wrapper | ||
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.defaults.main import \ | ||
OPN_MOD_ARGS, STATE_MOD_ARG, RELOAD_MOD_ARG | ||
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.main.interface_loopback import Loopback | ||
|
||
except MODULE_EXCEPTIONS: | ||
module_dependency_error() | ||
|
||
|
||
# DOCUMENTATION = 'https://opnsense.ansibleguy.net/en/latest/modules/interface_loopback.html' | ||
# EXAMPLES = 'https://opnsense.ansibleguy.net/en/latest/modules/interface_loopback.html' | ||
|
||
|
||
def run_module(): | ||
module_args = dict( | ||
description=dict(type='str', required=True, aliases=['desc']), | ||
**RELOAD_MOD_ARG, | ||
**STATE_MOD_ARG, | ||
**OPN_MOD_ARGS, | ||
) | ||
|
||
result = dict( | ||
changed=False, | ||
diff={ | ||
'before': {}, | ||
'after': {}, | ||
} | ||
) | ||
|
||
module = AnsibleModule( | ||
argument_spec=module_args, | ||
supports_check_mode=True, | ||
) | ||
|
||
module_wrapper(Loopback(module=module, result=result)) | ||
module.exit_json(**result) | ||
|
||
|
||
def main(): | ||
run_module() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.