2019-10-06 20:41:31 +00:00
|
|
|
---
|
|
|
|
# Common/Usersettings: Universial Dotfiles. Update regularly.
|
|
|
|
|
2021-12-08 11:24:54 +00:00
|
|
|
- name: usersettings - Install required tools
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name: "{{ packages }}"
|
|
|
|
state: present
|
|
|
|
update_cache: yes
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- git
|
|
|
|
- python3-pip
|
|
|
|
|
2019-10-10 14:49:55 +00:00
|
|
|
- name: usersettings - Install/ Update oh-my-zsh for current user
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.git:
|
2019-10-06 20:41:31 +00:00
|
|
|
repo: https://github.com/robbyrussell/oh-my-zsh.git
|
|
|
|
dest: .oh-my-zsh
|
|
|
|
|
|
|
|
- name: usersettings - Install/ Update fzf sources
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.git:
|
2019-10-06 20:41:31 +00:00
|
|
|
repo: https://github.com/junegunn/fzf.git
|
|
|
|
dest: .fzf
|
2019-11-12 20:42:58 +00:00
|
|
|
register: fzf_git
|
2019-10-06 20:41:31 +00:00
|
|
|
- name: (Re-)Install fzf
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.shell: ".fzf/install --key-bindings --no-completion --no-update-rc"
|
2019-10-06 20:41:31 +00:00
|
|
|
when:
|
|
|
|
- fzf_git.after != fzf_git.before
|
|
|
|
|
2020-03-19 17:17:57 +00:00
|
|
|
- name: usersettings - Install pip virtualenvwrapper
|
|
|
|
block:
|
|
|
|
- name: usersettings - Install pip virtualenvwrapper (Debian)
|
|
|
|
become: yes
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.pip:
|
2020-03-19 17:17:57 +00:00
|
|
|
name: virtualenvwrapper
|
|
|
|
extra_args: --system
|
|
|
|
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Debian"
|
|
|
|
- name: usersettings - Install pip virtualenvwrapper (macOS)
|
|
|
|
environment:
|
|
|
|
PATH: "/usr/local/bin:{{ ansible_env.PATH }}"
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.pip:
|
2020-03-19 17:17:57 +00:00
|
|
|
name: virtualenvwrapper
|
|
|
|
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Darwin"
|
|
|
|
- name: usersettings - Install pip virtualenvwrapper (CentOS, ArchLinux)
|
|
|
|
become: yes
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.pip:
|
2020-03-19 17:17:57 +00:00
|
|
|
name: virtualenvwrapper
|
2021-08-28 14:58:03 +00:00
|
|
|
when:
|
|
|
|
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Centos" or
|
2020-03-19 17:17:57 +00:00
|
|
|
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Archlinux"
|
|
|
|
when: usersetup_virtualenvwrapper
|
2019-10-06 20:41:31 +00:00
|
|
|
- name: usersettings - Copy dotfiles
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.copy:
|
2019-10-06 20:41:31 +00:00
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
with_items:
|
2021-08-28 14:58:03 +00:00
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/files/_gitignore_global",
|
|
|
|
dest: ".gitignore_global",
|
|
|
|
}
|
2020-03-27 22:13:20 +00:00
|
|
|
- { src: "{{ role_path }}/files/_vimrc", dest: ".vimrc" }
|
2021-08-28 14:58:03 +00:00
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/files/_oh-my-zsh/jtbx.zsh-theme",
|
|
|
|
dest: ".oh-my-zsh/custom/themes/jtbx.zsh-theme",
|
|
|
|
}
|
2020-03-19 17:17:57 +00:00
|
|
|
- name: usersettings - Set zshrc
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.template:
|
2020-03-19 17:17:57 +00:00
|
|
|
src: "{{ role_path }}/templates/_zshrc.j2"
|
|
|
|
dest: "{{ ansible_user_dir }}/.zshrc"
|
2019-10-14 06:00:17 +00:00
|
|
|
- name: usersettings - Set global gitconfig
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.template:
|
2020-01-16 09:46:42 +00:00
|
|
|
src: "{{ role_path }}/templates/_gitconfig.j2"
|
|
|
|
dest: "{{ ansible_user_dir }}/.gitconfig"
|
2019-10-14 06:00:17 +00:00
|
|
|
when: usersetup_gitconfig == true
|
2020-03-27 22:30:50 +00:00
|
|
|
- name: usersettings - Set tmux.conf
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.template:
|
2020-03-27 22:30:50 +00:00
|
|
|
src: "{{ role_path }}/templates/_tmux.conf.j2"
|
|
|
|
dest: "{{ ansible_user_dir }}/.tmux.conf"
|
2019-10-06 20:41:31 +00:00
|
|
|
|
2019-10-27 21:34:31 +00:00
|
|
|
- name: usersettings - Create .vim directory
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.file:
|
2019-10-27 21:34:31 +00:00
|
|
|
path: .vim/autoload
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: usersettings - Install vim plugin manager
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.get_url:
|
2019-10-27 21:34:31 +00:00
|
|
|
url: https://tpo.pe/pathogen.vim
|
|
|
|
dest: .vim/autoload/pathogen.vim
|
|
|
|
|
2019-10-06 20:41:31 +00:00
|
|
|
- name: usersettings - Install vim plugins
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.git:
|
2019-10-06 20:41:31 +00:00
|
|
|
repo: "{{ item.repo }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
with_items:
|
2021-08-28 14:58:03 +00:00
|
|
|
- {
|
|
|
|
repo: "https://github.com/itchyny/lightline.vim",
|
|
|
|
dest: ".vim/bundle/lightline",
|
|
|
|
}
|
2019-11-12 20:42:58 +00:00
|
|
|
- { repo: "https://github.com/w0rp/ale", dest: ".vim/bundle/ale" }
|
2021-08-28 14:58:03 +00:00
|
|
|
- {
|
|
|
|
repo: "https://github.com/airblade/vim-gitgutter",
|
|
|
|
dest: ".vim/bundle/vim-gitgutter",
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
repo: "https://github.com/sheerun/vim-polyglot",
|
|
|
|
dest: ".vim/bundle/vim-polyglot",
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
repo: "https://github.com/tpope/vim-commentary",
|
|
|
|
dest: ".vim/bundle/vim-commentary",
|
|
|
|
}
|