From a5dc25ddf79c490b3c4118923d325b4af7bb65dc Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 25 May 2019 03:56:10 +0200 Subject: replace most with_dicts --- roles/openwrt/image/tasks/prepare.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'roles/openwrt/image/tasks') diff --git a/roles/openwrt/image/tasks/prepare.yml b/roles/openwrt/image/tasks/prepare.yml index ffac3c3f..e03fe351 100644 --- a/roles/openwrt/image/tasks/prepare.yml +++ b/roles/openwrt/image/tasks/prepare.yml @@ -21,36 +21,36 @@ - name: Copy mixins in place [1/3] + loop: "{{ openwrt_mixin | dict2items }}" + loop_control: + label: "{{ item.key }}" file: dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}" src: "{{ item.value.link }}" force: yes follow: no state: link - with_dict: "{{ openwrt_mixin }}" when: '"link" in item.value' - loop_control: - label: "{{ item.key }}" - name: Copy mixins in place [2/3] + loop: "{{ openwrt_mixin | dict2items }}" + loop_control: + label: "{{ item.key }}" copy: src: "{{ item.value.file }}" dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}" mode: "{{ item.value.mode | default('0644') }}" - with_dict: "{{ openwrt_mixin }}" when: '"file" in item.value' - loop_control: - label: "{{ item.key }}" - name: Copy mixins in place [3/3] + loop: "{{ openwrt_mixin | dict2items }}" + loop_control: + label: "{{ item.key }}" copy: content: "{{ item.value.content }}" dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}" mode: "{{ item.value.mode | default('0644') }}" - with_dict: "{{ openwrt_mixin }}" when: '"content" in item.value' - loop_control: - label: "{{ item.key }}" - name: Generate /etc/fstab loop: "{{ openwrt_mounts }}" @@ -70,15 +70,15 @@ - name: Create UCI configuration files + loop: "{{ openwrt_uci | dict2items }}" + loop_control: + label: "{{ item.key }}" template: src: uci.j2 dest: "{{ openwrt_imgbuilder_files }}/etc/config/{{ item.key }}" mode: 0644 trim_blocks: yes # force: no ## TODO: fail when overwriting a file - with_dict: "{{ openwrt_uci }}" - loop_control: - label: "{{ item.key }}" - name: Create /etc/passwd template: -- cgit v1.2.3