Ansible powershell 스크립트가 작동하지 않음 - 스크립트가 cmdlet의 이름으로 인식되지 않습니다.

Ansible powershell 스크립트가 작동하지 않음 - 스크립트가 cmdlet의 이름으로 인식되지 않습니다.

Ansible을 사용하여 Windows 서비스를 중지하려고 하는데 '스크립트가 cmdlet 이름으로 \r\n인식되지 않습니다.'라는 오류가 발생합니다.

Ansible yaml 파일의 작업은 다음과 같습니다.

  - name: Check if ERL is already installed
    win_service:
      name: RabbitMQ
      state: stopped

플레이북을 실행할 때 발생하는 오류는 다음과 같습니다.

TASK [Check if ERL is already installed] **************************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "/home/user1/.ansible/tmp/ansible-tmp-1629089159.6-1896-227877656238414/AnsiballZ_win_service.ps1 : The term \r\n'/home/user1/.ansible/tmp/ansible-tmp-1629089159.6-1896-227877656238414/AnsiballZ_win_service.ps1' is not recognized \r\nas the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was \r\nincluded, verify that the path is correct and try again.\r\nAt line:1 char:1\r\n+ /home/user1/.ansible/tmp/ansible-tmp-1629089159.6-1896-22787765623841 ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : ObjectNotFound: (/home/user1/.an...win_service.ps1:String) [], CommandNotFoundException\r\n    + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

관련 정보