)]}'
{"multi-node-aio/playbooks/setup-host.yml":[{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"315eb399f8ce3282edb6a5f1551ecffabceba95f","unresolved":false,"context_lines":[{"line_number":287,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":288,"context_line":"      register: virt_data_volume"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    - debug: var\u003dvirt_data_volume"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"    - name: Create /etc/libvirt/storage directory"},{"line_number":293,"context_line":"      file:"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_0e9dcd55","line":290,"range":{"start_line":290,"start_character":0,"end_line":290,"end_character":33},"updated":"2018-06-27 06:53:57.000000000","message":"Is this left here on purpose? It looks like it was used for debugging?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":7414,"name":"David Wilde","email":"dwilde@redhat.com","username":"d34dh0r53"},"change_message_id":"169a47ca812ba77e4a5b875976adc54653aed41e","unresolved":false,"context_lines":[{"line_number":287,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":288,"context_line":"      register: virt_data_volume"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    - debug: var\u003dvirt_data_volume"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"    - name: Create /etc/libvirt/storage directory"},{"line_number":293,"context_line":"      file:"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_fc4fe6ba","line":290,"range":{"start_line":290,"start_character":0,"end_line":290,"end_character":33},"in_reply_to":"5f7c97a3_0e9dcd55","updated":"2018-06-27 12:28:20.000000000","message":"No, good catch","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"315eb399f8ce3282edb6a5f1551ecffabceba95f","unresolved":false,"context_lines":[{"line_number":298,"context_line":"      virt_pool:"},{"line_number":299,"context_line":"        command: create"},{"line_number":300,"context_line":"        name: vg01"},{"line_number":301,"context_line":"      ignore_errors: true"},{"line_number":302,"context_line":"      when:"},{"line_number":303,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":304,"context_line":"        - virt_data_volume.pools is not defined"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_6eb7a1d9","line":301,"range":{"start_line":301,"start_character":0,"end_line":301,"end_character":25},"updated":"2018-06-27 06:53:57.000000000","message":"Why do we ignore errors here?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"1e074fb03f76a78633c5ed65f4426f89c1db9c12","unresolved":false,"context_lines":[{"line_number":298,"context_line":"      virt_pool:"},{"line_number":299,"context_line":"        command: create"},{"line_number":300,"context_line":"        name: vg01"},{"line_number":301,"context_line":"      ignore_errors: true"},{"line_number":302,"context_line":"      when:"},{"line_number":303,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":304,"context_line":"        - virt_data_volume.pools is not defined"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_f7c94178","line":301,"range":{"start_line":301,"start_character":0,"end_line":301,"end_character":25},"in_reply_to":"5f7c97a3_5c613a38","updated":"2018-06-27 12:48:31.000000000","message":"So the module isn\u0027t great. Could we check if it exists somehow then only do this create task if it doesn\u0027t?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":7414,"name":"David Wilde","email":"dwilde@redhat.com","username":"d34dh0r53"},"change_message_id":"169a47ca812ba77e4a5b875976adc54653aed41e","unresolved":false,"context_lines":[{"line_number":298,"context_line":"      virt_pool:"},{"line_number":299,"context_line":"        command: create"},{"line_number":300,"context_line":"        name: vg01"},{"line_number":301,"context_line":"      ignore_errors: true"},{"line_number":302,"context_line":"      when:"},{"line_number":303,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":304,"context_line":"        - virt_data_volume.pools is not defined"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_5c613a38","line":301,"range":{"start_line":301,"start_character":0,"end_line":301,"end_character":25},"in_reply_to":"5f7c97a3_6eb7a1d9","updated":"2018-06-27 12:28:20.000000000","message":"In case it already exists.","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"315eb399f8ce3282edb6a5f1551ecffabceba95f","unresolved":false,"context_lines":[{"line_number":294,"context_line":"        path: \"/etc/libvirt/storage/\""},{"line_number":295,"context_line":"        state: \"directory\""},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    - name: Create virt data volume"},{"line_number":298,"context_line":"      virt_pool:"},{"line_number":299,"context_line":"        command: create"},{"line_number":300,"context_line":"        name: vg01"},{"line_number":301,"context_line":"      ignore_errors: true"},{"line_number":302,"context_line":"      when:"},{"line_number":303,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":304,"context_line":"        - virt_data_volume.pools is not defined"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    - name: Get virt data volume xml"},{"line_number":307,"context_line":"      virt_pool:"},{"line_number":308,"context_line":"        command: get_xml"},{"line_number":309,"context_line":"        name: vg01"},{"line_number":310,"context_line":"      register: virt_pool_xml"},{"line_number":311,"context_line":"      when:"},{"line_number":312,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":313,"context_line":"        - virt_data_volume.pools is not defined"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"    - name: Write data volume xml"},{"line_number":316,"context_line":"      copy:"},{"line_number":317,"context_line":"        content: \"{{ virt_pool_xml.get_xml }}\""},{"line_number":318,"context_line":"        dest: \"/etc/libvirt/storage/vg01.xml\""},{"line_number":319,"context_line":"      when:"},{"line_number":320,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":321,"context_line":"        - virt_data_volume.pools is not defined"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    - name: Define virt data volume"},{"line_number":324,"context_line":"      virt_pool:"},{"line_number":325,"context_line":"        command: define"},{"line_number":326,"context_line":"        name: vg01"},{"line_number":327,"context_line":"        xml: \"/etc/libvirt/storage/vg01.xml\""},{"line_number":328,"context_line":"        autostart: true"},{"line_number":329,"context_line":"      when:"},{"line_number":330,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":331,"context_line":"        - virt_data_volume.pools is not defined"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    - name: Load virtio kernel modules"},{"line_number":334,"context_line":"      shell: |"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_eecad14c","line":331,"range":{"start_line":297,"start_character":0,"end_line":331,"end_character":47},"updated":"2018-06-27 06:53:57.000000000","message":"Given that these all share the same condition, could we move them into a block?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":7414,"name":"David Wilde","email":"dwilde@redhat.com","username":"d34dh0r53"},"change_message_id":"580aae65577e67623c96662f70633fec23d3eba6","unresolved":false,"context_lines":[{"line_number":294,"context_line":"        path: \"/etc/libvirt/storage/\""},{"line_number":295,"context_line":"        state: \"directory\""},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    - name: Create virt data volume"},{"line_number":298,"context_line":"      virt_pool:"},{"line_number":299,"context_line":"        command: create"},{"line_number":300,"context_line":"        name: vg01"},{"line_number":301,"context_line":"      ignore_errors: true"},{"line_number":302,"context_line":"      when:"},{"line_number":303,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":304,"context_line":"        - virt_data_volume.pools is not defined"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    - name: Get virt data volume xml"},{"line_number":307,"context_line":"      virt_pool:"},{"line_number":308,"context_line":"        command: get_xml"},{"line_number":309,"context_line":"        name: vg01"},{"line_number":310,"context_line":"      register: virt_pool_xml"},{"line_number":311,"context_line":"      when:"},{"line_number":312,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":313,"context_line":"        - virt_data_volume.pools is not defined"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"    - name: Write data volume xml"},{"line_number":316,"context_line":"      copy:"},{"line_number":317,"context_line":"        content: \"{{ virt_pool_xml.get_xml }}\""},{"line_number":318,"context_line":"        dest: \"/etc/libvirt/storage/vg01.xml\""},{"line_number":319,"context_line":"      when:"},{"line_number":320,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":321,"context_line":"        - virt_data_volume.pools is not defined"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    - name: Define virt data volume"},{"line_number":324,"context_line":"      virt_pool:"},{"line_number":325,"context_line":"        command: define"},{"line_number":326,"context_line":"        name: vg01"},{"line_number":327,"context_line":"        xml: \"/etc/libvirt/storage/vg01.xml\""},{"line_number":328,"context_line":"        autostart: true"},{"line_number":329,"context_line":"      when:"},{"line_number":330,"context_line":"        - default_vm_disk_mode | default(\u0027lvm\u0027) \u003d\u003d \"lvm\""},{"line_number":331,"context_line":"        - virt_data_volume.pools is not defined"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    - name: Load virtio kernel modules"},{"line_number":334,"context_line":"      shell: |"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_9c02720b","line":331,"range":{"start_line":297,"start_character":0,"end_line":331,"end_character":47},"in_reply_to":"5f7c97a3_eecad14c","updated":"2018-06-27 12:34:09.000000000","message":"Yes","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"}],"multi-node-aio/playbooks/vm-status.yml":[{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"68edcd72631685c76c69909846796ae3616d925b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"5f7c97a3_2e57695c","updated":"2018-06-27 07:04:57.000000000","message":"Where does this playbook get used? I might be missing something, but I\u0027m not seeing it included anywhere?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":7414,"name":"David Wilde","email":"dwilde@redhat.com","username":"d34dh0r53"},"change_message_id":"169a47ca812ba77e4a5b875976adc54653aed41e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"5f7c97a3_9cdfd2d5","in_reply_to":"5f7c97a3_2e57695c","updated":"2018-06-27 12:28:20.000000000","message":"The import_playbook line was accidentally removed in my last rebsae","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"315eb399f8ce3282edb6a5f1551ecffabceba95f","unresolved":false,"context_lines":[{"line_number":29,"context_line":"  hosts: vm_servers"},{"line_number":30,"context_line":"  gather_facts: false"},{"line_number":31,"context_line":"  tasks:"},{"line_number":32,"context_line":"    - name: VM Connectivity Check"},{"line_number":33,"context_line":"      block:"},{"line_number":34,"context_line":"        - name: Wait for VM"},{"line_number":35,"context_line":"          wait_for:"},{"line_number":36,"context_line":"            host: \"{{ ansible_host }}\""},{"line_number":37,"context_line":"            connect_timeout: 10"},{"line_number":38,"context_line":"            port: 22"},{"line_number":39,"context_line":"            sleep: 20"},{"line_number":40,"context_line":"            timeout: \"{{ vm_ssh_timeout }}\""},{"line_number":41,"context_line":"            state: started"},{"line_number":42,"context_line":"            search_regex: OpenSSH"},{"line_number":43,"context_line":"          connection: local"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"      rescue:"},{"line_number":46,"context_line":"        - name: Attempt to rescue VM"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_0ecb8d49","line":43,"range":{"start_line":32,"start_character":0,"end_line":43,"end_character":27},"updated":"2018-06-27 06:53:57.000000000","message":"Would it be better to use wait_for_connection here?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"68edcd72631685c76c69909846796ae3616d925b","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            command: start"},{"line_number":52,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":53,"context_line":"          connection: local"},{"line_number":54,"context_line":"          changed_when: true"},{"line_number":55,"context_line":"          notify: final check"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"  handlers:"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_6ec6c118","line":54,"range":{"start_line":54,"start_character":10,"end_line":54,"end_character":28},"updated":"2018-06-27 07:04:57.000000000","message":"Why set changed_when to true here? Won\u0027t the module set the status accordingly?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":7414,"name":"David Wilde","email":"dwilde@redhat.com","username":"d34dh0r53"},"change_message_id":"169a47ca812ba77e4a5b875976adc54653aed41e","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            command: start"},{"line_number":52,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":53,"context_line":"          connection: local"},{"line_number":54,"context_line":"          changed_when: true"},{"line_number":55,"context_line":"          notify: final check"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"  handlers:"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_5ceffa85","line":54,"range":{"start_line":54,"start_character":10,"end_line":54,"end_character":28},"in_reply_to":"5f7c97a3_6ec6c118","updated":"2018-06-27 12:28:20.000000000","message":"Yes, that can be removed.","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"315eb399f8ce3282edb6a5f1551ecffabceba95f","unresolved":false,"context_lines":[{"line_number":43,"context_line":"          connection: local"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"      rescue:"},{"line_number":46,"context_line":"        - name: Attempt to rescue VM"},{"line_number":47,"context_line":"          virt:"},{"line_number":48,"context_line":"            command: destroy"},{"line_number":49,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":50,"context_line":"          virt:"},{"line_number":51,"context_line":"            command: start"},{"line_number":52,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":53,"context_line":"          connection: local"},{"line_number":54,"context_line":"          changed_when: true"},{"line_number":55,"context_line":"          notify: final check"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"  handlers:"},{"line_number":58,"context_line":"    - name: final check"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_8edf9d0a","line":55,"range":{"start_line":46,"start_character":0,"end_line":55,"end_character":29},"updated":"2018-06-27 06:53:57.000000000","message":"Is this supposed to be two tasks?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"1e074fb03f76a78633c5ed65f4426f89c1db9c12","unresolved":false,"context_lines":[{"line_number":43,"context_line":"          connection: local"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"      rescue:"},{"line_number":46,"context_line":"        - name: Attempt to rescue VM"},{"line_number":47,"context_line":"          virt:"},{"line_number":48,"context_line":"            command: destroy"},{"line_number":49,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":50,"context_line":"          virt:"},{"line_number":51,"context_line":"            command: start"},{"line_number":52,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":53,"context_line":"          connection: local"},{"line_number":54,"context_line":"          changed_when: true"},{"line_number":55,"context_line":"          notify: final check"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"  handlers:"},{"line_number":58,"context_line":"    - name: final check"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_37a9f98d","line":55,"range":{"start_line":46,"start_character":0,"end_line":55,"end_character":29},"in_reply_to":"5f7c97a3_1c9ae211","updated":"2018-06-27 12:48:31.000000000","message":"I mean is \u0027virt - command - destroy\u0027 and \u0027virt - command - start\u0027 meant to be two tasks?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":7414,"name":"David Wilde","email":"dwilde@redhat.com","username":"d34dh0r53"},"change_message_id":"169a47ca812ba77e4a5b875976adc54653aed41e","unresolved":false,"context_lines":[{"line_number":43,"context_line":"          connection: local"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"      rescue:"},{"line_number":46,"context_line":"        - name: Attempt to rescue VM"},{"line_number":47,"context_line":"          virt:"},{"line_number":48,"context_line":"            command: destroy"},{"line_number":49,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":50,"context_line":"          virt:"},{"line_number":51,"context_line":"            command: start"},{"line_number":52,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":53,"context_line":"          connection: local"},{"line_number":54,"context_line":"          changed_when: true"},{"line_number":55,"context_line":"          notify: final check"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"  handlers:"},{"line_number":58,"context_line":"    - name: final check"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_1c9ae211","line":55,"range":{"start_line":46,"start_character":0,"end_line":55,"end_character":29},"in_reply_to":"5f7c97a3_8edf9d0a","updated":"2018-06-27 12:28:20.000000000","message":"I\u0027m not sure what you mean here, the rescue block restarts the VM if it fails in the block and then notifies the handler to do a final check.","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"315eb399f8ce3282edb6a5f1551ecffabceba95f","unresolved":false,"context_lines":[{"line_number":54,"context_line":"          changed_when: true"},{"line_number":55,"context_line":"          notify: final check"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"  handlers:"},{"line_number":58,"context_line":"    - name: final check"},{"line_number":59,"context_line":"      wait_for:"},{"line_number":60,"context_line":"        host: \"{{ ansible_host }}\""},{"line_number":61,"context_line":"        connect_timeout: 10"},{"line_number":62,"context_line":"        port: 22"},{"line_number":63,"context_line":"        sleep: 20"},{"line_number":64,"context_line":"        timeout: \"{{ vm_ssh_timeout }}\""},{"line_number":65,"context_line":"        state: started"},{"line_number":66,"context_line":"        search_regex: OpenSSH"},{"line_number":67,"context_line":"      connection: local"},{"line_number":68,"context_line":"      any_errors_fatal: true"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_4efe656a","line":68,"range":{"start_line":57,"start_character":0,"end_line":68,"end_character":28},"updated":"2018-06-27 06:53:57.000000000","message":"Why a handler? Why not an \u0027always\u0027 task? Also, would wait_for_connection be better here?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":7414,"name":"David Wilde","email":"dwilde@redhat.com","username":"d34dh0r53"},"change_message_id":"169a47ca812ba77e4a5b875976adc54653aed41e","unresolved":false,"context_lines":[{"line_number":54,"context_line":"          changed_when: true"},{"line_number":55,"context_line":"          notify: final check"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"  handlers:"},{"line_number":58,"context_line":"    - name: final check"},{"line_number":59,"context_line":"      wait_for:"},{"line_number":60,"context_line":"        host: \"{{ ansible_host }}\""},{"line_number":61,"context_line":"        connect_timeout: 10"},{"line_number":62,"context_line":"        port: 22"},{"line_number":63,"context_line":"        sleep: 20"},{"line_number":64,"context_line":"        timeout: \"{{ vm_ssh_timeout }}\""},{"line_number":65,"context_line":"        state: started"},{"line_number":66,"context_line":"        search_regex: OpenSSH"},{"line_number":67,"context_line":"      connection: local"},{"line_number":68,"context_line":"      any_errors_fatal: true"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_5c193a85","line":68,"range":{"start_line":57,"start_character":0,"end_line":68,"end_character":28},"in_reply_to":"5f7c97a3_4efe656a","updated":"2018-06-27 12:28:20.000000000","message":"I\u0027ll test out wait_for_connection.\n\nThis is not an \u0027always\u0027 block because I only want this to run if a VM fails the initial check.  If the first SSH connection check fails to a VM the rescue block is run which restarts the VM, then this handler is run to see if the VM comes back up.  This is primarily because a rescue block always sets the playbook status as success regardless, it will still print the errors but the internal status code is success.   This negates any type of retries or failed_when so we have to do something like this.","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"1e074fb03f76a78633c5ed65f4426f89c1db9c12","unresolved":false,"context_lines":[{"line_number":54,"context_line":"          changed_when: true"},{"line_number":55,"context_line":"          notify: final check"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"  handlers:"},{"line_number":58,"context_line":"    - name: final check"},{"line_number":59,"context_line":"      wait_for:"},{"line_number":60,"context_line":"        host: \"{{ ansible_host }}\""},{"line_number":61,"context_line":"        connect_timeout: 10"},{"line_number":62,"context_line":"        port: 22"},{"line_number":63,"context_line":"        sleep: 20"},{"line_number":64,"context_line":"        timeout: \"{{ vm_ssh_timeout }}\""},{"line_number":65,"context_line":"        state: started"},{"line_number":66,"context_line":"        search_regex: OpenSSH"},{"line_number":67,"context_line":"      connection: local"},{"line_number":68,"context_line":"      any_errors_fatal: true"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"5f7c97a3_9799ed7a","line":68,"range":{"start_line":57,"start_character":0,"end_line":68,"end_character":28},"in_reply_to":"5f7c97a3_5c193a85","updated":"2018-06-27 12:48:31.000000000","message":"Oh, would it perhaps make sense to have this final check be done as a task in the rescue block instead of a handler?","commit_id":"a6fe13170f10696477fb6a5c3da73901eded973f"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"3a097b75ce976d0f359abfe210b4bcaa61d93135","unresolved":false,"context_lines":[{"line_number":43,"context_line":"          virt:"},{"line_number":44,"context_line":"            command: destroy"},{"line_number":45,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":46,"context_line":"          virt:"},{"line_number":47,"context_line":"            command: start"},{"line_number":48,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":49,"context_line":"          connection: local"},{"line_number":50,"context_line":"          changed_when: true"},{"line_number":51,"context_line":"          notify: final check"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"5f7c97a3_5eb9297a","line":48,"range":{"start_line":46,"start_character":0,"end_line":48,"end_character":44},"updated":"2018-06-27 16:15:18.000000000","message":"I\u0027m still confused about executing this again under a single task. This looks like another task.","commit_id":"ca29853b28a721c1dab455006b0247d2fa66898a"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"3a097b75ce976d0f359abfe210b4bcaa61d93135","unresolved":false,"context_lines":[{"line_number":51,"context_line":"          notify: final check"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"  handlers:"},{"line_number":54,"context_line":"    - name: final check"},{"line_number":55,"context_line":"      wait_for_connection:"},{"line_number":56,"context_line":"        connect_timeout: 10"},{"line_number":57,"context_line":"        port: 22"},{"line_number":58,"context_line":"        sleep: 20"},{"line_number":59,"context_line":"        timeout: \"{{ vm_ssh_timeout }}\""},{"line_number":60,"context_line":"      any_errors_fatal: true"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"5f7c97a3_3eb8ed73","line":60,"range":{"start_line":54,"start_character":0,"end_line":60,"end_character":28},"updated":"2018-06-27 16:15:18.000000000","message":"nit: This could just be another task under the rescue, but I guess a handler is fine too.","commit_id":"ca29853b28a721c1dab455006b0247d2fa66898a"},{"author":{"_account_id":7414,"name":"David Wilde","email":"dwilde@redhat.com","username":"d34dh0r53"},"change_message_id":"ca39e50c1ff3bb4f162f7b1a746825450c69bdfa","unresolved":false,"context_lines":[{"line_number":51,"context_line":"          notify: final check"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"  handlers:"},{"line_number":54,"context_line":"    - name: final check"},{"line_number":55,"context_line":"      wait_for_connection:"},{"line_number":56,"context_line":"        connect_timeout: 10"},{"line_number":57,"context_line":"        port: 22"},{"line_number":58,"context_line":"        sleep: 20"},{"line_number":59,"context_line":"        timeout: \"{{ vm_ssh_timeout }}\""},{"line_number":60,"context_line":"      any_errors_fatal: true"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"5f7c97a3_891a297a","line":60,"range":{"start_line":54,"start_character":0,"end_line":60,"end_character":28},"in_reply_to":"5f7c97a3_3eb8ed73","updated":"2018-06-27 16:51:42.000000000","message":"I tried this but the way the handler sets the error status of the play means that execution will continue even if the VM fails both checks.  This is bad because it will just push an eventual failure down the line, wasting gate resources.","commit_id":"ca29853b28a721c1dab455006b0247d2fa66898a"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"c88c8449fb8afd0909b5f859fc94025677069313","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            timeout: \"{{ vm_ssh_timeout }}\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"      rescue:"},{"line_number":42,"context_line":"        - name: Attempt to rescue VM (Stop)"},{"line_number":43,"context_line":"          virt:"},{"line_number":44,"context_line":"            command: destroy"},{"line_number":45,"context_line":"            name: \"{{ inventory_hostname }}\""}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_24ee9c21","line":42,"range":{"start_line":42,"start_character":0,"end_line":42,"end_character":43},"updated":"2018-06-27 16:58:39.000000000","message":"Does this task also need a local connection?","commit_id":"1ece828db425894c806ffe7e04900d8cc88cf772"},{"author":{"_account_id":7414,"name":"David Wilde","email":"dwilde@redhat.com","username":"d34dh0r53"},"change_message_id":"0e9fe98760250dc6596e8d95f7b6d3fff7859f61","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            timeout: \"{{ vm_ssh_timeout }}\""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"      rescue:"},{"line_number":42,"context_line":"        - name: Attempt to rescue VM (Stop)"},{"line_number":43,"context_line":"          virt:"},{"line_number":44,"context_line":"            command: destroy"},{"line_number":45,"context_line":"            name: \"{{ inventory_hostname }}\""}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_24ad3c84","line":42,"range":{"start_line":42,"start_character":0,"end_line":42,"end_character":43},"in_reply_to":"5f7c97a3_24ee9c21","updated":"2018-06-27 17:09:07.000000000","message":"Good catch","commit_id":"1ece828db425894c806ffe7e04900d8cc88cf772"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"c88c8449fb8afd0909b5f859fc94025677069313","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            command: start"},{"line_number":49,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":50,"context_line":"          connection: local"},{"line_number":51,"context_line":"          changed_when: true"},{"line_number":52,"context_line":"          notify: final check"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"  handlers:"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_64e49443","line":51,"range":{"start_line":51,"start_character":0,"end_line":51,"end_character":28},"updated":"2018-06-27 16:58:39.000000000","message":"Is this necessary? Surely the module will return the right state?","commit_id":"1ece828db425894c806ffe7e04900d8cc88cf772"},{"author":{"_account_id":7414,"name":"David Wilde","email":"dwilde@redhat.com","username":"d34dh0r53"},"change_message_id":"0e9fe98760250dc6596e8d95f7b6d3fff7859f61","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            command: start"},{"line_number":49,"context_line":"            name: \"{{ inventory_hostname }}\""},{"line_number":50,"context_line":"          connection: local"},{"line_number":51,"context_line":"          changed_when: true"},{"line_number":52,"context_line":"          notify: final check"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"  handlers:"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"5f7c97a3_4499586b","line":51,"range":{"start_line":51,"start_character":0,"end_line":51,"end_character":28},"in_reply_to":"5f7c97a3_64e49443","updated":"2018-06-27 17:09:07.000000000","message":"Yeah, I can get rid of that","commit_id":"1ece828db425894c806ffe7e04900d8cc88cf772"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"d8728a3cfec325f653a6f62838a572df60cab1e0","unresolved":false,"context_lines":[{"line_number":51,"context_line":"          connection: local"},{"line_number":52,"context_line":"          notify: final check"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"  handlers:"},{"line_number":55,"context_line":"    - name: final check"},{"line_number":56,"context_line":"      wait_for_connection:"},{"line_number":57,"context_line":"        connect_timeout: 10"},{"line_number":58,"context_line":"        port: 22"},{"line_number":59,"context_line":"        sleep: 20"},{"line_number":60,"context_line":"        timeout: \"{{ vm_ssh_timeout }}\""},{"line_number":61,"context_line":"      any_errors_fatal: true"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"5f7c97a3_25fbe3be","line":61,"range":{"start_line":54,"start_character":0,"end_line":61,"end_character":28},"updated":"2018-06-28 12:31:42.000000000","message":"This handler doesn\u0027t fire in time. To make it work you\u0027d have to add another task to the play to force fire all handlers.\n\nI made the following changes including a deliberate fail for a single host and it works like a charm. Obviously you\u0027ll want to remove the deliberate fail task for the final proposed review:\n\n diff --git a/multi-node-aio/playbooks/vm-status.yml b/multi-node-aio/playbooks/vm-status.yml\n index 4e5529e..3059e33 100644\n --- a/multi-node-aio/playbooks/vm-status.yml \n +++ b/multi-node-aio/playbooks/vm-status.yml\n @@ -28,9 +28,16 @@\n  - name: VM Status\n    hosts: vm_servers\n    gather_facts: false\n +  any_errors_fatal: true\n    tasks:\n      - name: VM Connectivity Check\n        block:\n +\n +        - fail:\n +            msg: \"deliberate fail\"\n +          when:\n +            - \"inventory_hostname \u003d\u003d \u0027cinder1\u0027\"\n +\n          - name: Wait for VM\n            wait_for_connection:\n              connect_timeout: 10\n @@ -39,23 +46,21 @@\n              timeout: \"{{ vm_ssh_timeout }}\"\n\n        rescue:\n -        - name: Attempt to rescue VM (Stop)\n +        - name: Stop VM (rescue)\n            virt:\n              command: destroy\n              name: \"{{ inventory_hostname }}\"\n            connection: local\n -        - name: Attempt to rescue VM (Start)\n +\n +        - name: Start VM (rescue)\n            virt:\n              command: start\n              name: \"{{ inventory_hostname }}\"\n            connection: local\n -          notify: final check\n\n -  handlers:\n -    - name: final check\n -      wait_for_connection:\n -        connect_timeout: 10\n -        port: 22\n -        sleep: 20\n -        timeout: \"{{ vm_ssh_timeout }}\"\n -      any_errors_fatal: true\n +        - name: Wait for VM (rescue)\n +          wait_for_connection:\n +            connect_timeout: 10\n +            port: 22\n +            sleep: 20\n +            timeout: \"{{ vm_ssh_timeout }}\"","commit_id":"d2edf93d3365d7ba055e739c415806394324160d"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"e9efee4571e6450f723df6f7a63b372bc20d2ed8","unresolved":false,"context_lines":[{"line_number":51,"context_line":"          connection: local"},{"line_number":52,"context_line":"          notify: final check"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"  handlers:"},{"line_number":55,"context_line":"    - name: final check"},{"line_number":56,"context_line":"      wait_for_connection:"},{"line_number":57,"context_line":"        connect_timeout: 10"},{"line_number":58,"context_line":"        port: 22"},{"line_number":59,"context_line":"        sleep: 20"},{"line_number":60,"context_line":"        timeout: \"{{ vm_ssh_timeout }}\""},{"line_number":61,"context_line":"      any_errors_fatal: true"}],"source_content_type":"text/x-yaml","patch_set":6,"id":"5f7c97a3_e5140ba2","line":61,"range":{"start_line":54,"start_character":0,"end_line":61,"end_character":28},"in_reply_to":"5f7c97a3_25fbe3be","updated":"2018-06-28 12:40:52.000000000","message":"I could probably have been clearer when I said it didn\u0027t work because the handler fires too late.\n\nEssentially the handler fires at the end of a \u0027playbook\u0027 run, not the \u0027play\u0027 run. The \u0027play\u0027 ends here, but due to the use of the include in \u0027deploy-vms.yml\u0027 (which is the \u0027playbook\u0027) the notifier from this play will only execute at the end of the whole of deploy-vms.yml. What happens if there\u0027s a fail/rescue is that the rescue does it\u0027s thing, but there\u0027s no wait for connection happening... so the playbook fails at \u0027Copy Host Keys\u0027 two plays later.\n\nHTH to clarify what I meant and why I suggest the above approach instead (it\u0027s an in-line wait, with any_errors_fatal for the whole play).","commit_id":"d2edf93d3365d7ba055e739c415806394324160d"}]}
