This commit is contained in:
Morten Olsen
2024-10-09 21:52:49 +02:00
parent d7fd68465d
commit f1c103c157
4 changed files with 20 additions and 17 deletions

View File

@@ -1,3 +1,14 @@
- name: Ensure dir
tags:
- git
- config
become: "{{ use_become }}"
ansible.builtin.file:
path: "{{ home }}/{{ context.path }}"
state: directory
owner: "{{ username }}"
mode: "0700"
- name: Setup context git config
tags:
- git
@@ -5,7 +16,7 @@
become: "{{ use_become }}"
ansible.builtin.template:
src: "../templates/gitconfig.context.j2"
dest: "{{ context.path }}/.gitconfig"
dest: "{{ home }}/{{ context.path }}/.gitconfig"
owner: "{{ username }}"
mode: "644"
vars:
@@ -13,17 +24,6 @@
name: "{{ name }}"
when: "'git' in context"
- name: Ensure dir
tags:
- git
- config
become: "{{ use_become }}"
ansible.builtin.file:
path: "{{ context.path }}"
state: directory
owner: "{{ username }}"
mode: "0700"
- name: Setup context ssh config
tags:
- git
@@ -58,5 +58,5 @@
content: "{{ context.git.signing_key }}"
dest: "{{ home }}/.ssh/keys/github-{{ name }}.pub"
owner: "{{ username }}"
mode: "0644"
mode: "0600"
when: "'git' in context and 'signing_key' in context.git"