mirror of
https://github.com/morten-olsen/configs.git
synced 2026-02-08 00:46:24 +01:00
fix permissions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user