--- - name: Configurar routers Cisco hosts: routers gather_facts: no become: yes vars: # for execution environment ansible_connection: ansible.netcommon.network_cli ansible_network_os: cisco.ios.ios tasks: - name: Configurar interfaces GigabitEthernet ansible.netcommon.cli_command: command: - "interface GigabitEthernet1" - "ip address {{ wan_ip }} 255.255.255.0" - "no shutdown" - "exit" - "interface GigabitEthernet2" - "ip address {{ lan_ip }} 255.255.255.0" - "no shutdown" - "exit" vars: wan_ip: "{{ wan_interface_ip }}" lan_ip: "{{ lan_interface_ip }}" - name: Configurar RIPv2 en el router ansible.netcommon.cli_command: command: - "router rip" - "version 2" - "network {{ wan_network }}" - "network {{ lan_network }}" - "no auto-summary" vars: wan_network: "{{ wan_network }}" lan_network: "{{ lan_network }}" - name: Guardar la configuración en la NVRAM ansible.netcommon.cli_command: command: - "write memory"