command timeout triggered, timeout value is 60 secs - Mikrotik

69 views
Skip to first unread message

Saurav Gupta

unread,
Feb 6, 2024, 9:44:12 AM2/6/24
to Ansible Project
Hi All,

I am trying to configure one line command on Mikoritk but getting below error -

- hosts: routers
  connection: local
  gather_facts: false
  tasks:
    - name: Configure username
      routeros_command:
        commands:
           - user add name=ansible group=full password=test1234
           - quit

"command timeout triggered, timeout value is 60 secs"

I can see ssh login to device but it does not run the command.

here the details of ansible 
ansible [core 2.15.9]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/saurav/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/saurav/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True


Todd Lewis

unread,
Feb 6, 2024, 10:13:07 AM2/6/24
to ansible...@googlegroups.com, uto...@gmail.com
According to https://docs.ansible.com/ansible/latest/collections/community/routeros/docsite/ssh-guide.html#important-notes

The community.routeros.command module does not support nesting commands and expects every command to start with a forward slash (/). Running the following command will produce an error:

- community.routeros.command:
    commands:
      - /ip
      - print
It's the "… and expects every command to start with a forward slash (/)" bit that I suspect is your problem.
While you're fixing things, use the FQCN: "community.routeros.command". "[community.network.]routeros_command" is deprecated.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1f0eb35d-c003-4430-b391-7b199b2f1bf2n%40googlegroups.com.

-- 
Todd

Saurav Gupta

unread,
Feb 6, 2024, 7:23:36 PM2/6/24
to Ansible Project
Hi Todd,
Thanks for your reply.

I have used the other script with  community.routeros.command and receiving the same error with "/" and without"/"

 hosts: routers
  connection: local
  gather_facts: false
  tasks:
    - name: Configure username
      community.routeros.command:
        commands:
           - /user add name=ansible group=full password=test 
           

Any other thought ?

Reply all
Reply to author
Forward
0 new messages