Add git role for unix-like OS families and Windows
This commit is contained in:
parent
66444c69a6
commit
d4218aeeee
@ -4,7 +4,9 @@
|
|||||||
- zsh
|
- zsh
|
||||||
- tmux
|
- tmux
|
||||||
- neovim
|
- neovim
|
||||||
|
- git
|
||||||
|
|
||||||
- hosts: windows
|
- hosts: windows
|
||||||
roles:
|
roles:
|
||||||
- neovim
|
- neovim
|
||||||
|
- git
|
||||||
|
9
roles/git/tasks/Windows.yaml
Normal file
9
roles/git/tasks/Windows.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: clone config repos
|
||||||
|
win_git:
|
||||||
|
repo: '{{item.repo}}'
|
||||||
|
dest: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
|
||||||
|
version: master
|
||||||
|
with_items: '{{git_config_repos}}'
|
||||||
|
|
||||||
|
# TODO: - name: install pip packages
|
5
roles/git/tasks/main.yaml
Normal file
5
roles/git/tasks/main.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- when: ansible_os_family != "Windows"
|
||||||
|
include_tasks: 'unix.yaml'
|
||||||
|
- when: ansible_os_family == "Windows"
|
||||||
|
include_tasks: 'Windows.yaml'
|
25
roles/git/tasks/unix.yaml
Normal file
25
roles/git/tasks/unix.yaml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
- name: clone config repos
|
||||||
|
git:
|
||||||
|
repo: '{{item.repo}}'
|
||||||
|
dest: '~/.config/{{item.name}}'
|
||||||
|
version: master
|
||||||
|
with_items: '{{git_config_repos}}'
|
||||||
|
|
||||||
|
- name: install homebrew packages
|
||||||
|
when: ansible_os_family == "Darwin"
|
||||||
|
homebrew:
|
||||||
|
name: gpg
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: install pip packages
|
||||||
|
pip:
|
||||||
|
name: '{{git_pip_packages}}'
|
||||||
|
extra_args: --user
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: create symbolic links
|
||||||
|
file:
|
||||||
|
state: link
|
||||||
|
src: ~/.config/git/_git-changes
|
||||||
|
dest: ~/.local/share/zsh/site-functions/_git-changes
|
8
roles/git/vars/main.yaml
Normal file
8
roles/git/vars/main.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
git_config_repos:
|
||||||
|
- repo: git@code.infektor.net:config/git.git
|
||||||
|
name: git
|
||||||
|
- repo: git@code.infektor.net:benie/config.git
|
||||||
|
name: private
|
||||||
|
git_pip_packages:
|
||||||
|
- git+https://github.com/kbenzie/git-issue.git
|
Loading…
x
Reference in New Issue
Block a user