--- - name: Installing package hosts: nodes vars_files: - /root/playbooks/imp_variable.yml - /root/playbooks/imp_variable2.yml tasks: - yum: name: "{{ pkgs }}" state: absent ...