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
|
2023-01-07 16:26:51 +00:00
|
|
|
become: true
|
|
|
|
ignore_errors: true # just fail on systems without sudo access
|
2022-01-07 09:34:03 +00:00
|
|
|
ansible.builtin.package:
|
2021-12-08 11:24:54 +00:00
|
|
|
name: "{{ packages }}"
|
|
|
|
state: present
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- git
|
|
|
|
|
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
|
2022-06-16 09:07:42 +00:00
|
|
|
dest: "{{ ansible_user_dir }}/.oh-my-zsh"
|
2019-10-06 20:41:31 +00:00
|
|
|
|
|
|
|
- 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
|
2022-06-16 09:07:42 +00:00
|
|
|
dest: "{{ ansible_user_dir }}/.fzf"
|
2019-11-12 20:42:58 +00:00
|
|
|
register: fzf_git
|
2019-10-06 20:41:31 +00:00
|
|
|
- name: (Re-)Install fzf
|
|
|
|
when:
|
|
|
|
- fzf_git.after != fzf_git.before
|
2022-02-13 19:52:22 +00:00
|
|
|
ansible.builtin.shell: ".fzf/install --key-bindings --no-completion --no-update-rc"
|
2019-10-06 20:41:31 +00:00
|
|
|
|
2020-03-19 17:17:57 +00:00
|
|
|
- name: usersettings - Install pip virtualenvwrapper
|
2022-02-13 19:28:25 +00:00
|
|
|
when: usersetup_virtualenvwrapper
|
2020-03-19 17:17:57 +00:00
|
|
|
block:
|
2022-02-13 19:28:25 +00:00
|
|
|
- name: usersettings - Install pip3
|
|
|
|
when:
|
|
|
|
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) != "Darwin" and
|
|
|
|
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) != "FreeBSD"
|
2023-01-07 16:26:51 +00:00
|
|
|
become: true
|
|
|
|
ignore_errors: true # just fail on systems without sudo access
|
2022-02-13 19:28:25 +00:00
|
|
|
ansible.builtin.package:
|
|
|
|
name: "{{ packages }}"
|
|
|
|
state: present
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- python3-pip
|
2023-08-04 16:47:11 +00:00
|
|
|
- name: usersettings - Install pip virtualenvwrapper (Debian, Archlinux)
|
|
|
|
when:
|
|
|
|
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Debian" or
|
|
|
|
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Archlinux"
|
2023-01-07 16:26:51 +00:00
|
|
|
become: true
|
2023-08-04 16:47:11 +00:00
|
|
|
ansible.builtin.package:
|
|
|
|
name: python-virtualenvwrapper
|
2020-03-19 17:17:57 +00:00
|
|
|
- name: usersettings - Install pip virtualenvwrapper (macOS)
|
2022-02-13 19:52:22 +00:00
|
|
|
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Darwin"
|
2020-03-19 17:17:57 +00:00
|
|
|
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
|
|
|
|
- name: usersettings - Install pip virtualenvwrapper (CentOS, ArchLinux)
|
2021-08-28 14:58:03 +00:00
|
|
|
when:
|
2023-08-04 16:47:11 +00:00
|
|
|
(override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Centos"
|
2023-01-07 16:26:51 +00:00
|
|
|
become: true
|
2022-02-13 19:52:22 +00:00
|
|
|
ansible.builtin.pip:
|
|
|
|
name: 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",
|
2022-06-16 09:07:42 +00:00
|
|
|
dest: "{{ ansible_user_dir }}/.gitignore_global",
|
|
|
|
}
|
2022-08-06 11:22:37 +00:00
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/files/_config/mpv.conf",
|
|
|
|
dest: "{{ ansible_user_dir }}/.config/mpv/",
|
|
|
|
}
|
2021-08-28 14:58:03 +00:00
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/files/_oh-my-zsh/jtbx.zsh-theme",
|
2022-06-16 09:07:42 +00:00
|
|
|
dest: "{{ ansible_user_dir }}/.oh-my-zsh/custom/themes/jtbx.zsh-theme",
|
2021-08-28 14:58:03 +00:00
|
|
|
}
|
2022-12-04 14:10:33 +00:00
|
|
|
- name: usersettings - Create some directories
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "{{ ansible_user_dir }}/.config/htop/"
|
|
|
|
- name: usersettings - Set templated dotfiles
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.template:
|
2022-12-04 14:10:33 +00:00
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
force: "{{ item.force }}"
|
|
|
|
ignore_errors: true
|
|
|
|
with_items:
|
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/templates/_zshrc.j2",
|
|
|
|
dest: "{{ ansible_user_dir }}/.zshrc",
|
|
|
|
force: yes,
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/templates/_tmux.conf.j2",
|
|
|
|
dest: "{{ ansible_user_dir }}/.tmux.conf",
|
|
|
|
force: yes,
|
|
|
|
}
|
2023-01-07 16:26:51 +00:00
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/templates/_vimrc.j2",
|
|
|
|
dest: "{{ ansible_user_dir }}/.vimrc",
|
|
|
|
force: yes,
|
|
|
|
}
|
2022-12-04 14:10:33 +00:00
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/templates/htoprc.j2",
|
|
|
|
dest: "{{ ansible_user_dir }}/.config/htop/htoprc",
|
|
|
|
force: no,
|
|
|
|
}
|
2019-10-14 06:00:17 +00:00
|
|
|
- name: usersettings - Set global gitconfig
|
2022-02-13 19:52:22 +00:00
|
|
|
when: usersetup_gitconfig == true
|
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-06 20:41:31 +00:00
|
|
|
|
2023-01-07 16:26:51 +00:00
|
|
|
- name: usersettings - Vim Plugings
|
|
|
|
when: usersetup_vimplugins == true
|
|
|
|
block:
|
|
|
|
- name: usersettings - Create .vim directory
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ ansible_user_dir }}/.vim/autoload"
|
|
|
|
state: directory
|
|
|
|
- name: usersettings - Install vim plugin manager
|
|
|
|
ansible.builtin.get_url:
|
|
|
|
url: https://tpo.pe/pathogen.vim
|
|
|
|
dest: "{{ ansible_user_dir }}/.vim/autoload/pathogen.vim"
|
|
|
|
- name: usersettings - Install vim plugins
|
|
|
|
ansible.builtin.git:
|
|
|
|
repo: "{{ item.repo }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
with_items:
|
|
|
|
- {
|
|
|
|
repo: "https://github.com/itchyny/lightline.vim",
|
|
|
|
dest: "{{ ansible_user_dir }}/.vim/bundle/lightline",
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
repo: "https://github.com/w0rp/ale",
|
|
|
|
dest: "{{ ansible_user_dir }}/.vim/bundle/ale",
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
repo: "https://github.com/airblade/vim-gitgutter",
|
|
|
|
dest: "{{ ansible_user_dir }}/.vim/bundle/vim-gitgutter",
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
repo: "https://github.com/sheerun/vim-polyglot",
|
|
|
|
dest: "{{ ansible_user_dir }}/.vim/bundle/vim-polyglot",
|
|
|
|
}
|
|
|
|
- {
|
|
|
|
repo: "https://github.com/tpope/vim-commentary",
|
|
|
|
dest: "{{ ansible_user_dir }}/.vim/bundle/vim-commentary",
|
|
|
|
}
|