fix permissions

This commit is contained in:
Morten Olsen
2024-10-08 21:25:10 +02:00
parent 134a64b30a
commit 034994e398
16 changed files with 64 additions and 28 deletions

View File

@@ -16,6 +16,7 @@
ansible.builtin.file:
mode: "{{ item.mode }}"
path: "{{ home }}/{{ item.path }}"
owner: "{{ username }}"
state: directory
with_community.general.filetree:
- ../files
@@ -30,6 +31,7 @@
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ home }}/{{ item.path }}"
owner: "{{ username }}"
mode: "{{ item.mode }}"
with_community.general.filetree:
- ../files
@@ -44,6 +46,7 @@
ansible.builtin.template:
src: "../templates/gitconfig.j2"
dest: "{{ home }}/.gitconfig"
owner: "{{ username }}"
mode: "644"
- name: Setup contexts

View File

@@ -5,12 +5,23 @@
ansible.builtin.template:
src: "../templates/gitconfig.context.j2"
dest: "{{ context.path }}/.gitconfig"
owner: "{{ username }}"
mode: "644"
vars:
git: "{{ context.git }}"
name: "{{ name }}"
when: "'git' in context"
- name: Ensure dir
tags:
- git
- config
ansible.builtin.file:
path: "{{ context.path }}"
state: directory
owner: "{{ username }}"
mode: "0700"
- name: Setup context ssh config
tags:
- git
@@ -18,6 +29,7 @@
ansible.builtin.template:
src: "../templates/sshconfig.context.j2"
dest: "{{ home }}/.ssh/config.d/git-{{ name }}"
owner: "{{ username }}"
mode: "644"
vars:
name: "{{ name }}"
@@ -30,6 +42,7 @@
ansible.builtin.file:
path: "{{ home }}/.ssh/keys"
state: directory
owner: "{{ username }}"
mode: "0700"
- name: Setup context public key
@@ -39,5 +52,6 @@
ansible.builtin.copy:
content: "{{ context.git.signing_key }}"
dest: "{{ home }}/.ssh/keys/github-{{ name }}.pub"
owner: "{{ username }}"
mode: "0644"
when: "'git' in context and 'signing_key' in context.git"