I created a small action module that include files under a directory as an array. Take this as an example
Directory structure
users/
user1.yml
user2.yml
user3.yml
Ansible code
name: Set fact for user site
include_dir:
path=“/path_to_my_dir/users”
fact=“system_users”
So I searched a lot and did not find a solution, I might be missing something and an easier solution might exist. If not I would like to see this functionality in core.