aboutsummaryrefslogtreecommitdiffstats
path: root/roles/git/tasks
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-07-29 17:00:20 +0200
committerRomain Gonçalves <me@rgoncalves.se>2021-07-29 17:00:20 +0200
commitb232b894c3cbe087c8d504e91637dcf62199eed1 (patch)
treeea72a7d1a7f63c6425ee46785e1cec924351b2c3 /roles/git/tasks
parent22126073344e60c405d086df37b64da0c6d3c086 (diff)
downloadinfrastructure-b232b894c3cbe087c8d504e91637dcf62199eed1.tar.gz
Bump to third revision of homelab
Diffstat (limited to 'roles/git/tasks')
-rw-r--r--roles/git/tasks/main.yml53
1 files changed, 25 insertions, 28 deletions
diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml
index 5600e2d..a421ad0 100644
--- a/roles/git/tasks/main.yml
+++ b/roles/git/tasks/main.yml
@@ -5,7 +5,9 @@
---
- name: ensure git package is present
- package: name=git state=present
+ package:
+ name: git
+ state: present
- name: ensure git group exists
group:
@@ -17,43 +19,38 @@
name: "{{ git_user }}"
group: "{{ git_group }}"
shell: "{{ git_shell }}"
- home: "/home/{{ git_user }}"
+ home: "{{ git_dir }}"
create_home: false
-- name: ensure git home directory is not created
- file: path="/home/{{ git_user }}" state=absent
-
-- name: ensure git-only directory exists
- file:
- path: "{{ git_dir }}"
- owner: "{{ git_user }}"
- group: "{{ git_group }}"
- state: directory
- mode: 0755
-
-- name: link git user home directory with git root repository
- file:
- src: "{{ git_dir }}"
- dest: "/home/{{ git_user }}"
- owner: "{{ git_user }}"
- group: "{{ git_group }}"
- mode: 0750
- force: true
- state: link
-
-- name: ensure git-shell-commands directory exists
+- name: ensure git directories exist
file:
- path: "/home/{{ git_user }}/git-shell-commands"
+ path: "{{ item }}"
owner: "{{ git_user }}"
group: "{{ git_group }}"
state: directory
- mode: 0755
+ mode: "0755"
+ loop:
+ - "{{ git_dir }}"
+ - "{{ git_dir }}/git-shell-commands"
- name: generate git-shell no-login prompt
template:
src: no-interactive-login.j2
- dest: "/home/{{ git_user }}/git-shell-commands/no-interactive-login"
+ dest: "{{ git_dir }}/git-shell-commands/no-interactive-login"
owner: "{{ git_user }}"
group: "{{ git_group }}"
- mode: 0744
+ mode: "0744"
when: git_nologin is defined and git_nologin
+
+- name: generate gitconfig
+ template:
+ src: gitconfig.j2
+ dest: "{{ git_dir }}/.gitconfig"
+ owner: "{{ git_user }}"
+ group: "{{ git_group }}"
+ mode: "0644"
+
+- name: synchronize ssh key
+ include_role:
+ name: sshd
+ tasks_from: sync_keys
remember that computers suck.