ansible: fix git role syntax for consistency

This commit is contained in:
Fernando Schauenburg 2020-12-17 20:04:32 +01:00
parent 819b21a718
commit 4a05ea02ec

View file

@ -1,44 +1,58 @@
- name: Install git (Debian) - name: Install git with apt
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
become: yes become: yes
apt: name={{ item }} state=latest update_cache=yes apt:
loop: [git, git-crypt, git-lfs] update_cache: yes
state: latest
name:
- git
- git-crypt
- git-lfs
- name: Install git (macOS)
- name: Install git with homebrew
when: ansible_os_family == "Darwin" when: ansible_os_family == "Darwin"
homebrew: name={{ item }} state=latest homebrew:
loop: [git, git-crypt, git-lfs] state: latest
name:
- git
- git-crypt
- git-lfs
- name: Create the git config directories - name: Create the git config directories
file: file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
loop: loop:
- ~/.config/git - ~/.config/git
- ~/.local/bin - ~/.local/bin
- ~/.local/etc/git - ~/.local/etc/git
- name: Deploy git config - name: Deploy git config
file: file:
src: "{{ role_path }}/files/{{ item }}" src: "{{ role_path }}/files/{{ item }}"
dest: "~/.config/git/{{ item }}" dest: ~/.config/git/{{ item }}
state: link state: link
force: yes force: yes
loop: loop:
- config - config
- ignore - ignore
- name: Deploy git host-specific config - name: Deploy git host-specific config
template: template:
src: config.host.j2 src: config.host.j2
dest: ~/.local/etc/git/config.host dest: ~/.local/etc/git/config.host
- name: Deploy additional git commands - name: Deploy additional git commands
file: file:
src: "{{ item }}" src: "{{ item }}"
dest: "~/.local/bin/{{ item | basename }}" dest: "~/.local/bin/{{ item | basename }}"
state: link state: link
force: yes force: yes
with_fileglob: with_fileglob:
- ./bin/* - "{{ role_path }}/files/bin/*"