@oni__ino

Почему в логе работы ansible не работают переносы (\n) на след строку?

Проблема банальная, смешная, но просто не дает удобно дебажить.
В старой версии ansible 1.6 все отображалось красиво и понятно, сейчас же решив переписать все на версии ansible 2.0.1.0 вывод ошибок например или других операций получается нечитабельным.

Вот так оно отображается сейчас в консоли, при ограниченных размерах окна оно становится в 10 строк монолитного нечитабельного гуано
TASK [proj-test : debug] *************************************************
fatal: [proj-test.loc]: FAILED! => {"failed": true, "msg": "The conditional check 'command_result.stdout.find(\"is a mountpoint\")' failed. The error was: error while evaluating conditional (command_result.stdout.find(\"is a mountpoint\")): 'dict object' has no attribute 'stdout'\n\nThe error appears to have been in '/***/tasks/test.yml': line 25, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n#command_result.stdout.find(\"is a mountpoint\") != -1\n- debug: msg={{command_result}}\n  ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes.  Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}
	to retry, use: --limit @test-playbook.retry

Давновато было, но насколько я помню у меня в старых версиях был такой вывод, и я хотя бы видел на каком этапе произошла ошибка
TASK [proj-test : debug] *************************************************
fatal: [proj-test.loc]: FAILED! => {"failed": true, "msg": "The conditional check 'command_result.stdout.find(\"is a mountpoint\")' failed. The error was: error while evaluating conditional (command_result.stdout.find(\"is a mountpoint\")): 'dict object' has no attribute 'stdout'

The error appears to have been in '/***/tasks/test.yml': line 25, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

#command_result.stdout.find(\"is a mountpoint\") != -1
- debug: msg={{command_result}}
  ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes.  Always quote template expression brackets when they
start a value. For instance:

    with_items:
      - {{ foo }}

Should be written as:

    with_items:
      - \"{{ foo }}\" "}
	to retry, use: --limit @test-playbook.retry


Устал уже. Гуглил но видимо плохо. Пробовал подключать плагины для изменения вывода callback_plugins, но тоже тщетно. Пробовал: вот из этого блога но оказалось он не совсем хорошо работает со 2 версией, и форк вот этого парня
  • Вопрос задан
  • 1394 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы