Ansible_workstation/tasks/dotfiles.yml

151 lines
3.9 KiB
YAML
Raw Normal View History

2018-08-23 12:32:42 +00:00
---
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy tmux.conf
2018-08-23 14:15:52 +00:00
template:
src: files/dotfiles/tmux.conf
2018-08-23 14:15:52 +00:00
dest: /home/{{ item.username }}/.tmux.conf
2018-08-23 14:42:26 +00:00
owner: "{{ item.username }}"
group: "{{ item.group }}"
2018-08-25 13:36:24 +00:00
with_items: "{{ me }}"
2018-08-23 14:15:52 +00:00
2019-06-09 09:05:33 +00:00
# Zsh config
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Download antibody
get_url:
url: https://raw.githubusercontent.com/getantibody/installer/master/install
dest: /tmp/antibody.sh
mode: 0770
when: prompt == "zsh"
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Execute the antibody.sh
shell: /tmp/antibody.sh
become: yes
ignore_errors: yes
when: prompt == "zsh"
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Remove the antibody.sh
file: path=/tmp/antibody.sh state=absent
when: prompt == "zsh"
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy local zshrc
2018-11-12 09:08:52 +00:00
template:
src: files/dotfiles/zshrc
2018-11-12 09:08:52 +00:00
dest: /home/{{ item.username }}/.zshrc
owner: "{{ item.username }}"
group: "{{ item.group }}"
2018-11-12 09:08:52 +00:00
with_items: "{{ me }}"
2019-02-08 07:17:42 +00:00
when: prompt == 'zsh'
2018-11-12 09:08:52 +00:00
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy local zshrc.local
template:
src: files/dotfiles/zshrc.local
dest: /home/{{ item.username }}/.zshrc.local
owner: "{{ item.username }}"
group: "{{ item.group }}"
with_items: "{{ me }}"
2019-02-08 07:17:42 +00:00
when: prompt == 'zsh'
2018-08-23 14:41:22 +00:00
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy local zsh_plugins.txt
2018-11-12 09:08:52 +00:00
template:
src: files/dotfiles/zsh_plugins.txt
2018-11-12 09:08:52 +00:00
dest: /home/{{ item.username }}/.zsh_plugins.txt
owner: "{{ item.username }}"
group: "{{ item.group }}"
2018-11-12 09:08:52 +00:00
with_items: "{{ me }}"
2019-02-08 07:17:42 +00:00
when: prompt == 'zsh'
2018-11-12 09:08:52 +00:00
2019-06-09 09:05:33 +00:00
# Fish config
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Create fish config directory
2019-06-09 09:44:40 +00:00
file:
dest: /home/{{ item.username }}/.config/fish/
state: directory
with_items: "{{ me }}"
when: prompt == 'fish'
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy config.fish
2019-06-09 09:44:40 +00:00
template:
src: files/dotfiles/config.fish
dest: /home/{{ item.username }}/.config/fish/
owner: "{{ item.username }}"
group: "{{ item.group }}"
with_items: "{{ me }}"
when: prompt == 'fish'
register: fishconfig
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy fisher plugin list
2019-06-09 09:44:40 +00:00
template:
src: files/dotfiles/fishfile
dest: /home/{{ item.username }}/.config/fish/
owner: "{{ item.username }}"
group: "{{ item.group }}"
with_items: "{{ me }}"
when: prompt == 'fish'
register: fishplugin
2019-06-09 09:05:33 +00:00
# Vim config
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy .vim/
copy:
src: files/dotfiles/vim/
2018-08-23 14:45:48 +00:00
dest: /home/{{ item.username }}/.vim/
owner: "{{ item.username }}"
group: "{{ item.group }}"
2018-08-23 14:45:48 +00:00
with_items: "{{ me }}"
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Creates .vim/autoload/
file:
path: /home/{{ item.username }}/.vim/autoload/
state: directory
with_items: "{{ me }}"
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Download plug.vim
2018-08-23 14:41:22 +00:00
get_url:
url: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
dest: /home/{{ item.username }}/.vim/autoload/plug.vim
2018-08-23 14:42:26 +00:00
owner: "{{ item.username }}"
group: "{{ item.group }}"
2018-08-23 14:41:22 +00:00
with_items: "{{ me }}"
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy vimrc
2018-08-23 14:41:22 +00:00
template:
src: files/dotfiles/vimrc
2018-08-23 14:41:22 +00:00
dest: /home/{{ item.username }}/.vimrc
2018-08-23 14:42:26 +00:00
owner: "{{ item.username }}"
group: "{{ item.group }}"
2018-08-23 14:41:22 +00:00
with_items: "{{ me }}"
2019-06-09 09:05:33 +00:00
# Ssh config
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Creates .ssh
2018-08-23 15:25:03 +00:00
file:
path: /home/{{ item.username }}/.ssh/
state: directory
2018-08-23 15:35:23 +00:00
owner: "{{ item.username }}"
group: "{{ item.group }}"
2018-08-23 15:25:03 +00:00
with_items: "{{ me }}"
2020-02-24 05:55:28 +00:00
when: not server
2018-08-23 15:25:03 +00:00
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy ssh user config
2019-05-14 13:10:05 +00:00
template:
src: files/dotfiles/sshconfig
dest: /home/{{ item.username }}/.ssh/config
owner: "{{ item.username }}"
group: "{{ item.group }}"
with_items: "{{ deploy_users }}"
2020-02-24 05:55:28 +00:00
when: not server
2019-05-14 13:10:05 +00:00
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy ssh user config
2018-08-23 15:25:03 +00:00
template:
src: files/dotfiles/sshconfig
2018-08-23 15:25:03 +00:00
dest: /home/{{ item.username }}/.ssh/config
owner: "{{ item.username }}"
group: "{{ item.group }}"
2018-08-23 15:25:03 +00:00
with_items: "{{ me }}"
2020-02-24 05:55:28 +00:00
when: not server
2018-08-23 15:25:03 +00:00
2019-06-09 09:05:33 +00:00
# Git config
2020-03-17 04:44:48 +00:00
- name: dotfiles -- Copy gitconfig
2018-08-23 16:00:30 +00:00
template:
src: files/dotfiles/gitconfig
2018-08-23 16:00:30 +00:00
dest: /home/{{ item.username }}/.gitconfig
owner: "{{ item.username }}"
group: "{{ item.group }}"
2018-08-23 16:00:30 +00:00
with_items: "{{ me }}"
2020-02-24 05:55:28 +00:00
when: not server