Hi,
I’m trying to write role for configuration of the package management. In
this role I following setup.
— defaults/main.yml
debain_source_list:
- name: debian
state: enabled
- name: debian-backports
state: enabled
- name: debian-lts
state: enabled
— task/setup-Debian.yml
- name: "[repository] apt source list files"
action: template src=??? dest=/etc/apt/sources.d/???.list
with_items: " {{ debain_source_list }}"
when: "item.state != 'enabled'"
with_first_found:
- {{ item.name }}.list.{{ ansible_lsb.id }}.{{ ansible_lsb.codename }}
- default.list
The idea is to have separate source list files for each Debian release
/wheeze, squeeze, …/, if the file is not found put there some default
file. The problem is how to run more loops and address variables in one
action.
Consider this to be an example and will be used as template for another
actions. I do not want to sync the directories.
Best regards
Peter Hudec