-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook_install.yml
62 lines (57 loc) · 1.79 KB
/
playbook_install.yml
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
---
- hosts: this_host
become: false
connection: local
gather_facts: true
tasks:
- name: check mandatory variables are defined
assert:
that:
- dotfiles_mapping is defined
tags:
- configs
- name: manage dirs for dotfiles
file:
path: "{{ item.value.dir_path }}"
state: directory
mode: "{{ item.value.dir_mode }}"
owner: "{{ item.value.dir_owner }}"
group: "{{ item.value.dir_group }}"
loop: "{{ dotfiles_mapping | dict2items }}"
loop_control:
label: "{{ item | json_query('value.dir_path') }}"
when:
- item.value.dir_path is defined
- item.value.dir_mode is defined
- item.value.dir_owner is defined
- item.value.dir_group is defined
tags:
- configs
- name: create symlinks for dotfiles
file:
src: "{{ item.value.src }}"
dest: "{{ item.value.dest }}"
force: true
state: link
loop: "{{ dotfiles_mapping | dict2items }}"
loop_control:
label: "{{ item | json_query('value.dest') }}"
tags:
- configs
- name: dotfiles | cronjob for vim-plug update
cron:
name: vim-plug update/upgrade
job: 'vim -E -c "PlugUpgrade | PlugUpdate | qa!" >/dev/null 2>/dev/null'
special_time: weekly
ignore_errors: true # if cron not presented
no_log: true # it doesnt matter
- name: dotfiles | cronjob for update
cron:
name: dotfiles updates
job: "cd {{ ansible_user_dir }}/.dotfiles && git pull >/dev/null 2>/dev/null"
special_time: hourly
ignore_errors: true # if cron not presented
- name: Migrating away from .pam_environment
file:
path: "{{ ansible_user_dir }}/.pam_environment"
state: absent