Q:

How to trigger Ansible Play for every iteration of a loop

Below registered variable command_result gets records from the database which could be multi-line.
The below helps me loop over each record of the database in the command_result variable.
   - debug:
       msg: "This is a database line: {{ item }}"
     with_items: "{{ command_result.stdout_lines }}"

What I, now, need is to trigger a fresh play like below for every loop iteration along with the respective {{ item }}.
- hosts: "{{ item.stdout.split('\t')[0] }}"
  tasks:
    - name: Check if reboot is required
      shell: /home/ansible/scripts/check.sh "{{ item.stdout.split('\t')[1] }}"
      register: output

    - debug: var=output.stdout_lines

    - add_host: name={{ item }}
               groups=dest_nodes
               ansible_user={{ USER }}
     with_items: "{{ dest_ip.split(',') }}"

The item value will change on each loop and that will be fed to the play above.
Thus in summary: if the database returns three records in {{ command_result.stdout_lines }} the shell module play should be invoked thrice with the details of each record in {{ item }} respectively.
For example: 
The database can return any number of rows and lets consider it returns three rows of type: <listofhosts>\t<somearguments>: 
host5,host8\targ1
host6,host2\targ3
host9,host3,host4\targ4

What I need is that the loop with_items: {{ command_result.stdout_lines }} would run three plays and each play to build dynamic host group of the host list for that run and its respective argument. 
So:

for the first run dynamic hosts group will be host5,host8 and the shell should get arg1
for second loop iteration dynamic hosts group will be host6,host2 and shell would get arg3
and so forth.

Hope this makes my requirement understood.
I'm on the latest version of Ansible. 

A:

You should be able to run this kind of task with the creation of a dynamic host group, via the module add_host.
Also, to fulfil the requirement that there will be multiple hosts per line, we are first recreating a clean list, with the help of the module set_fact.
Then, with the newly created list, we can use the loop with_subelements, in order to create the right tuples (check_arg, host).
Here is an example, where I faked you database output in the dynamic_hosts variable of the play:
---
- hosts: 127.0.0.1
  gather_facts: false
  connection: local
  vars:
    dynamic_hosts:
      - "host5,host8\targ1"
      - "host6,host2\targ3"
      - "host9,host3,host4\targ4"

  tasks:
    - debug:
        msg: "{{ dynamic_hosts }}"

    - name: Make a clean list out of the hosts and arguments
      set_fact:
         hosts: "{{ hosts | default([]) + [ {'hosts': item.split('\t')[0].split(','), 'check_arg': item.split('\t')[1]} ] }}"
      with_items: "{{ dynamic_hosts }}"

    - debug:
        msg: "{{ hosts }}"

    - name: Adding hosts to a dynamic group based on the faked database output stored in hosts
      add_host:
        name: "{{ item.1 }}"
        check_arg: "{{ item.0.check_arg }}"
        ansible_host: 127.0.0.1
        ansible_connection: local
        groups: nodes_to_run_on
      with_subelements:
        - "{{ hosts }}"
        - hosts

- hosts: nodes_to_run_on
  gather_facts: false
  tasks:
    - debug:
        msg: "Run the shell with the argument `{{ check_arg }}` here"

As you can see, I am creating a host group named nodes_to_run_on on the first part of the play, with the help of add_host. Later on, I am using this host group to run a new set of tasks on all the hosts in that group.
This would be the output of this playbook:
PLAY [127.0.0.1] **********************************************************************************************************************************

TASK [debug] **************************************************************************************************************************************
ok: [127.0.0.1] => {
    "msg": [
        "host5,host8\targ1",
        "host6,host2\targ3",
        "host9,host3,host4\targ4"
    ]
}

TASK [Make a clean list out of the hosts and arguments] ******************************************************************************************
ok: [127.0.0.1] => (item=host5,host8    arg1)
ok: [127.0.0.1] => (item=host6,host2    arg3)
ok: [127.0.0.1] => (item=host9,host3,host4  arg4)

TASK [debug] **************************************************************************************************************************************
ok: [127.0.0.1] => {
    "msg": [
        {
            "check_arg": "arg1",
            "hosts": [
                "host5",
                "host8"
            ]
        },
        {
            "check_arg": "arg3",
            "hosts": [
                "host6",
                "host2"
            ]
        },
        {
            "check_arg": "arg4",
            "hosts": [
                "host9",
                "host3",
                "host4"
            ]
        }
    ]
}

TASK [Adding hosts to a dynamic group based on the faked database output stored in hosts] *********************************************************
changed: [127.0.0.1] => (item=[{'check_arg': 'arg1'}, 'host5'])
changed: [127.0.0.1] => (item=[{'check_arg': 'arg1'}, 'host8'])
changed: [127.0.0.1] => (item=[{'check_arg': 'arg3'}, 'host6'])
changed: [127.0.0.1] => (item=[{'check_arg': 'arg3'}, 'host2'])
changed: [127.0.0.1] => (item=[{'check_arg': 'arg4'}, 'host9'])
changed: [127.0.0.1] => (item=[{'check_arg': 'arg4'}, 'host3'])
changed: [127.0.0.1] => (item=[{'check_arg': 'arg4'}, 'host4'])

