deploy/ansible/roles-os/1.17-generic-pacemaker/tasks/1.17.1.2-sbd.yaml [143:236]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      loop:                                 "{{ sbdMap }}"
      loop_control:
        loop_var:                           sdbMap_entry
        index_var:                          sdbMap_index
      # vars:
      #   _step:                              "deviceUpdate"
    # Step: 03 - END
    # -------------------------------------+---------------------------------------8

    - name:                                       "Update Device Info: Show SBD Dictionary..."
      ansible.builtin.debug:
        var:                                      sbdMap
        verbosity:                                2


    # /*------------------------------------
    # |
    # | create sbd devices
    # |
    # +------------------------------------4
    - name:                                       "dump SBD Device(s)..."
      ansible.builtin.command:                    "sbd
                                                  {%- for entry in sbdMap             +%}
                                                  -d {{ entry.diskById                }}
                                                  {%- endfor                          +%}
                                                  dump
                                                  "
      ignore_errors:                              true
      register:                                   sbdDumpCommand_results
      run_once:                                   true                                            # run on only one host in play

    - name:                                       "Show dump SBD device(s) results..."
      ansible.builtin.debug:
        var:                                      sbdDumpCommand_results
        verbosity:                                2
      run_once:                                   true                                            # run on only one host in play

    - name:                                       "create SBD Device(s)..."
      block:

        - name:                                   "create SBD Device(s)..."
          ansible.builtin.command:                "sbd
                                                  {%- for entry in sbdMap             +%}
                                                  -d {{ entry.diskById                }}
                                                  {%- endfor                          +%}
                                                  -1 60 -4 120 create
                                                  "
          register:                               sbdCreateCommand_results


        - name:                                   "Show block device results..."
          ansible.builtin.debug:
            var:                                  sbdCreateCommand_results
            verbosity:                            2

      run_once:                                   true                                            # run on only one host in play
      when:                                       sbdDumpCommand_results.rc == 1


    # /*------------------------------------
    # |
    # | sbd config file
    # |
    # +------------------------------------4
    # Type: string
    # Default: ""
    #
    # SBD_DEVICE specifies the devices to use for exchanging sbd messages
    # and to monitor. If specifying more than one path, use ";" as
    # separator.
    # SBD_DEVICE="/dev/sdb1;/dev/sdc1;/dev/sdc2"
    #
    # SBD_DEVICE=""
    - name:                                   "SBD config file"
      ansible.builtin.lineinfile:
        path:                                 /etc/sysconfig/sbd
        regexp:                               "{{ item.regexp }}"
        line:                                 "{{ item.line }}"
        owner:                                root
        group:                                root
        mode:                                 '0644'
        backup:                               true
      loop:
        - { regexp: "^SBD_PACEMAKER=.*",  line: 'SBD_PACEMAKER=yes'     }
        - { regexp: "^SBD_STARTMODE=.*",  line: 'SBD_STARTMODE=always'  }
        # Format line as so:
        #   SBD_DEVICE="/dev/disk/by-id/scsi-3600224804208a67da8073b2a9728af19"
        #   SBD_DEVICE="/dev/disk/by-id/scsi-360022480ef971a6c5759f2dc3adf4c96;/dev/disk/by-id/scsi-360022480ea4064ac4952ea8452d66317"
        - { regexp: "^SBD_DEVICE=.*",     line: 'SBD_DEVICE="
                                                            {%- for entry in sbdMap              %}
                                                            {%-   if loop.index > 1 %};{% endif -%}
                                                            {{    entry.diskById                 }}
                                                            {%- endfor                          -%}
                                                            "'}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



deploy/ansible/roles-os/1.18-scaleout-pacemaker/tasks/1.18.1.2-sbd.yaml [132:225]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      loop:                                 "{{ sbdMap }}"
      loop_control:
        loop_var:                           sdbMap_entry
        index_var:                          sdbMap_index
      # vars:
      #   _step:                              "deviceUpdate"
    # Step: 03 - END
    # -------------------------------------+---------------------------------------8

    - name:                                       "Update Device Info: Show SBD Dictionary..."
      ansible.builtin.debug:
        var:                                      sbdMap
        verbosity:                                2


    # /*------------------------------------
    # |
    # | create sbd devices
    # |
    # +------------------------------------4
    - name:                                       "dump SBD Device(s)..."
      ansible.builtin.command:                    "sbd
                                                  {%- for entry in sbdMap             +%}
                                                  -d {{ entry.diskById                }}
                                                  {%- endfor                          +%}
                                                  dump
                                                  "
      ignore_errors:                              true
      register:                                   sbdDumpCommand_results
      run_once:                                   true                                            # run on only one host in play

    - name:                                       "Show dump SBD device(s) results..."
      ansible.builtin.debug:
        var:                                      sbdDumpCommand_results
        verbosity:                                2
      run_once:                                   true                                            # run on only one host in play

    - name:                                       "create SBD Device(s)..."
      block:

        - name:                                   "create SBD Device(s)..."
          ansible.builtin.command:                "sbd
                                                  {%- for entry in sbdMap             +%}
                                                  -d {{ entry.diskById                }}
                                                  {%- endfor                          +%}
                                                  -1 60 -4 120 create
                                                  "
          register:                               sbdCreateCommand_results


        - name:                                   "Show block device results..."
          ansible.builtin.debug:
            var:                                  sbdCreateCommand_results
            verbosity:                            2

      run_once:                                   true                                            # run on only one host in play
      when:                                       sbdDumpCommand_results.rc == 1


    # /*------------------------------------
    # |
    # | sbd config file
    # |
    # +------------------------------------4
    # Type: string
    # Default: ""
    #
    # SBD_DEVICE specifies the devices to use for exchanging sbd messages
    # and to monitor. If specifying more than one path, use ";" as
    # separator.
    # SBD_DEVICE="/dev/sdb1;/dev/sdc1;/dev/sdc2"
    #
    # SBD_DEVICE=""
    - name:                                   "SBD config file"
      ansible.builtin.lineinfile:
        path:                                 /etc/sysconfig/sbd
        regexp:                               "{{ item.regexp }}"
        line:                                 "{{ item.line }}"
        owner:                                root
        group:                                root
        mode:                                 '0644'
        backup:                               true
      loop:
        - { regexp: "^SBD_PACEMAKER=.*",  line: 'SBD_PACEMAKER=yes'     }
        - { regexp: "^SBD_STARTMODE=.*",  line: 'SBD_STARTMODE=always'  }
        # Format line as so:
        #   SBD_DEVICE="/dev/disk/by-id/scsi-3600224804208a67da8073b2a9728af19"
        #   SBD_DEVICE="/dev/disk/by-id/scsi-360022480ef971a6c5759f2dc3adf4c96;/dev/disk/by-id/scsi-360022480ea4064ac4952ea8452d66317"
        - { regexp: "^SBD_DEVICE=.*",     line: 'SBD_DEVICE="
                                                            {%- for entry in sbdMap              %}
                                                            {%-   if loop.index > 1 %};{% endif -%}
                                                            {{    entry.diskById                 }}
                                                            {%- endfor                          -%}
                                                            "'}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



