Update ansible/dotbot scripts
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
CONFIG="install.yml"
|
CONFIG="dotbot.yml"
|
||||||
DOTBOT_DIR="_dotbot"
|
DOTBOT_DIR="_dotbot"
|
||||||
|
|
||||||
DOTBOT_BIN="bin/dotbot"
|
DOTBOT_BIN="bin/dotbot"
|
||||||
@@ -12,3 +12,4 @@ cd "${BASEDIR}"
|
|||||||
git submodule update --init --recursive "${DOTBOT_DIR}"
|
git submodule update --init --recursive "${DOTBOT_DIR}"
|
||||||
|
|
||||||
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}"
|
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}"
|
||||||
|
exit $?
|
||||||
49
dotbot.yml
Normal file
49
dotbot.yml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
- defaults:
|
||||||
|
link:
|
||||||
|
relink: true
|
||||||
|
create: true
|
||||||
|
force: true
|
||||||
|
relative: 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
|
||||||
|
|
||||||
|
- 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
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
- hosts: localhost
|
|
||||||
connection: local
|
|
||||||
become: true
|
|
||||||
tasks:
|
|
||||||
- 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
|
|
||||||
vars:
|
|
||||||
query: "{{ 'list.*.%s[]'|format(distro) }}"
|
|
||||||
89
install.yml
89
install.yml
@@ -1,49 +1,44 @@
|
|||||||
- defaults:
|
- hosts: localhost
|
||||||
link:
|
connection: local
|
||||||
relink: true
|
become: false
|
||||||
create: true
|
tasks:
|
||||||
force: true
|
- name: configure sudoers
|
||||||
relative: true
|
lineinfile:
|
||||||
|
path: /etc/sudoers
|
||||||
|
line: hannes ALL=(ALL) NOPASSWD:ALL
|
||||||
|
regexp: '^hannes\s+'
|
||||||
|
become: true
|
||||||
|
|
||||||
- link:
|
- name: set shell
|
||||||
~/.autostart:
|
user:
|
||||||
~/.gitconfig:
|
name: hannes
|
||||||
path: git/gitconfig
|
shell: /usr/bin/zsh
|
||||||
~/.gnupg/dirmngr.conf:
|
become: true
|
||||||
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
|
|
||||||
|
|
||||||
- shell:
|
- name: load package list
|
||||||
- ln -sf ~/.config/nvim/init.vim ~/.vimrc
|
include_vars:
|
||||||
- xrdb ~/.Xresources
|
file: packages.yml
|
||||||
- mkdir -p ~/.var/lib
|
|
||||||
- mkdir -p ~/.var/log
|
- set_fact:
|
||||||
- mkdir -p ~/.var/run
|
distro: "{{ ansible_distribution|lower }}"
|
||||||
- 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
|
- set_fact:
|
||||||
stdout: true
|
defined_packages: "{{ packages|json_query('keys(list)') }}"
|
||||||
stderr: true
|
|
||||||
- command: nvim -E +PlugInstall +qall || true
|
- set_fact:
|
||||||
stdout: true
|
distro_packages: "{{ packages|json_query('list.*.%s'|format(distro)) }}"
|
||||||
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
|
- name: check list
|
||||||
stdout: true
|
assert:
|
||||||
stderr: true
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user