The shell command doesn't expand wildcard when running ansible module through powershell.
If I remove the wildcard and specify the version number it works 'rabbitmq_server-3.9.3'.
Any suggestion on how to make this work with wildcard?
Yaml code:
- name: Check if RabbitMQ is already installed
shell: "\"/cygdrive/c/Program\ Files/RabbitMQ\ Server/rabbitmq_server-*/sbin/rabbitmq-service.bat\" status"
ignore_errors: true
register: RabbitMQ_install_status
Error:
'C:\cygwin\bin\bash.exe -c ansible-playbook test.yml':
TASK [Check if RabbitMQ is already installed] **************************************************************************fatal: [localhost]: FAILED! => {"changed": true, "cmd": "\"/cygdrive/c/Program Files/RabbitMQ Server/rabbitmq_server-*/sbin/rabbitmq-service.bat\" status", "delta": "0:00:00.042184", "end": "2021-08-16 13:43:52.066236", "msg": "non-zero return code", "rc": 127, "start": "2021-08-16 13:43:52.024052", "stderr": "/bin/sh: /cygdrive/c/Program Files/RabbitMQ Server/rabbitmq_server-*/sbin/rabbitmq-service.bat: No such file or directory", "stderr_lines": ["/bin/sh: /cygdrive/c/Program Files/RabbitMQ Server/rabbitmq_server-*/sbin/rabbitmq-service.bat: No such file or directory"], "stdout": "", "stdout_lines": []}
...ignoring