From d86a48de2542b681aa1ca16483deeb5a7c9820f5 Mon Sep 17 00:00:00 2001 From: rubenb Date: Mon, 12 Feb 2024 10:49:16 +0100 Subject: [PATCH] playbook and rol config vim options --- linux-config-vim-options.yaml | 12 ++++++++++++ roles/config-vim-options/tasks/main.yaml | 21 +++++++++++++++++++++ roles/config-vim-options/vars/main.yaml | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 linux-config-vim-options.yaml create mode 100644 roles/config-vim-options/tasks/main.yaml create mode 100644 roles/config-vim-options/vars/main.yaml diff --git a/linux-config-vim-options.yaml b/linux-config-vim-options.yaml new file mode 100644 index 0000000..a659401 --- /dev/null +++ b/linux-config-vim-options.yaml @@ -0,0 +1,12 @@ +--- + +- hosts: '{{ ip_addr }}' + become: yes + become_method: sudo + gather_facts: yes + + tasks: + + - name: "[CONFIG VIM OPTIONS] Config vim options" + import_role: + name: config-vim-options \ No newline at end of file diff --git a/roles/config-vim-options/tasks/main.yaml b/roles/config-vim-options/tasks/main.yaml new file mode 100644 index 0000000..62b9959 --- /dev/null +++ b/roles/config-vim-options/tasks/main.yaml @@ -0,0 +1,21 @@ +#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +# Enable VIM options +# step1 - create file vimrc.local +- name: create file vimrc.local + file: + path: "{{ path_vimrclocal }}" + state: touch + mode: '0644' +# step2 - add some options to the file +- name: add some options to vimrc.local + lineinfile: + path: "{{ path_vimrclocal }}" + line: "{{item.line}}" + state: present + with_items: + - line: syntax on + - line: set showcmd + - line: set showmatch + - line: set ignorecase + - line: set smartcase +#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-vim-options/vars/main.yaml b/roles/config-vim-options/vars/main.yaml new file mode 100644 index 0000000..62496d7 --- /dev/null +++ b/roles/config-vim-options/vars/main.yaml @@ -0,0 +1,2 @@ +--- +path_vimrclocal: /etc/vim/vimrc.local \ No newline at end of file