-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbase.yml
More file actions
84 lines (73 loc) · 2.3 KB
/
base.yml
File metadata and controls
84 lines (73 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# This playbook takes care of the base things,
# like bash, vim, and git
---
- name: Base setup
hosts: all
pre_tasks:
- name: Install base packages
include_role:
name: tools
tasks_from: rpm
vars:
rpms: "{{ base_packages }}"
- name: Setup base /home folder
include_role:
name: tools
tasks_from: file
vars:
files_src: "home/base/"
files_dst: "{{ ansible_user_dir }}"
register: base_home_files
- name: Remove legacy Vundle directory
file:
path: "{{ ansible_user_dir }}/.vim/bundle"
state: absent
- name: Remove legacy Vundle install log
file:
path: "{{ ansible_user_dir }}/.vim/vundle_install.log"
state: absent
- name: Ensure vim-plug autoload directory exists
file:
path: "{{ ansible_user_dir }}/.vim/autoload"
state: directory
mode: "0755"
- name: Install vim-plug (plug.vim)
get_url:
url: "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
dest: "{{ ansible_user_dir }}/.vim/autoload/plug.vim"
mode: "0644"
- name: Check vim-plug install marker
stat:
path: "{{ ansible_user_dir }}/.vim/.plug_installed"
register: plug_marker
- name: Install Vim plugins (vim-plug, first run only)
shell: >
vim -E -s
-u "{{ ansible_user_dir }}/.vimrc"
-i NONE
+"silent! PlugInstall --sync"
+qall
args:
executable: /bin/bash
when: not plug_marker.stat.exists
register: plug_install
changed_when: true
failed_when: plug_install.rc != 0
- name: Verify vim-plug installed a key plugin dir
stat:
path: "{{ ansible_user_dir }}/.vim/plugged/vim-airline"
register: airline_dir
when: not plug_marker.stat.exists
- name: Fail if plugin install did not create expected dirs
fail:
msg: "vim-plug ran but {{ ansible_user_dir }}/.vim/plugged/vim-airline was not created."
when:
- not plug_marker.stat.exists
- not airline_dir.stat.exists
- name: Write vim-plug install marker
file:
path: "{{ ansible_user_dir }}/.vim/.plug_installed"
state: touch
when:
- not plug_marker.stat.exists
- airline_dir.stat.exists