n_module(mod_name='ansible_.modules.ios_l2_interfaces', init_globals=None, run_name='_main_', alter_sys=True)įile "/usr/lib/python3.6/runpy.py", line 205, in run_module You can play with the output received from the show commands to achieve your desired logic.Ĭ_command = _l2_interfaces = name: Merge provided configuration with device configuration show running-config | section ^interface
Here is an example using both _command and _l2_interfaces modules: You can use more than one ansible module in the same playbook, the _command module will allow you to run a show command and get the current configuration as the output, you can also use the match and wait_for arguments to evaluate against the output of the command.