aboutsummaryrefslogtreecommitdiffstats
path: root/roles/git/tasks/main.yml
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-11 13:54:22 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-11 13:54:22 +0000
commite60e99796111ee6d43080b4e48971c08886c0570 (patch)
tree481e8fd119b3afdd0e2a2730ce1f41d623577e9e /roles/git/tasks/main.yml
parent48208c520bb15d16b0eab623b97fa5e86c6f665c (diff)
downloadrules-e60e99796111ee6d43080b4e48971c08886c0570.tar.gz
roles: Add git and cgit roles
Diffstat (limited to 'roles/git/tasks/main.yml')
-rw-r--r--roles/git/tasks/main.yml45
1 files changed, 45 insertions, 0 deletions
diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml
new file mode 100644
index 0000000..4d2b74e
--- /dev/null
+++ b/roles/git/tasks/main.yml
@@ -0,0 +1,45 @@
+- name: install git package
+ package:
+ name: git
+ state: present
+
+- name: create git group
+ group:
+ name: "{{ git_group }}"
+ state: present
+
+- name: create git user
+ user:
+ name: "{{ git_user }}"
+ group: "{{ git_group }}"
+ shell: "{{ git_shell }}"
+ home: "{{ git_dir }}"
+ create_home: false
+
+- name: create git directories
+ file:
+ path: "{{ item }}"
+ owner: "{{ git_user }}"
+ group: "{{ git_group }}"
+ state: directory
+ mode: 0755
+ loop:
+ - "{{ git_dir }}"
+ - "{{ git_dir }}/git-shell-commands"
+
+- name: generate git-shell no-login prompt
+ template:
+ src: no-interactive-login.j2
+ dest: "{{ git_dir }}/git-shell-commands/no-interactive-login"
+ owner: "{{ git_user }}"
+ group: "{{ git_group }}"
+ mode: "0744"
+ when: not git_allow_ssh_login
+
+- name: generate gitconfig
+ template:
+ src: gitconfig.j2
+ dest: "{{ git_dir }}/.gitconfig"
+ owner: "{{ git_user }}"
+ group: "{{ git_group }}"
+ mode: 0644
remember that computers suck.