I'm having a bit of difficulty with getting the behaviour that I want in as concise a way as I think should be possible.
Here's the point:
I'm having trouble with iterating over a hash where the value for one of the keys is itself a list. Is this possible with Ansible? Or would I need to write a custom iterator?
I think that, having read the docs on how Ansible does looping (http://docs.ansible.com/playbooks_loops.html) that I must be misunderstanding something, so I'm asking for illumination concerning the general case - this repository problem is just an example.
I want to configure /etc/apt/sources.list to contain:
deb http://mirrors.us.kernel.org/ubuntu/ precise main
deb http://mirrors.us.kernel.org/ubuntu/ precise universe
deb http://mirrors.us.kernel.org/ubuntu/ precise-updates main
deb http://mirrors.us.kernel.org/ubuntu/ precise-updates universe
deb http://mirrors.us.kernel.org/ubuntu/ precise-security main
deb http://mirrors.us.kernel.org/ubuntu/ precise-security universe
My desired approach is to have a role called 'repositories', because I will need to take care of multiple platform versions/releases and non-distro/vendor repositories.
roles/repositories/defaults/main.yml: