Feat: dotusers for dotfiles
This commit is contained in:
parent
bcee9f6cbb
commit
6e8fe24562
@ -2,10 +2,10 @@
|
||||
- name: dotfiles -- Copy tmux.conf
|
||||
template:
|
||||
src: files/dotfiles/tmux.conf
|
||||
dest: /home/{{ me.username }}/.tmux.conf
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: me in users
|
||||
dest: /home/{{ item.username }}/.tmux.conf
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
|
||||
# Zsh config
|
||||
- name: dotfiles -- Download antibody
|
||||
@ -28,50 +28,56 @@
|
||||
- name: dotfiles -- Copy local zshrc
|
||||
template:
|
||||
src: files/dotfiles/zshrc
|
||||
dest: /home/{{ me.username }}/.zshrc
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: prompt == 'zsh' and me in users
|
||||
dest: /home/{{ item.username }}/.zshrc
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
when: prompt == 'zsh'
|
||||
|
||||
- name: dotfiles -- Copy local zshrc.local
|
||||
template:
|
||||
src: files/dotfiles/zshrc.local
|
||||
dest: /home/{{ me.username }}/.zshrc.local
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: prompt == 'zsh' and me in users
|
||||
dest: /home/{{ item.username }}/.zshrc.local
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
when: prompt == 'zsh'
|
||||
|
||||
- name: dotfiles -- Copy local zsh_plugins.txt
|
||||
template:
|
||||
src: files/dotfiles/zsh_plugins.txt
|
||||
dest: /home/{{ me.username }}/.zsh_plugins.txt
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: prompt == 'zsh' and me in users
|
||||
dest: /home/{{ item.username }}/.zsh_plugins.txt
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
when: prompt == 'zsh'
|
||||
|
||||
# Fish config
|
||||
- name: dotfiles -- Create fish config directory
|
||||
file:
|
||||
dest: /home/{{ me.username }}/.config/fish/
|
||||
dest: /home/{{ item.username }}/.config/fish/
|
||||
state: directory
|
||||
when: prompt == 'fish' and me in users
|
||||
with_items: "{{ dotusers }}"
|
||||
when: prompt == 'fish'
|
||||
|
||||
- name: dotfiles -- Copy config.fish
|
||||
template:
|
||||
src: files/dotfiles/config.fish
|
||||
dest: /home/{{ me.username }}/.config/fish/
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: prompt == 'fish' and me in users
|
||||
dest: /home/{{ item.username }}/.config/fish/
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
when: prompt == 'fish'
|
||||
register: fishconfig
|
||||
|
||||
- name: dotfiles -- Copy fisher plugin list
|
||||
template:
|
||||
src: files/dotfiles/fishfile
|
||||
dest: /home/{{ me.username }}/.config/fish/
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: prompt == 'fish' and me in users
|
||||
dest: /home/{{ item.username }}/.config/fish/
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
when: prompt == 'fish'
|
||||
register: fishplugin
|
||||
|
||||
# Vim config
|
||||
@ -79,89 +85,86 @@
|
||||
- name: dotfiles -- Copy .vim/
|
||||
copy:
|
||||
src: files/dotfiles/vim/
|
||||
dest: /home/{{ me.username }}/.vim/
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: me in users
|
||||
dest: /home/{{ item.username }}/.vim/
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
|
||||
- name: dotfiles -- Creates .vim/autoload/
|
||||
file:
|
||||
path: /home/{{ me.username }}/.vim/autoload/
|
||||
path: /home/{{ item.username }}/.vim/autoload/
|
||||
state: directory
|
||||
when: me in users
|
||||
with_items: "{{ dotusers }}"
|
||||
|
||||
- name: dotfiles -- Download plug.vim
|
||||
get_url:
|
||||
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
dest: /home/{{ me.username }}/.vim/autoload/plug.vim
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: me in users
|
||||
dest: /home/{{ item.username }}/.vim/autoload/plug.vim
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
|
||||
- name: dotfiles -- Copy vimrc
|
||||
template:
|
||||
src: files/dotfiles/vimrc
|
||||
dest: /home/{{ me.username }}/.vimrc
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: me in users
|
||||
dest: /home/{{ item.username }}/.vimrc
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
|
||||
# Neovim config
|
||||
- name: dotfiles -- Copy nvim config
|
||||
copy:
|
||||
src: files/dotfiles/nvim
|
||||
dest: /home/{{ me.username }}/.config
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: editor == 'nvim' and me in users
|
||||
dest: /home/{{ item.username }}/.config
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
when: editor == 'nvim'
|
||||
|
||||
- name: dotfiles -- Download plug.vim for nvim
|
||||
get_url:
|
||||
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
dest: /home/{{ me.username }}/.config/nvim/autoload/plug.vim
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: editor == 'nvim' and me in users
|
||||
dest: /home/{{ item.username }}/.config/nvim/autoload/plug.vim
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
when: editor == 'nvim'
|
||||
|
||||
# Alacritty terminal
|
||||
- name: dotfiles -- Copy alacritty config
|
||||
copy:
|
||||
src: files/dotfiles/alacritty
|
||||
dest: /home/{{ me.username }}/.config
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: me in users
|
||||
dest: /home/{{ item.username }}/.config
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
|
||||
# Ssh config
|
||||
- name: dotfiles -- Creates .ssh
|
||||
file:
|
||||
path: /home/{{ me.username }}/.ssh/
|
||||
path: /home/{{ item.username }}/.ssh/
|
||||
state: directory
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: me in users
|
||||
|
||||
- name: dotfiles -- Copy ssh user config
|
||||
template:
|
||||
src: files/dotfiles/ssh/config_deploy
|
||||
dest: /home/{{ admin.username }}/.ssh/config
|
||||
owner: "{{ admin.username }}"
|
||||
group: "{{ admin.group }}"
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
when: not server
|
||||
|
||||
- name: dotfiles -- Copy ssh user config
|
||||
template:
|
||||
src: files/dotfiles/ssh/config_me
|
||||
dest: /home/{{ me.username }}/.ssh/config
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: me in users
|
||||
src: files/dotfiles/ssh/{{ item.ssh_config }}
|
||||
dest: /home/{{ item.username }}/.ssh/config
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
when: not server
|
||||
|
||||
# Git config
|
||||
- name: dotfiles -- Copy gitconfig
|
||||
template:
|
||||
src: files/dotfiles/gitconfig
|
||||
dest: /home/{{ me.username }}/.gitconfig
|
||||
owner: "{{ me.username }}"
|
||||
group: "{{ me.group }}"
|
||||
when: me in users
|
||||
dest: /home/{{ item.username }}/.gitconfig
|
||||
owner: "{{ item.username }}"
|
||||
group: "{{ item.group }}"
|
||||
with_items: "{{ dotusers }}"
|
||||
when: not server
|
||||
|
@ -1,5 +1,6 @@
|
||||
---
|
||||
users: ["{{ admin }}", "{{ content }}"]
|
||||
dotusers: ["{{ admin }}"]
|
||||
|
||||
minimal: true
|
||||
server: true
|
||||
|
Loading…
Reference in New Issue
Block a user