--- - name: We have define a seperate variable in front of host in inventory file hosts: - node1 - node2 tasks: - name: Installing variable define package yum: name: "{{ rpm }}" state: latest ...