Académique Documents
Professionnel Documents
Culture Documents
Ansible1
hosts1
[routers]
mikrotik ansible_host=192.168.1.102
[routers:vars]
ansible_connection=ansible.netcommon.network_cli
ansible_network_os=community.routeros.routeros
ansible_user=root
ansible_ssh_pass=root
Playboo1
---
- name: RouterOS test with network_cli connection
hosts: mikrotik
gather_facts: false
tasks:
# Retrieve facts
- community.routeros.facts:
- debug:
msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}"
Reference1 :
https://github.com/ansible-collections/community.routeros
Ansible 2 :
---
- hosts: routers
tasks:
- name: Ping host
routeros_command:
commands: /system routerboard print
register: result
- debug:
msg: "{{ result.stdout }}"
Cet playbook permet d’afficher si un mise à jour est disponible pour le firmware de la
cart-mère( /system routerboard print )
08:55:31:CA:9C:A6