which is a correct way to reuse code from roles?

Does this work:

  • include: …/…/includes_common/pkg_from_repo.yaml
    with_items:
  • { name: ‘bash’ }
  • { name: ‘bash-completion’ }
  • { name: ‘screen’ }

etc…

One cannot add a with_items to an include.

I think I’ve discussed not doing the “package abstraction thing” in another thread, and why it would be better to just list the packages per os, like

  • yum: name={{ item }} state=installed
    with_items: yum_packages
    when: ansible_os_family == ‘RedHat’

etc