The Ansible Zyxel collection includes a variety of Ansible content to help automate the management of Zyxel VMG8825 routers.
This collection has been tested against Zyxel VMG8825-T50. The modules zyxel_vmg8825_ping
and zyxel_vmg8825_dal_rpc
are not thoroughly tested and should be considered alpha quality.
This collection has been tested against following Ansible versions: >=2.9.10.
For collections that support Ansible 2.9, please ensure you update your network_os
to use the
fully qualified collection name (for example, cisco.ios.ios
).
Plugins and modules within a collection may be tested with only specific Ansible versions.
A collection may contain metadata that identifies these versions.
PEP440 is the schema used to describe the versions of Ansible.
Name | Description |
---|---|
jwnmulder.zyxel_vmg8825.zyxel_vmg8825 | HttpApi Plugin for Zyxel VMG 8825 |
Name | Description |
---|---|
jwnmulder.zyxel_vmg8825.zyxel_vmg8825_dal_rpc | Zyxel Module for interacting with the Zyxel DAL API |
jwnmulder.zyxel_vmg8825.zyxel_vmg8825_facts | Get facts about zyxel_vmg8825 devices. |
jwnmulder.zyxel_vmg8825.zyxel_vmg8825_firewall | Manages firewall config of zyxel_vmg8825 |
jwnmulder.zyxel_vmg8825.zyxel_vmg8825_firewall_acls | Manages firewall ACL entries of zyxel_vmg8825 |
jwnmulder.zyxel_vmg8825.zyxel_vmg8825_nat_port_forwards | Manages nat port forward entries of zyxel_vmg8825 |
jwnmulder.zyxel_vmg8825.zyxel_vmg8825_ping | Zyxel Module for sending PINGTEST |
jwnmulder.zyxel_vmg8825.zyxel_vmg8825_static_dhcp | Manages static_dhcp entries of zyxel_vmg8825 |
You can install the Zyxel collection with the Ansible Galaxy CLI:
ansible-galaxy collection install jwnmulder.zyxel_vmg8825
You can also include it in a requirements.yml
file and install it with ansible-galaxy collection install -r requirements.yml
, using the format:
---
collections:
- jwnmulder.zyxel_vmg8825
This collection includes network resource modules.
You can call modules by their Fully Qualified Collection Namespace (FQCN), such as jwnmulder.zyxel_vmg8825.zyxel_vmg8825_static_dhcp
.
The following example task replaces configuration changes in the existing configuration on a Zyxel router, using the FQCN:
---
- name: Configure static_dhcp
jwnmulder.zyxel_vmg8825.zyxel_vmg8825_static_dhcp:
config:
- br_wan: Default
enable: True
mac_addr: "01:01:01:01:01:02"
ip_addr: "192.168.0.2"
state: merged
If you want to clone this repository (or a fork of it) to improve it, you can proceed as follows:
-
Strongly recommended, ensure
pre-commit
anddirenv
are installed -
Create a directory
ansible_collections/jwnmulder
-
In there, checkout this repository (or a fork) as
zyxel_vmg8825
-
In the zyxel_vmg8825 dir, run the following commands to setup a python venv
scripts/ensure-venv.sh . .venv/bin/activate
-
In the zyxel_vmg8825 dir, run the following command 'ansible-galaxy collection install ansible.netcommon'
-
Setup pre-commit by running
pre-commit install
in the zyxel_vmg8825 dir -
To ensure vscode can run pytest, add the following to your .env file
PYTHONPATH=../../../
Using ansible-test
- Copy inventory.networking.template to inventory.networking and modify accordingly. You also need a Zyxel router. This is needed for the network-integration tests
- To run all tests:
./scripts/run-all-tests.sh
# --debug will trigger logging to /tmp/q
ansible-test network-integration -v --debug
# https://github.com/ansible-network/cli_rm_builder
ansible-galaxy collection install git+https://github.com/ansible-network/cli_rm_builder.git
cd rm_builder
ansible-playbook -e rm_dest=$(pwd)/.. generate_all.yml
ansible-playbook -e rm_dest=$(pwd)/.. update_all.yml
https://192.168.0.1/cgi-bin/DAL?oid=status
Lots of info useful for facts
{
"result": "ZCFG_SUCCESS",
"ReplyMsg": "X_ZYXEL_ConnectionType",
"ReplyMsgMultiLang": "",
"Object": [
{
"DeviceInfo": {
},
"SystemInfo": {
},
"FirewallInfo": {
},
"LanPortInfo": [
]
}
]
}