From 5a95cbfd713c7719bfa5d679c1c4f0157e6d146b Mon Sep 17 00:00:00 2001 From: mg Date: Thu, 24 Jun 2021 07:28:32 +0200 Subject: [PATCH] bugfix vim (#130) bugfix vim Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/130 Co-Authored-By: mg Co-Committed-By: mg --- roles/mgrote.vim/tasks/main.yml | 36 ++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/roles/mgrote.vim/tasks/main.yml b/roles/mgrote.vim/tasks/main.yml index 815304cc..ceb9d0f3 100644 --- a/roles/mgrote.vim/tasks/main.yml +++ b/roles/mgrote.vim/tasks/main.yml @@ -3,14 +3,36 @@ become: yes ansible.builtin.package: name: - - timeshift - - timeshift-gtk + - vim + - ripgrep state: present - - name: templating timeshift config + - name: check if vundle is installed - folder become: yes - ansible.builtin.template: - src: "timeshift.json" - dest: "/etc/timeshift/timeshift.json" - mode: 0664 + stat: + path: "{{ vim_vundle_path }}" + register: folder_exists + - name: Ensure repository is cloned locally. + git: + repo: "{{ vim_vundle_repo_url }}" + dest: "{{ vim_vundle_path }}" + depth: 1 + register: repo_cloned + + - name: set owner recursive for repo + file: + path: "{{ vim_homedir }}" + owner: mg + group: mg + recurse: yes + when: repo_cloned.changed == true + + - name: Vundle - PluginInstall + ansible.builtin.shell: yes | vim -c PluginInstall -c qall + args: + chdir: /home/mg + when: + - (folder_exists.stat.exists == False) and ("ansible_facts['distribution'] == 'Ubuntu'") + become: yes + become_user: mg