Hi,
I think your approach has been overthought, a very common issue everyone runs into when designing a backup solution. I also think you should use an existing backup solution, such as
http://www.rsnapshot.org. Ideally you want a solution that can be configured from a central point and left to do its job.
One thing to remember, also, is that Ansible is a Configuration Management suite. It's not designed to replace a scripting or programming language - it simply can't do the same things. Instead, use Ansible to configure a piece of software, like rsnapshot, and then maintain this state to fit your needs.
I believe you need to simplify the data structures in your example cases. Also, instead of having a list of users to backup along with their individual backup targets, use rsync's '--exclude-from' and '--include-from' to build a list of regular expressions or globs for matching what you do and do not want to backup, like:
+/home/alice/*
+/home/bob/my_files/*.txt
-/root/*
If you do this, you just need a set of templates for populating the exclude and include files, which you can then feed to rsync, alone with the remote system's (IP) address. Working with these patterns means you're not dealing with complex data structures from within Ansible, but instead have something simple such as this:
backup_target_systems:
- system: "localdev"
active: true
backup_include_patterns:
- "/home/alice/"
- "/home/bob/files/"
backup_exclude_patterns:
- "/root/"
I hope this has helped. Please let me know if you need any further assistance.
- M