base: Refactor deployment of default config files
authornicoo <nicoo@realraum.at>
Mon, 26 Nov 2018 22:30:58 +0000 (23:30 +0100)
committernicoo <nicoo@realraum.at>
Mon, 26 Nov 2018 22:30:58 +0000 (23:30 +0100)
ansible/roles/base/tasks/main.yml

index c155be4..e7e808e 100644 (file)
 
   when: ansible_distribution == "Ubuntu"
 
-- name: install zshrc
-  with_items:
-    - src: "zprofile"
-      dest: "/etc/zsh/zprofile"
-    - src: "zshrc"
-      dest: "/etc/zsh/zshrc"
-    - src: "zshrc.skel"
-      dest: "/etc/skel/.zshrc"
-  copy:
-    src: "{{ item.src }}"
-    dest: "{{ item.dest }}"
-    mode: 0644
-
 - name: set root default shell to zsh
   user:
     name: root
     dest: /etc/adduser.conf
     regexp: "^#?{{ item.key }}="
     line: "{{ item.key }}={{ item.value }}"
+
+- name: Deploy default configuration for tools
+  with_dict:
+    /etc/zsh/zprofile: zprofile
+    /etc/zsh/zshrc: zshrc
+    /etc/skel/.zshrc: zshrc.skel
+
+  loop_control:
+    label: "{{ item.key }}"
+  copy:
+    mode: 0644
+    src: "{{ item.value }}"
+    dest: "{{ item.key }}"