---
- name: Install packages thru loop
  hosts: localhost
  vars:
   packages: [ftp,telnet,htop)  

  tasks:
- name: Install package
  yum
    name: ‘{{items}}’
    state: present
  with_items: ‘{{packages}}’
