From b872b6f21d14ff10c221d84217eb568318e9ad8b Mon Sep 17 00:00:00 2001 From: Nilashish Chakraborty Date: Tue, 25 Jun 2024 14:54:01 +0530 Subject: `vyos.vyos` is no longer deprecated! 🎉 (#348) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove deprecation notice for vyos.vyos Signed-off-by: NilashishC * Add changelog Signed-off-by: NilashishC * fix review comments Signed-off-by: NilashishC * chore: auto fixes from pre-commit.com hooks --------- Signed-off-by: NilashishC Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- plugins/modules/vyos_config.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'plugins/modules/vyos_config.py') diff --git a/plugins/modules/vyos_config.py b/plugins/modules/vyos_config.py index 2a03d0c3..bf5d4217 100644 --- a/plugins/modules/vyos_config.py +++ b/plugins/modules/vyos_config.py @@ -17,6 +17,7 @@ # from __future__ import absolute_import, division, print_function + __metaclass__ = type @@ -128,14 +129,14 @@ EXAMPLES = """ - name: configure the remote device vyos.vyos.vyos_config: lines: - - set system host-name {{ inventory_hostname }} - - set service lldp - - delete service dhcp-server + - set system host-name {{ inventory_hostname }} + - set service lldp + - delete service dhcp-server - name: backup and load from file vyos.vyos.vyos_config: src: vyos.cfg - backup: yes + backup: true - name: render a Jinja2 template onto the VyOS router vyos.vyos.vyos_config: @@ -145,11 +146,11 @@ EXAMPLES = """ vyos.vyos.vyos_config: lines: # - set int eth eth2 description 'OUTSIDE' - - set interface ethernet eth2 description 'OUTSIDE' + - set interface ethernet eth2 description 'OUTSIDE' - name: configurable backup path vyos.vyos.vyos_config: - backup: yes + backup: true backup_options: filename: backup.cfg dir_path: /home/user @@ -205,9 +206,12 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import run_commands, ) + DEFAULT_COMMENT = "configured by vyos_config" -CONFIG_FILTERS = [re.compile(r"set system login user \S+ authentication encrypted-password")] +CONFIG_FILTERS = [ + re.compile(r"set system login user \S+ authentication encrypted-password"), +] def get_candidate(module): @@ -312,7 +316,7 @@ def run(module, result): if result.get("filtered"): result["warnings"].append( - "Some configuration commands were removed, please see the filtered key" + "Some configuration commands were removed, please see the filtered key", ) result["changed"] = True -- cgit v1.2.3