According to https://docs.ansible.com/ansible/latest/collections/community/routeros/docsite/ssh-guide.html#important-notes

The community.routeros.command module <https://docs.ansible.com/ansible/latest/collections/community/routeros/command_module.html#ansible-collections-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.

On 2/5/24 7:13 PM, Saurav Gupta wrote:
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


--
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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1f0eb35d-c003-4430-b391-7b199b2f1bf2n%40googlegroups.com <https://groups.google.com/d/msgid/ansible-project/1f0eb35d-c003-4430-b391-7b199b2f1bf2n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Todd

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3c4cd114-1bfb-4bc4-a0eb-20dbd5d73a25%40gmail.com.

Reply via email to