我有一个变量:
ok: [192.168.0.2] => {
"_ip": [
"192.168.0.3"
]
}
我正在尝试将它传递给 routeros 上的命令
- name: Ping
community.routeros.command:
commands: 'ping {{_ip}} count 5'
register: ping
但事实证明这是一个错误
ok: [192.168.0.2] => {
"ping.stdout_lines": [
[
"p",
"",
"expected command name (line 1 column 7)"
]
]
}
我查看了错误可能是什么,它给出了以下内容:
changed: [192.168.176.129] => {
"changed": true,
"invocation": {
"module_args": {
"commands": [
"ping ['192.168.176.128'] count 5"
],
"interval": 1,
"match": "all",
"retries": 10,
"wait_for": null
}
},
"stdout": [
"p\n\nexpected command name (line 1 column 7)"
],
"stdout_lines": [
[
"p",
"",
"expected command name (line 1 column 7)"
]
]
}
如何解决?