The src parameter allows you to specify the path to a configuration file or configuration template to be loaded on the device. This parameter is mutually exclusive with lines (that is, either lines or src can be specified). Example playbook ios_config_src.yml: The templates/acl_cfg.txt file contains the following configuration: We delete this ACL on the router […]
Working with module ios_config in ansible and use replace parameters
The replace parameter specifies how exactly the configuration should be replaced: How to use replace: line parameter in module ios_config? The replace: line mode is the default behavior. In this mode, if changes were detected, only the missing rows are sent. For example, on a router such an ACL: Let’s try to run this playbook […]
Working with module ios_config in ansible and use match parameters
The match parameter specifies how exactly the commands should be compared (which is considered a change): line – commands are checked line by line. This mode is used by default strict – not only the commands themselves must match, but also their position relative to each other exact – commands must match the configuration exactly, […]
Working with module ios_config in ansible and use after, before parameters
How to use after parameter of ios_config module in ansible? The after parameter specifies which commands to execute after the commands in the lines (or commands) list. Commands that are specified in the after parameter: executed only if changes need to be made. however, they will be executed regardless of whether they are in the […]
Working with module ios_config in ansible and use save_when, backup, default parameters
How to use save_when parameter of ios_config module in ansible? The save_when parameter allows you to specify whether you want to save the current configuration to startup config. By default, the parameter value is no. Available value options: always – always save the configuration (in this case, the modified flag will be True) never (default) […]
Working with ios_config module, use lines and parents parameters
The ios_config module – allows you to configure devices running IOS, as well as generate configuration templates or send commands based on a template. Module parameters: after – what to do after commands before – what actions to perform before commands backup – a parameter that specifies whether to make a backup copy of the […]
Working with module ios_facts in ansible
IOS_FACTS module – collects information from devices running iOS. Information is taken from the following commands: dir show version show memory statistics show interfaces show ipv6 interface show lldp show lldp neighbors detail show running-config In the module, you can specify which parameters to collect – you can collect all information, but only a subset […]
Working with module ios_command in ansible
Hello everybody) In this post I will show you how to work with ansible module ios_command. What is ios_command module do? It sends a show command to an IOS device and returns the result of the command. The ios_command module does not support sending commands in configuration mode. For this, a separate module is used […]
Ansible modules for working with network devices
In this post, we will look at CLI modules that work with network devices. Globally, modules for working with network equipment can be divided into two parts: modules for API-enabled equipment modules for equipment that only works via CLI For CLI-only hardware, Ansible supports these three types of modules: os_command – execute show commands os_facts […]
Working with module execution results in Ansible.
In this post discusses several ways that you can look at the output received from devices. We will be using the raw module, but the same principles apply to other modules as well. One way to display the output of commands has already been used is the verbose flag. Detailed example of running a playbook […]