The author's example of using loop data out of loops is overlooking anchors and aliases in YAML. His example can be rewritten as:
- hosts: all
tasks:
- name: Install distro packages
package:
name: "{{ item }}"
state: present
with_list: &packages
- git
- htop
tags: *packages