)]}'
{"tripleo_ansible/roles/backup_and_restore/backup/tasks/main.yml":[{"author":{"_account_id":20775,"name":"Carlos Camacho","email":"ccamacho@redhat.com","username":"ccamacho"},"change_message_id":"27e9539fc253c42e726a5fbef0cbbe79ea9e1f02","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"- name: Create the node backup"},{"line_number":36,"context_line":"  become: true"},{"line_number":37,"context_line":"  command: rear {{ \u0027-s \u0027 if \"{{ tripleo_backup_and_restore_rear_simulate }}\" else \u0027\u0027 }}-d -v mkbackup"},{"line_number":38,"context_line":"  register: tripleo_backup_and_restore_rear_output"},{"line_number":39,"context_line":"  when: tripleo_backup_and_restore_rear_output is undefined"},{"line_number":40,"context_line":"  tags:"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"3fa7e38b_462319ab","line":37,"range":{"start_line":37,"start_character":28,"end_line":37,"end_character":77},"updated":"2020-02-10 13:36:21.000000000","message":"Are you hitting any issue without the double quotes? Any warning, lint error? If this is a bug, please add the information to the patch description so we can track, backport accordingly.","commit_id":"cc46d53f35352ad03fa8074fb2a893b14d4875c5"},{"author":{"_account_id":26343,"name":"Jose Luis Franco","email":"jfrancoa@redhat.com","username":"jfrancoa"},"change_message_id":"ab662072d8ed2a98a7cf2a6496d421dfde6270ec","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"- name: Create the node backup"},{"line_number":36,"context_line":"  become: true"},{"line_number":37,"context_line":"  command: rear {{ \u0027-s \u0027 if \"{{ tripleo_backup_and_restore_rear_simulate }}\" else \u0027\u0027 }}-d -v mkbackup"},{"line_number":38,"context_line":"  register: tripleo_backup_and_restore_rear_output"},{"line_number":39,"context_line":"  when: tripleo_backup_and_restore_rear_output is undefined"},{"line_number":40,"context_line":"  tags:"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3fa7e38b_b34f9b8b","line":37,"updated":"2020-02-11 09:22:54.000000000","message":"This simple playbook shows that this won\u0027t work:\n\n---\n- hosts: localhost\n  vars:\n    tripleo_backup_and_restore_rear_simulate: false\n  tasks:\n    - name: Create the node backup\n      command: rear {{ \u0027-s \u0027 if \"{{ tripleo_backup_and_restore_rear_simulate }}\" else \u0027\u0027 }}-d -v mkbackup\n      register: tripleo_backup_and_restore_rear_output\n      when: tripleo_backup_and_restore_rear_output is undefined\n      tags:\n        - bar_create_recover_image\n\n\nTASK [Create the node backup] **************************************************\ntask path: /home/jfrancoa/test_ansible.yaml:6\nfatal: [localhost]: FAILED! \u003d\u003e {\"changed\": false, \"cmd\": \"rear -s -d -v mkbackup\", \"msg\": \"[Errno 2] No such file or directory: b\u0027rear\u0027: b\u0027rear\u0027\", \"rc\": 2}\n\nPLAY RECAP *********************************************************************\nlocalhost                  : ok\u003d1    changed\u003d0    unreachable\u003d0    failed\u003d1    skipped\u003d0    rescued\u003d0    ignored\u003d0   \n\n\nEven though the variable is set to false, jinja identifies that the variable is defined so it considers it as a true.\n\nThis syntax would work instead:\n\ncommand: rear \"{{ \u0027-s\u0027 if tripleo_backup_and_restore_rear_simulate|bool else \u0027\u0027 }}\" -d -v mkbackup\n\n\nif tripleo_backup_and_restore_rear_simulate \u003d\u003d false:\n\nTASK [Create the node backup] ***********************************************************************************************************************************************\ntask path: /home/jfrancoa/test_ansible.yaml:6\nfatal: [localhost]: FAILED! \u003d\u003e {\"changed\": false, \"cmd\": \"rear \u0027\u0027 -d -v mkbackup\", \"msg\": \"[Errno 2] No such file or directory: b\u0027rear\u0027: b\u0027rear\u0027\", \"rc\": 2}\n\nPLAY RECAP ******************************************************************************************************************************************************************\nlocalhost                  : ok\u003d1    changed\u003d0    unreachable\u003d0    failed\u003d1    skipped\u003d0    rescued\u003d0    ignored\u003d0   \n\nif tripleo_backup_and_restore_rear_simulate \u003d\u003d true:\n\nTASK [Create the node backup] ***********************************************************************************************************************************************\ntask path: /home/jfrancoa/test_ansible.yaml:6\nfatal: [localhost]: FAILED! \u003d\u003e {\"changed\": false, \"cmd\": \"rear -s -d -v mkbackup\", \"msg\": \"[Errno 2] No such file or directory: b\u0027rear\u0027: b\u0027rear\u0027\", \"rc\": 2}\n\nPLAY RECAP ******************************************************************************************************************************************************************\nlocalhost                  : ok\u003d1    changed\u003d0    unreachable\u003d0    failed\u003d1    skipped\u003d0    rescued\u003d0    ignored\u003d0","commit_id":"549df09fb0c462e8c358cab18c4496b1aab26346"},{"author":{"_account_id":26343,"name":"Jose Luis Franco","email":"jfrancoa@redhat.com","username":"jfrancoa"},"change_message_id":"a9f1cf4dd2578fe5a622614355ac4518c25228a7","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"- name: Create the node backup"},{"line_number":36,"context_line":"  become: true"},{"line_number":37,"context_line":"  command: rear {{ \u0027-s \u0027 if \"{{ tripleo_backup_and_restore_rear_simulate }}\" else \u0027\u0027 }}-d -v mkbackup"},{"line_number":38,"context_line":"  register: tripleo_backup_and_restore_rear_output"},{"line_number":39,"context_line":"  when: tripleo_backup_and_restore_rear_output is undefined"},{"line_number":40,"context_line":"  tags:"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3fa7e38b_e4d46bbe","line":37,"in_reply_to":"3fa7e38b_2ee02493","updated":"2020-02-11 12:01:35.000000000","message":"Of course :-D, but you got my point right? the variable was set to false and it still added the -s to the command.","commit_id":"549df09fb0c462e8c358cab18c4496b1aab26346"},{"author":{"_account_id":20775,"name":"Carlos Camacho","email":"ccamacho@redhat.com","username":"ccamacho"},"change_message_id":"4527b516ec059f7d327bac620819f09a07bb29a2","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"- name: Create the node backup"},{"line_number":36,"context_line":"  become: true"},{"line_number":37,"context_line":"  command: rear {{ \u0027-s \u0027 if \"{{ tripleo_backup_and_restore_rear_simulate }}\" else \u0027\u0027 }}-d -v mkbackup"},{"line_number":38,"context_line":"  register: tripleo_backup_and_restore_rear_output"},{"line_number":39,"context_line":"  when: tripleo_backup_and_restore_rear_output is undefined"},{"line_number":40,"context_line":"  tags:"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3fa7e38b_2ee02493","line":37,"in_reply_to":"3fa7e38b_b34f9b8b","updated":"2020-02-11 10:15:50.000000000","message":"It fails because you dont have rear :) in any case, this bug is invalid.","commit_id":"549df09fb0c462e8c358cab18c4496b1aab26346"},{"author":{"_account_id":26343,"name":"Jose Luis Franco","email":"jfrancoa@redhat.com","username":"jfrancoa"},"change_message_id":"ab662072d8ed2a98a7cf2a6496d421dfde6270ec","unresolved":false,"context_lines":[{"line_number":36,"context_line":"  become: true"},{"line_number":37,"context_line":"  command: rear {{ \u0027-s \u0027 if \"{{ tripleo_backup_and_restore_rear_simulate }}\" else \u0027\u0027 }}-d -v mkbackup"},{"line_number":38,"context_line":"  register: tripleo_backup_and_restore_rear_output"},{"line_number":39,"context_line":"  when: tripleo_backup_and_restore_rear_output is undefined"},{"line_number":40,"context_line":"  tags:"},{"line_number":41,"context_line":"    - bar_create_recover_image"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3fa7e38b_730e0390","line":39,"updated":"2020-02-11 09:22:54.000000000","message":"This doesn\u0027t make much sense to me..as this is a variable, it\u0027s not a fact so unless you are running this in a loop it will always be undefined.","commit_id":"549df09fb0c462e8c358cab18c4496b1aab26346"}]}
