Update ansible/dotbot scripts

This commit is contained in:
2018-02-05 20:09:05 +01:00
parent 86b6158ddb
commit d506385ff0
4 changed files with 93 additions and 75 deletions

View File

@@ -1,49 +1,44 @@
- defaults:
link:
relink: true
create: true
force: true
relative: true
- hosts: localhost
connection: local
become: false
tasks:
- name: configure sudoers
lineinfile:
path: /etc/sudoers
line: hannes ALL=(ALL) NOPASSWD:ALL
regexp: '^hannes\s+'
become: true
- link:
~/.autostart:
~/.gitconfig:
path: git/gitconfig
~/.gnupg/dirmngr.conf:
path: gnupg/dirmngr.conf
~/.gnupg/gpg-agent.conf:
path: gnupg/gpg-agent.conf
~/.gnupg/gpg.conf:
path: gnupg/gpg.conf
~/.i3:
~/.tmux.conf:
path: tmux/tmux.conf
~/.config/nvim/init.vim:
path: vim/vimrc
~/.Xresources:
path: x/Xresources
~/.xinitrc:
path: x/xinitrc
~/.zprofile:
path: zsh/zprofile
~/.zshrc:
path: zsh/zshrc
~/.zshrc.d:
path: zsh/zshrc.d
- name: set shell
user:
name: hannes
shell: /usr/bin/zsh
become: true
- shell:
- ln -sf ~/.config/nvim/init.vim ~/.vimrc
- xrdb ~/.Xresources
- mkdir -p ~/.var/lib
- mkdir -p ~/.var/log
- mkdir -p ~/.var/run
- mkdir -p ~/.usr/lib
- command: curl --fail --location --create-dirs --output ~/.local/share/nvim/site/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
stdout: true
stderr: true
- command: nvim -E +PlugInstall +qall || true
stdout: true
stderr: true
- command: test -e ~/.local/share/nvim/plugged/YouCompleteMe/third_party/ycmd/ycm_core.so || bash -c "cd ~/.local/share/nvim/plugged/YouCompleteMe && ./install.py" || true
stdout: true
stderr: true
- name: load package list
include_vars:
file: packages.yml
- set_fact:
distro: "{{ ansible_distribution|lower }}"
- set_fact:
defined_packages: "{{ packages|json_query('keys(list)') }}"
- set_fact:
distro_packages: "{{ packages|json_query('list.*.%s'|format(distro)) }}"
- name: check list
assert:
that: "defined_packages|length == distro_packages|length"
- name: install packages
package:
name: "{{ packages|json_query(query) }}"
state: installed
become: true
vars:
query: "{{ 'list.*.%s[]'|format(distro) }}"
- name: run dotbot
command: ./dotbot