2019-10-06 20:41:31 +00:00
|
|
|
---
|
|
|
|
# Common/Usersettings: Universial Dotfiles. Update regularly.
|
|
|
|
|
2023-04-28 21:25:25 +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
|
2023-04-28 21:25:25 +00:00
|
|
|
diff: false
|
2021-12-08 11:24:54 +00:00
|
|
|
|
2023-04-28 21:25:25 +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"
|
2023-04-28 21:25:25 +00:00
|
|
|
diff: false
|
2019-10-06 20:41:31 +00:00
|
|
|
|
2023-04-28 21:25:25 +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
|
2023-04-28 21:25:25 +00:00
|
|
|
diff: false
|
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
|
|
|
|
2023-04-28 21:25:25 +00:00
|
|
|
- name: Usersettings - Install pip virtualenvwrapper
|
2022-02-13 19:28:25 +00:00
|
|
|
when: usersetup_virtualenvwrapper
|
2023-04-28 21:25:25 +00:00
|
|
|
diff: false
|
2020-03-19 17:17:57 +00:00
|
|
|
block:
|
2023-04-28 21:25:25 +00:00
|
|
|
- name: Usersettings - Install pip3
|
2022-02-13 19:28:25 +00:00
|
|
|
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-04-28 21:25:25 +00:00
|
|
|
diff: false
|
|
|
|
- name: Usersettings - Install pip virtualenvwrapper (Debian)
|
2022-02-13 19:52:22 +00:00
|
|
|
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Debian"
|
2023-01-07 16:26:51 +00:00
|
|
|
become: true
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.pip:
|
2020-03-19 17:17:57 +00:00
|
|
|
name: virtualenvwrapper
|
|
|
|
extra_args: --system
|
2023-04-28 21:25:25 +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
|
2023-04-28 21:25:25 +00:00
|
|
|
- name: Usersettings - Install pip virtualenvwrapper (CentOS, ArchLinux)
|
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"
|
2023-01-07 16:26:51 +00:00
|
|
|
become: true
|
2022-02-13 19:52:22 +00:00
|
|
|
ansible.builtin.pip:
|
|
|
|
name: virtualenvwrapper
|
2023-04-28 21:25:25 +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
|
|
|
}
|
2023-04-28 21:25:25 +00:00
|
|
|
- name: Usersettings - Create some directories
|
2022-12-04 14:10:33 +00:00
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "{{ ansible_user_dir }}/.config/htop/"
|
2023-04-28 21:25:25 +00:00
|
|
|
- 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",
|
2023-04-28 21:25:25 +00:00
|
|
|
force: true,
|
2022-12-04 14:10:33 +00:00
|
|
|
}
|
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/templates/_tmux.conf.j2",
|
|
|
|
dest: "{{ ansible_user_dir }}/.tmux.conf",
|
2023-04-28 21:25:25 +00:00
|
|
|
force: true,
|
2022-12-04 14:10:33 +00:00
|
|
|
}
|
2023-01-07 16:26:51 +00:00
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/templates/_vimrc.j2",
|
|
|
|
dest: "{{ ansible_user_dir }}/.vimrc",
|
2023-04-28 21:25:25 +00:00
|
|
|
force: true,
|
2023-01-07 16:26:51 +00:00
|
|
|
}
|
2022-12-04 14:10:33 +00:00
|
|
|
- {
|
|
|
|
src: "{{ role_path }}/templates/htoprc.j2",
|
|
|
|
dest: "{{ ansible_user_dir }}/.config/htop/htoprc",
|
2024-11-25 13:16:37 +00:00
|
|
|
force: false,
|
2022-12-04 14:10:33 +00:00
|
|
|
}
|
2023-04-28 21:25:25 +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-04-28 21:25:25 +00:00
|
|
|
- name: Usersettings - Vim Plugings
|
2023-01-07 16:26:51 +00:00
|
|
|
when: usersetup_vimplugins == true
|
|
|
|
block:
|
2023-04-28 21:25:25 +00:00
|
|
|
- name: Usersettings - Create .vim directory
|
2023-01-07 16:26:51 +00:00
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ ansible_user_dir }}/.vim/autoload"
|
|
|
|
state: directory
|
2023-04-28 21:25:25 +00:00
|
|
|
- name: Usersettings - Install vim plugin manager
|
2023-01-07 16:26:51 +00:00
|
|
|
ansible.builtin.get_url:
|
|
|
|
url: https://tpo.pe/pathogen.vim
|
|
|
|
dest: "{{ ansible_user_dir }}/.vim/autoload/pathogen.vim"
|
2023-04-28 21:25:25 +00:00
|
|
|
- name: Usersettings - Install vim plugins
|
2023-01-07 16:26:51 +00:00
|
|
|
ansible.builtin.git:
|
|
|
|
repo: "{{ item.repo }}"
|
|
|
|
dest: "{{ item.dest }}"
|
2023-04-28 21:25:25 +00:00
|
|
|
diff: false
|
2023-01-07 16:26:51 +00:00
|
|
|
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",
|
|
|
|
}
|
2023-04-28 21:25:25 +00:00
|
|
|
# TODO: https://github.com/jan-warchol/selenized
|