)]}'
{"tasks/openstack_hosts_configure_zypper.yml":[{"author":{"_account_id":23163,"name":"Markos Chandras (hwoarang)","email":"markos@chandras.me","username":"mchandras"},"change_message_id":"544a58033898959a16ec917321925785d7e21d39","unresolved":false,"context_lines":[{"line_number":41,"context_line":"  args:"},{"line_number":42,"context_line":"    warn: false"},{"line_number":43,"context_line":"  changed_when: _remove_gettext_runtime_mini.rc \u003d\u003d 0"},{"line_number":44,"context_line":"  failed_when: false"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"- name: Remove the blacklisted packages"},{"line_number":47,"context_line":"  package:"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3f79a3b5_c17b31f1","line":44,"range":{"start_line":44,"start_character":2,"end_line":44,"end_character":20},"updated":"2018-09-21 07:42:48.000000000","message":"is there no way this can fail? For example, if gettext-runtime-mini is not installed you get this\n\n$ rpm --erase --verbose --nodeps gettext-runtime-mini\nerror: package gettext-runtime-mini is not installed\n$ echo $?\n$ 1\n\nSo you need to check for return value and report failures properly since this can actually fail :)","commit_id":"77a3dda9be9b167b2cfbc7ab316a29a5fcd96511"},{"author":{"_account_id":23163,"name":"Markos Chandras (hwoarang)","email":"markos@chandras.me","username":"mchandras"},"change_message_id":"3e136d54b0a895f53f6af278e4402c1123699425","unresolved":false,"context_lines":[{"line_number":41,"context_line":"  args:"},{"line_number":42,"context_line":"    warn: false"},{"line_number":43,"context_line":"  changed_when: _remove_gettext_runtime_mini.rc \u003d\u003d 0"},{"line_number":44,"context_line":"  failed_when: false"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"- name: Remove the blacklisted packages"},{"line_number":47,"context_line":"  package:"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3f79a3b5_2b78bf28","line":44,"range":{"start_line":44,"start_character":2,"end_line":44,"end_character":20},"in_reply_to":"3f79a3b5_2b1c3f11","updated":"2018-09-21 11:38:59.000000000","message":"almost.\n\nyou need to check if rpm --erase worked\nso better be something like\n\nreturn_code\u003d0\nif rpm -qi gettext-runtime-mini; then\n  rpm--erase --verbose --no-deps gettext-runtime-mini\n  return_code \u003d $?\n  if [[ $return_code \u003d\u003d 0 ]]; then\n    return_code \u003d 2\n  fi\nfi\nexit $return_code","commit_id":"77a3dda9be9b167b2cfbc7ab316a29a5fcd96511"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"53ccabdaeac55103e3f90ca7d7f0ad7be80e6bc8","unresolved":false,"context_lines":[{"line_number":41,"context_line":"  args:"},{"line_number":42,"context_line":"    warn: false"},{"line_number":43,"context_line":"  changed_when: _remove_gettext_runtime_mini.rc \u003d\u003d 0"},{"line_number":44,"context_line":"  failed_when: false"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"- name: Remove the blacklisted packages"},{"line_number":47,"context_line":"  package:"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3f79a3b5_76369ab6","line":44,"range":{"start_line":44,"start_character":2,"end_line":44,"end_character":20},"in_reply_to":"3f79a3b5_2b78bf28","updated":"2018-09-21 12:09:20.000000000","message":"Does the erase not exit 1 if it fails, resulting in the task failing? If so, that won\u0027t be necessary, unless you\u0027re thinking of some weird edge case?","commit_id":"77a3dda9be9b167b2cfbc7ab316a29a5fcd96511"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"ff035a43325968ad44e631e4ef8fe199e6870e45","unresolved":false,"context_lines":[{"line_number":41,"context_line":"  args:"},{"line_number":42,"context_line":"    warn: false"},{"line_number":43,"context_line":"  changed_when: _remove_gettext_runtime_mini.rc \u003d\u003d 0"},{"line_number":44,"context_line":"  failed_when: false"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"- name: Remove the blacklisted packages"},{"line_number":47,"context_line":"  package:"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3f79a3b5_2b1c3f11","line":44,"range":{"start_line":44,"start_character":2,"end_line":44,"end_character":20},"in_reply_to":"3f79a3b5_2bd75f51","updated":"2018-09-21 11:28:55.000000000","message":"how about this, which will then also show a change in the task when something actually changes...\n\n  shell: |\n    return_code\u003d0\n    if rpm -qi gettext-runtime-mini; then\n      rpm --erase --verbose --no-deps gettext-runtime-mini\n      return_code\u003d2\n    fi\n    exit $return_code\n  args:\n    executable: /bin/bash\n    warn: no\n  register: _remove_conflicting_package\n  changed_when: _remove_conflicting_package.rc \u003d\u003d 2\n  failed_when: _remove_conflicting_package not in [0,2]","commit_id":"77a3dda9be9b167b2cfbc7ab316a29a5fcd96511"},{"author":{"_account_id":23163,"name":"Markos Chandras (hwoarang)","email":"markos@chandras.me","username":"mchandras"},"change_message_id":"48405b095504c7d9b8baf5949dc878f6f9981d5a","unresolved":false,"context_lines":[{"line_number":41,"context_line":"  args:"},{"line_number":42,"context_line":"    warn: false"},{"line_number":43,"context_line":"  changed_when: _remove_gettext_runtime_mini.rc \u003d\u003d 0"},{"line_number":44,"context_line":"  failed_when: false"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"- name: Remove the blacklisted packages"},{"line_number":47,"context_line":"  package:"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3f79a3b5_2bd75f51","line":44,"range":{"start_line":44,"start_character":2,"end_line":44,"end_character":20},"in_reply_to":"3f79a3b5_4b52db13","updated":"2018-09-21 11:21:29.000000000","message":"OK but you can check if the package is installed before you try to remove it right?\n\nrpm -qi gettext-runtime-mini \u0026\u0026 rpm --erase --verbose --nodeps gettext-runtime-mini\n\nThat way idempotency should work right?","commit_id":"77a3dda9be9b167b2cfbc7ab316a29a5fcd96511"},{"author":{"_account_id":23163,"name":"Markos Chandras (hwoarang)","email":"markos@chandras.me","username":"mchandras"},"change_message_id":"d5410c7575d968ee8f4a79d74afe0cba3f8c1426","unresolved":false,"context_lines":[{"line_number":41,"context_line":"  args:"},{"line_number":42,"context_line":"    warn: false"},{"line_number":43,"context_line":"  changed_when: _remove_gettext_runtime_mini.rc \u003d\u003d 0"},{"line_number":44,"context_line":"  failed_when: false"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"- name: Remove the blacklisted packages"},{"line_number":47,"context_line":"  package:"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3f79a3b5_7161c438","line":44,"range":{"start_line":44,"start_character":2,"end_line":44,"end_character":20},"in_reply_to":"3f79a3b5_7189c423","updated":"2018-09-21 13:10:10.000000000","message":"Oh you are right of course. My bad","commit_id":"77a3dda9be9b167b2cfbc7ab316a29a5fcd96511"},{"author":{"_account_id":23163,"name":"Markos Chandras (hwoarang)","email":"markos@chandras.me","username":"mchandras"},"change_message_id":"7e639d9a9709608bde9eeb7bff812c9cfc97f260","unresolved":false,"context_lines":[{"line_number":41,"context_line":"  args:"},{"line_number":42,"context_line":"    warn: false"},{"line_number":43,"context_line":"  changed_when: _remove_gettext_runtime_mini.rc \u003d\u003d 0"},{"line_number":44,"context_line":"  failed_when: false"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"- name: Remove the blacklisted packages"},{"line_number":47,"context_line":"  package:"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3f79a3b5_d1f8d8c1","line":44,"range":{"start_line":44,"start_character":2,"end_line":44,"end_character":20},"in_reply_to":"3f79a3b5_76369ab6","updated":"2018-09-21 12:58:00.000000000","message":"It does but in the failed_when you check for [0,2] and the _remove_conflicting_package variable is set to the value of $return_code which is 0 by default. If erase fails, it does not set the code to something different than 0 (or 2) so failed_when will not actually capture the failure. Do I miss something?","commit_id":"77a3dda9be9b167b2cfbc7ab316a29a5fcd96511"},{"author":{"_account_id":19298,"name":"Nicolas Bock","email":"nicolas.bock@canonical.com","username":"nicolasbock"},"change_message_id":"93a8858e559e4fc63882a1700b864d52a8347163","unresolved":false,"context_lines":[{"line_number":41,"context_line":"  args:"},{"line_number":42,"context_line":"    warn: false"},{"line_number":43,"context_line":"  changed_when: _remove_gettext_runtime_mini.rc \u003d\u003d 0"},{"line_number":44,"context_line":"  failed_when: false"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"- name: Remove the blacklisted packages"},{"line_number":47,"context_line":"  package:"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3f79a3b5_4b52db13","line":44,"range":{"start_line":44,"start_character":2,"end_line":44,"end_character":20},"in_reply_to":"3f79a3b5_c17b31f1","updated":"2018-09-21 11:13:36.000000000","message":"The reason I am ignoring failure is because in the idempotency job we do un-install this package twice and don\u0027t expect any failure or change in the second run. Also, it\u0027s possible that a system has gettext-runtime installed and not the mini version of it in which case this task shouldn\u0027t fail either. Unless of course I am misunderstanding something :)","commit_id":"77a3dda9be9b167b2cfbc7ab316a29a5fcd96511"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"4d9ed7ff84733d1e6bdce1e821f2162f0c219736","unresolved":false,"context_lines":[{"line_number":41,"context_line":"  args:"},{"line_number":42,"context_line":"    warn: false"},{"line_number":43,"context_line":"  changed_when: _remove_gettext_runtime_mini.rc \u003d\u003d 0"},{"line_number":44,"context_line":"  failed_when: false"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"- name: Remove the blacklisted packages"},{"line_number":47,"context_line":"  package:"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"3f79a3b5_7189c423","line":44,"range":{"start_line":44,"start_character":2,"end_line":44,"end_character":20},"in_reply_to":"3f79a3b5_d1f8d8c1","updated":"2018-09-21 13:01:36.000000000","message":"Yeah, if any of the bash commands fail, then bash will exit with the return code from the command - so it never reaches the \u0027exit $return_code\u0027 command, and instead exits with the return code from rpm (which is likely 1, but might be something else).","commit_id":"77a3dda9be9b167b2cfbc7ab316a29a5fcd96511"}]}
