--- - hosts: all become: true vars_prompt: - name: package_name prompt: "Name of package" private: no - name: state prompt: "State" private: no tasks: - name: Modify state of package in debian tags: debian apt: name: "{{ package_name }}" update_cache: yes state: "{{ state}}" autoremove: yes when: ansible_distribution == 'Debian'