PLAY [nodes_to_run_on] ****************************************************************************************************************************

TASK [debug] **************************************************************************************************************************************
ok: [host5] => {
    "msg": "Run the shell with the argument `arg1` here"
}
ok: [host8] => {
    "msg": "Run the shell with the argument `arg1` here"
}
ok: [host6] => {
    "msg": "Run the shell with the argument `arg3` here"
}
ok: [host2] => {
    "msg": "Run the shell with the argument `arg3` here"
}
ok: [host9] => {
    "msg": "Run the shell with the argument `arg4` here"
}
ok: [host3] => {
    "msg": "Run the shell with the argument `arg4` here"
}
ok: [host4] => {
    "msg": "Run the shell with the argument `arg4` here"
}

PLAY RECAP ****************************************************************************************************************************************
127.0.0.1                  : ok=4    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host2                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host3                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host4                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host5                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host6                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host8                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host9                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0  

Please note: this is not a really DRY list of host we are creating here, but it keeps the solution naive and is more achieving a KISS principle.
The inventory we end up generating here would look like this:
## kiss.yml ## lots of repetition
nodes_to_run_on:
  hosts:
    host5:
      check_arg: arg1
      ansible_host: 127.0.0.1
      ansible_connection: local
    host8:
      check_arg: arg1
      ansible_host: 127.0.0.1
      ansible_connection: local
    host6:
      check_arg: arg3
      ansible_host: 127.0.0.1
      ansible_connection: local
    host2:
      check_arg: arg3
      ansible_host: 127.0.0.1
      ansible_connection: local
    host9:
      check_arg: arg4
      ansible_host: 127.0.0.1
      ansible_connection: local
    host3:
      check_arg: arg4
      ansible_host: 127.0.0.1
      ansible_connection: local
    host4:
      check_arg: arg4
      ansible_host: 127.0.0.1
      ansible_connection: local

When it could definitely be dried out to 
## dry.yaml ## no repetition with the help of group variables
nodes_to_run_on:
  vars:
    ansible_host: 127.0.0.1
    ansible_connection: local
  children:
    with_arg1:
      hosts:
        host5:
        host8:
      vars:
        check_arg: arg1
    with_arg3:
      hosts:
        host6:
        host2:
      vars:
        check_arg: arg3
    with_arg4:
      hosts:
        host9:
        host3:
        host4:
      vars:
        check_arg: arg4

Consider those two run in this play:
---
- hosts: nodes_to_run_on
  gather_facts: false
  tasks:
    - debug:
        msg: "Run the shell with the argument `{{ check_arg }}` here"

With kiss.yml
$ ansible-playbook example.yml --inventory=kiss.yml

PLAY [nodes_to_run_on] ****************************************************************************************************************************

TASK [debug] **************************************************************************************************************************************
ok: [host5] => {
    "msg": "Run the shell with the argument `arg1` here"
}
ok: [host8] => {
    "msg": "Run the shell with the argument `arg1` here"
}
ok: [host6] => {
    "msg": "Run the shell with the argument `arg3` here"
}
ok: [host2] => {
    "msg": "Run the shell with the argument `arg3` here"
}
ok: [host9] => {
    "msg": "Run the shell with the argument `arg4` here"
}
ok: [host3] => {
    "msg": "Run the shell with the argument `arg4` here"
}
ok: [host4] => {
    "msg": "Run the shell with the argument `arg4` here"
}

PLAY RECAP ****************************************************************************************************************************************
host2                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host3                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host4                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host5                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host6                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host8                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host9                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0  

With dry.yml
$ ansible-playbook example.yml --inventory=dry.yml

PLAY [nodes_to_run_on] ****************************************************************************************************************************

TASK [debug] **************************************************************************************************************************************
ok: [host5] => {
    "msg": "Run the shell with the argument `arg1` here"
}
ok: [host8] => {
    "msg": "Run the shell with the argument `arg1` here"
}
ok: [host6] => {
    "msg": "Run the shell with the argument `arg3` here"
}
ok: [host2] => {
    "msg": "Run the shell with the argument `arg3` here"
}
ok: [host9] => {
    "msg": "Run the shell with the argument `arg4` here"
}
ok: [host3] => {
    "msg": "Run the shell with the argument `arg4` here"
}
ok: [host4] => {
    "msg": "Run the shell with the argument `arg4` here"
}

PLAY RECAP ****************************************************************************************************************************************
host2                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host3                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host4                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host5                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host6                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host8                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host9                      : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0    

So, you can see that we achieve the same with an inventory, dry.yml, of 24 lines, when the kiss.yml inventory was 30 lines long.
But ultimately the effort to create an inventor that would be DRY would not really pay, if the source is, either way, coming from a database that would generate a host list.

