Skip to content

Instantly share code, notes, and snippets.

@icarrr
Last active November 12, 2019 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icarrr/4e1433ee56c52c1ec6a2ba3cc74203d6 to your computer and use it in GitHub Desktop.
Save icarrr/4e1433ee56c52c1ec6a2ba3cc74203d6 to your computer and use it in GitHub Desktop.
Ansible RouterOS | check identity MikroTik

How to run?

ansible-playbook -i hosts check_identity.yml

For debug, add command option verbose (-vvv)

ansible-playbook -i hosts check_identity.yml -vvv

For ask password ssh, add command option ask-pass (--ask-pass)

ansible-playbook -i hosts check_identity.yml --ask-pass -vvv

Requirement

  • ansible
---
- hosts: lab
connection: network_cli
gather_facts: no
tasks:
- name: check identity
routeros_command:
commands: /system identity print
register: identityX
- name: Debug
debug:
msg: "{{ identityX.stdout[0] }}"
[lab]
192.168.0.112 ansible_user=icar ansible_network_os=routeros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment