---
- hosts: all
become_user: mqm
become_method: sudo
tasks:
- name: Execute a MQ Command
shell:
cmd: "echo 'DISPLAY LSSTATUS(TCP) STATUS' | runmqsc QMGR"
chdir: /opt/mqm/bin/runmqsc
register: mqstat
- debug:
var: mqstat.stdout_lines
** Ошибка: **
TASK [Execute a MQ Command] ****************************************************************************************************************************************
fatal: [QMGR]: FAILED! => {"changed": false, "module_stderr": "Shared connection to xyz.pqr.com closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible_UASQnG/ansible_module_command.py\", line 213, in <module>\r\n main()\r\n File \"/tmp/ansible_UASQnG/ansible_module_command.py\", line 152, in main\r\n os.chdir(chdir)\r\nOSError: [Errno 20] Not a directory: '/opt/mqm/bin/runmqsc'\r\n", "msg": "MODULE FAILURE", "rc": 0}