-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.yml
More file actions
executable file
·51 lines (46 loc) · 1.4 KB
/
install.yml
File metadata and controls
executable file
·51 lines (46 loc) · 1.4 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
#!ansible-playbook --diff
# vim: ft=ansible sw=2 ts=2
#
# Install dotfiles with ansible.
# Usage: ./install.yml [--check]
---
- hosts: localhost
tasks:
- name: Gather file manifest
ansible.builtin.find:
paths: '{{ playbook_dir }}'
patterns: '.*'
hidden: true
register: dotfile_manifest
check_mode: no
- name: Create symlinks
ansible.builtin.file:
src: '{{ item.path | relpath(ansible_env.HOME) }}'
dest: '{{ ansible_env.HOME }}/{{ item.path | basename }}'
state: link
force: true
with_items: '{{ dotfile_manifest.files | default([]) }}'
tags: links
- name: Gather script manifest
ansible.builtin.find:
paths: '{{ playbook_dir }}/.bin'
register: script_manifest
check_mode: no
- name: Create binary dir
ansible.builtin.file:
path: '{{ ansible_env.HOME }}/.local/bin'
state: directory
- name: Create symlinks
ansible.builtin.file:
src: '{{ item.path | relpath(ansible_env.HOME ~ "/.local/bin") }}'
dest: '{{ ansible_env.HOME }}/.local/bin/{{ item.path | basename }}'
state: link
force: true
with_items: '{{ script_manifest.files | default([]) }}'
tags: links
- name: Link vim colors
ansible.builtin.file:
src: '{{ (playbook_dir ~ "/.vim/colors") | relpath(ansible_env.HOME ~ "/.vim/") }}/'
dest: '{{ ansible_env.HOME }}/.vim/colors'
state: link
force: true