@staticmethod
def generate_mount_disks_tasks(system):
    """
        Generate a set of tasks to format and mount the specified disks
        """
    res = ''
    cont = 1
    while system.getValue('disk.' + str(cont) + '.size') or system.getValue(
        'disk.' + str(cont) + '.image.url'):
        disk_device = system.getValue('disk.' + str(cont) + '.device')
        if disk_device:
            disk_mount_path = system.getValue('disk.' + str(cont) +
                '.mount_path')
            disk_fstype = system.getValue('disk.' + str(cont) + '.fstype')
            if disk_mount_path and disk_fstype:
                res += '  - include: utils/tasks/disk_format_mount.yml\n'
                res += '    vars:\n'
                res += '      device: "/dev/{{item.key}}"\n'
                res += '      mount_path: "' + disk_mount_path + '"\n'
                res += '      fstype: "' + disk_fstype + '"\n'
                res += "    with_dict: '{{ ansible_devices }}'\n"
                res += "    when: ansible_os_family != 'Windows' and ("
                res += "item.key.endswith('d%s') or " % disk_device[-1]
                res += "item.key.startswith('nvme%sn1')" % (ord(disk_device
                    [-1]) - 97)
                res += ')\n'
        cont += 1
    return res
