From 3263f1a36f7f5aad7af2648336e9e984b63300fc Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 6 Oct 2018 12:23:08 +0100 Subject: [PATCH] Create config file directories before copy --- tasks/config.yml | 67 ++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 42 deletions(-) diff --git a/tasks/config.yml b/tasks/config.yml index eae800f..3f1f5d4 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -4,30 +4,6 @@ mode: 0644 owner: "{{ user }}" -- copy: - src: ./files/terminator.conf - dest: "{{ home }}/.config/terminator/config" - mode: 0644 - owner: "{{ user }}" - -- copy: - src: ./files/uniemoji.json - dest: "{{ home }}/.config/uniemoji/custom.json" - mode: 0644 - owner: "{{ user }}" - -- copy: - src: ./files/assh.yml - dest: "{{ home}}/.ssh/assh.yml" - mode: 0644 - owner: "{{ user }}" - -- copy: - src: ./files/gitignore_global - dest: "{{ home }}/.config/.gitignore" - mode: 0644 - owner: "{{ user }}" - - template: src: ./files/gitconfig.conf dest: "{{ home }}/.gitconfig" @@ -35,12 +11,6 @@ owner: "{{ user }}" group: users -- copy: - src: ./files/rofi.conf - dest: "{{ home }}/.config/rofi/config" - mode: 0644 - owner: "{{ user }}" - - copy: src: ./files/touchpad.conf dest: /usr/share/X11/xorg.conf.d/30-touchpad.conf @@ -48,20 +18,33 @@ owner: "{{ user }}" - copy: - src: ./files/caret-preferences.md - dest: "{{ home }}/.config/Caret/Preferences.md" + src: ./files/assh.yml + dest: "{{ home}}/.ssh/assh.yml" mode: 0644 owner: "{{ user }}" -- copy: - src: ./files/alacritty.yml - dest: "{{ home }}/.config/alacritty/alacritty.yml" +- set_fact: + user_config_files: + - { src: "terminator.conf", dest: "{{ home }}/.config/terminator/config" } + - { src: "uniemoji.json", dest: "{{ home }}/.config/uniemoji/custom.json" } + - { src: "gitignore_global", dest: "{{ home }}/.config/.gitignore" } + - { src: "rofi.conf", dest: "{{ home }}/.config/rofi/config" } + - { src: "caret-preferences.md", dest: "{{ home }}/.config/Caret/Preferences.md" } + - { src: "alacritty.yml", dest: "{{ home }}/.config/alacritty/alacritty.yml" } + + +- name: "Create config file directories" + with_items: "{{ user_config_files }}" + file: + path: '{{ item.dest | dirname }}' + state: directory + owner: "{{ user }}" + mode: 0755 + +- name: "Copy config files" + with_items: "{{ user_config_files }}" + copy: + src: './files/{{ item.src }}' + dest: '{{ item.dest }}' mode: 0644 owner: "{{ user }}" - -# - name: Tilix config -# shell: "dconf load /etc/gexperts/Tilix/" -# args: -# stdin: "{{ lookup('file', './files/tilix.conf') }}" -# become: true -# become_user: jake