У меня есть Ansible 2.7.10 с python 3.6.7 в Ubuntu, RabbitMQ 3.8.7 с Erlang 21.3 в Windows 2019 Core.
Я хочу запустить простую задачу, такую как:
ansible rabbit -m rabbitmq_vhost -a "имя = / состояние теста = присутствует"
172.25.222.105 | FAILED! => {
"changed": false,
"module_stderr": "Exception calling \"Create\" with \"1\" argument(s): \"At line:4 char:21\r
+ def _ansiballz_main():\r
+ ~\r
An expression was expected after '('.\r
At line:12 char:27\r
+ except (AttributeError, OSError):\r
+ ~\r
Missing argument in parameter list.\r
At line:14 char:7\r
+ if scriptdir is not None:\r
+ ~\r
Missing '(' after 'if' in if statement.\r
At line:21 char:7\r
+ if sys.version_info < (3,):\r
+ ~\r
Missing '(' after 'if' in if statement.\r
At line:21 char:30\r
+ if sys.version_info < (3,):\r
+ ~\r
Missing expression after ','.\r
At line:21 char:25\r
+ if sys.version_info < (3,):\r
+ ~\r
The '<' operator is reserved for future use.\r
At line:23 char:32\r
+ MOD_DESC = ('.py', 'U', imp.PY_SOURCE)\r
+ ~\r
Missing expression after ','.\r
At line:23 char:33\r
+ MOD_DESC = ('.py', 'U', imp.PY_SOURCE)\r
+ ~~~~~~~~~~~~~\r
Unexpected token 'imp.PY_SOURCE' in expression or statement.\r
At line:23 char:32\r
+ MOD_DESC = ('.py', 'U', imp.PY_SOURCE)\r
+ ~\r
Missing closing ')' in expression.\r
At line:23 char:46\r
+ MOD_DESC = ('.py', 'U', imp.PY_SOURCE)\r
+ ~\r
Unexpected token ')' in expression or statement.\r
Not all parse errors were reported. Correct the reported errors and try again.\"\r
At line:6 char:1\r
+ $exec_wrapper = [ScriptBlock]::Create($split_parts[0])\r
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException\r
+ FullyQualifiedErrorId : ParseException\r
\r
The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name,\r
a script block, or a CommandInfo object.\r
At line:7 char:2\r
+ &$exec_wrapper\r
+ ~~~~~~~~~~~~~\r
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException\r
+ FullyQualifiedErrorId : BadExpression\r
",
"module_stdout": "",
"msg": "MODULE FAILURE
See stdout/stderr for the exact error",
"rc": 1
}
Я также тестировал другой модуль, такой как: rabbitmq_user, ошибка та же. Я также тестировал с ansible 2.7.10 и python 2.6, и я получил ту же ошибку, тесты с playbook одинаковы. В playbook я также проверил, запущен ли сервис rabbitmq и работает ли он нормально, кроме связи с rabbitmq.
файл инвентаря:
[rabbit]
172.25.222.105
файл переменных:
ansible_user: ansible
ansible_password: password
ansible_port: 5985
ansible_connection: winrm
ansible_winrm_transport: ntlm
Ответственный пользователь - локальный администратор
Несколько предложений, как разговаривать с ansible и rabbitmq? У меня нет новых идей, как решить эту проблему: (
Большое спасибо всем за помощь.