diff options
| author | admin | 2024-09-19 18:18:07 +0200 |
|---|---|---|
| committer | admin | 2024-09-19 18:18:07 +0200 |
| commit | 7a4f7fd75c9a55c0a2013b6e6474f9dd4ef30a24 (patch) | |
| tree | 4f5d12282b07c7e37f306cc4e27e92e0f5ebb4f4 | |
| parent | 31dbecc7892afd156a560ee890314e6f2edae4ae (diff) | |
| download | ansible-7a4f7fd75c9a55c0a2013b6e6474f9dd4ef30a24.tar.gz | |
fix support for vim
| -rw-r--r-- | roles/common-linux/files/.vimrc | 5 | ||||
| -rw-r--r-- | roles/common-linux/tasks/main.yml | 1 | ||||
| -rw-r--r-- | roles/common-linux/tasks/vim.yml | 30 | ||||
| -rw-r--r-- | roles/common-linux/tasks/ycm.yml | 48 | ||||
| -rw-r--r-- | roles/packages/defaults/main.yml | 2 |
5 files changed, 82 insertions, 4 deletions
diff --git a/roles/common-linux/files/.vimrc b/roles/common-linux/files/.vimrc index 990f4d6..0ada439 100644 --- a/roles/common-linux/files/.vimrc +++ b/roles/common-linux/files/.vimrc @@ -8,7 +8,7 @@ call vundle#begin()" " Manage Plugins Plugin 'gmarik/Vundle.vim' " Autocompletion -Plugin 'Valloric/YouCompleteMe' +"Plugin 'Valloric/YouCompleteMe' " Displays Tagbar for Code Plugin 'majutsushi/tagbar' " Golang @@ -44,7 +44,8 @@ Plugin 'vim-scripts/ZoomWin' " Debugger Plugin 'joonty/vdebug' " Read HN -Plugin 'ryanss/vim-hackernews' +"Plugin 'ryanss/vim-hackernews' +Plugin 'vim-hackernews' command HN HackerNews " Change surrounding tags easily like ", ' or <tag> Plugin 'tpope/vim-surround' diff --git a/roles/common-linux/tasks/main.yml b/roles/common-linux/tasks/main.yml index a83b334..83ec571 100644 --- a/roles/common-linux/tasks/main.yml +++ b/roles/common-linux/tasks/main.yml @@ -31,6 +31,7 @@ enabled: yes #- import_tasks: cronjobs.yml +- import_tasks: vim.yml diff --git a/roles/common-linux/tasks/vim.yml b/roles/common-linux/tasks/vim.yml index 1716c03..84211e8 100644 --- a/roles/common-linux/tasks/vim.yml +++ b/roles/common-linux/tasks/vim.yml @@ -7,25 +7,51 @@ file: path: /home/horus/.vim state: directory + owner: horus + +- name: change owner of .vim to user + file: + #recurse: true + path: /home/horus/.vim/ + mode: 0744 + owner: horus + group: horus - name: git clone vundle for user + become: true + become_user: horus git: repo: https://github.com/VundleVim/Vundle.vim.git dest: /home/horus/.vim/bundle/Vundle.vim + clone: yes + update: yes + +- name: git clone ryanss/vim-hackernews + become: true + become_user: horus + git: + repo: https://git.iamfabulous.de/vim-hn + dest: /home/horus/.vim/bundle/vim-hackernews - name: git clone vundle for root git: repo: https://github.com/VundleVim/Vundle.vim.git dest: /root/.vim/bundle/Vundle.vim +- name: git clone ryanss/vim-hackernews for root + git: + repo: https://git.iamfabulous.de/vim-hn + dest: /root/.vim/bundle/vim-hackernews + - name: copy .vimrc for ~horus copy: src: .vimrc dest: /home/horus/.vimrc - mode: 744 + mode: 0644 + owner: horus - name: copy .vimrc for ~root copy: src: .vimrc dest: /root/.vimrc - mode: 744 + mode: 0644 diff --git a/roles/common-linux/tasks/ycm.yml b/roles/common-linux/tasks/ycm.yml new file mode 100644 index 0000000..177535a --- /dev/null +++ b/roles/common-linux/tasks/ycm.yml @@ -0,0 +1,48 @@ +- name: git clone YouCompleteMe for user + become: true + become_user: horus + git: + repo: https://github.com/ycm-core/YouCompleteMe.git + dest: /home/horus/.vim/bundle/YouCompleteMe + +- name: YCM checkout commit hash before requirement changed to vim 9.1 + become: yes + become_user: horus + command: + cmd: git checkout b6e8c64d96b02d60b3751d6a51af7dc958054f8f + args: + chdir: /home/horus/.vim/bundle/YouCompleteMe + +- name: git clone YouCompleteMe for root + git: + repo: https://github.com/ycm-core/YouCompleteMe.git + dest: /home/horus/.vim/bundle/YouCompleteMe + +- name: YCM checkout commit hash before requirement changed to vim 9.1 for root + command: + cmd: git checkout b6e8c64d96b02d60b3751d6a51af7dc958054f8f + args: + chdir: /root/.vim/bundle/YouCompleteMe + +- name: Check vim-hn installed for user + ansible.builtin.stat: + path: /home/horus/.vim/bundle/vim-hackernews + register: vimhn_user_installed + +- name: git clone ryanss/vim-hackernews + become: true + become_user: horus + git: + repo: https://git.iamfabulous.de/vim-hn + dest: /home/horus/.vim/bundle/vim-hackernews + when: not vimhn_user_installed + +- name: git clone ryanss/vim-hackernews for root + git: + repo: https://git.iamfabulous.de/vim-hn + +- name: Check vundle installed for user + ansible.builtin.stat: + path: /home/horus/.vim/bundle/Vundle.vim + register: vundle_user_installed + dest: /root/.vim/bundle/vim-hackernews diff --git a/roles/packages/defaults/main.yml b/roles/packages/defaults/main.yml index db24c48..89c5ba8 100644 --- a/roles/packages/defaults/main.yml +++ b/roles/packages/defaults/main.yml @@ -13,8 +13,10 @@ default_packages_present_all: - redis-tools - rsync - screen + - sudo - unzip - vim + - vim-nox - whois - xz-utils - zsh |
