dodevops / ansible-teamcity-callback

An Ansible callback plugin to output suitable for TeamCity
MIT License
21 stars 5 forks source link

Since TeamCity 2019.1, callback tool not downloaded and build fail #2

Open axel3rd opened 5 years ago

axel3rd commented 5 years ago

Previously TeamCity 2019, when you define global configuration in buildAgent.properties with:

env.ANSIBLE_CALLBACK_PLUGINS = /path-of-teamcity-agent/tools/ansible-teamcity-callback-master
env.ANSIBLE_STDOUT_CALLBACK = teamcity

This callback was called for all ansible builds and worked fine.


TeamCity 2019.1 introduces the Tool download on demand / faster agents upgrade (+ note at end of Installing Agent Tools) => Tool is not here by default and any TeamCity ansible build fails with:

image


A workaround could be to define a build configuration parameter (or inherited), which enfore the tool download:

tools.Required = %teamcity.tool.ansible-teamcity-callback-master%

This issue is more for feedback and sharing the incoming best solution (and with JetBrains TeamCity support : ticket 2274779).

dploeger commented 5 years ago

Awesome, thanks for sharing. We haven't updated to 2019.1 yet, but will keep this info in mind.

dploeger commented 5 years ago

I will also add that info to the README.

axel3rd commented 5 years ago

The problem could have more visibility with cloud agents (static agent where tools downloaded in the past have not the problem).

Perhaps a sustainable solution could be to add a third property in buildAgent.properties like (to validate, not tested):

env.ANSIBLE_CALLBACK_TEAMCITY_REQUIRED_TOOL = %teamcity.tool.ansible-teamcity-callback-master%

But the default would be to download this tool even if callback not used.

A better approach could be to add this reference in tc-ansible-runner plugin, but more complicated to implement (the name of callback/zip could change ...). Let's stay tuned for JetBrains comments ...

dploeger commented 5 years ago

I obviously don't have access to the support ticket. Please keep this issue updated with any news. Thanks.

dploeger commented 5 years ago

We updated to 2019.2 on our integration system and testing this.

axel3rd commented 5 years ago

I obviously don't have access to the support ticket. Please keep this issue updated with any news. Thanks.

JetBrains answer: The most convenience way is to reference a sysenv with teamcity.tool. in buildAgent.properties, like:

ANSIBLE_CALLBACK_PLUGINS=%teamcity.tool.ansible-teamcity-callback-master%

But, it will work (from buildAgent.properties configuration file) only from TeamCity 2019.1.4 : TW-62313.

The workaround to define a configuration parameter on build (tools.Required = %teamcity.tool.ansible-teamcity-callback-master%) is currently the only sustainable solution (for TeamCIty 2019.1.[1|2|3]).