mirror of
https://github.com/morten-olsen/configs.git
synced 2026-02-08 00:46:24 +01:00
60 lines
1.1 KiB
YAML
60 lines
1.1 KiB
YAML
---
|
|
- name: Install dependencies
|
|
tags:
|
|
- git
|
|
- install
|
|
become: "{{ install_with_root }}"
|
|
ansible.builtin.package:
|
|
name:
|
|
- git
|
|
- git-delta
|
|
|
|
- name: Copy config
|
|
tags:
|
|
- git
|
|
- config
|
|
ansible.builtin.file:
|
|
mode: "{{ item.mode }}"
|
|
path: "{{ home }}/{{ item.path }}"
|
|
state: directory
|
|
with_community.general.filetree:
|
|
- ../files
|
|
loop_control:
|
|
label: "{{ item.path }}"
|
|
when: item.state == 'directory'
|
|
|
|
- name: "Copy configs"
|
|
tags:
|
|
- git
|
|
- config
|
|
ansible.builtin.copy:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ home }}/{{ item.path }}"
|
|
mode: "{{ item.mode }}"
|
|
with_community.general.filetree:
|
|
- ../files
|
|
loop_control:
|
|
label: "{{ item.path }}"
|
|
when: item.state == 'file'
|
|
|
|
- name: Setup config
|
|
tags:
|
|
- git
|
|
- config
|
|
ansible.builtin.template:
|
|
src: "../templates/gitconfig.j2"
|
|
dest: "{{ home }}/.gitconfig"
|
|
mode: "644"
|
|
|
|
- name: Setup contexts
|
|
tags:
|
|
- git
|
|
- config
|
|
include_tasks: "setup-context.yml"
|
|
vars:
|
|
name: "{{ item.key }}"
|
|
context: "{{ item.value }}"
|
|
loop: "{{ contexts | dict2items }}"
|
|
loop_control:
|
|
label: "{{ item.key }}"
|