title: how to run a particular task on specific host in ansible
body: <p>my inventory file's contents -</p>
  
  <pre><code>[webservers]
  x.x.x.x ansible_ssh_user=ubuntu
  
  [dbservers]
  x.x.x.x ansible_ssh_user=ubuntu
  </code></pre>
  
  <p>in my tasks file which is in common role i.e. it will run on both hosts but I want to run a following task on host webservers not in dbservers which is defined in inventory file</p>
  
  <pre><code>- name: Install required packages
    apt: name={{ item }} state=present
    with_items:
      - '{{ programs }}'
    become: yes
    tags: programs
  </code></pre>
  
  <p>is when module helpful or there is any other way? How could I do this ? </p>