Hi@akhtar,
Sometimes you want to repeat a task multiple times. In computer programming, this is called a loop. Common Ansible loops include changing ownership on several files and/or directories with the file module, creating multiple users with the user module, and repeating a polling step until a certain result is reached. Ansible offers two keywords for creating loops: loop and with_<lookup>. You can see the below example.
- hosts: all
  tasks:
    - package:
        name: "{{ item }}"
        state: present
      loop:
        - "httpd"
        - "python"