41 lines
891 B
YAML
41 lines
891 B
YAML
---
|
|
- name: Install git (Debian)
|
|
when: ansible_os_family == "Debian"
|
|
become: yes
|
|
apt: name={{ item }} state=latest update_cache=yes
|
|
loop: [git, git-crypt]
|
|
|
|
- name: Install git (macOS)
|
|
when: ansible_os_family == "Darwin"
|
|
homebrew: name={{ item }} state=latest
|
|
loop: [git, git-crypt]
|
|
|
|
- name: Create the git config directory
|
|
file:
|
|
path: ~/.config/git
|
|
state: directory
|
|
|
|
- name: Deploy git config
|
|
file:
|
|
src: "{{ role_path }}/files/{{ item }}"
|
|
dest: "~/.config/git/{{ item }}"
|
|
state: link
|
|
force: yes
|
|
loop:
|
|
- config
|
|
- ignore
|
|
|
|
- name: Create bin directory for additional git commands
|
|
file:
|
|
path: ~/.local/bin
|
|
state: directory
|
|
|
|
- name: Deploy additional git commands
|
|
file:
|
|
src: "{{ item }}"
|
|
dest: "~/.local/bin/{{ item | basename }}"
|
|
state: link
|
|
force: yes
|
|
with_fileglob:
|
|
- ./bin/*
|
|
|