Browse code

Create gitolite user

Robert Cranston authored on 22/01/2021 13:16:41
Showing 3 changed files

... ...
@@ -2,13 +2,15 @@
2 2
 
3 3
 An [Ansible][] [role][] for deploying [gitolite][] on [Debian][] >=9.
4 4
 
5
-Installs [gitolite][].
5
+Installs [gitolite][] and creates a [dedicated user][] to run it (defaults to
6
+`git`).
6 7
 
7 8
 [`ansible-role-gitolite`]: https://git.rcrnstn.net/rcrnstn/ansible-role-gitolite
8 9
 [Ansible]: https://docs.ansible.com/ansible
9 10
 [role]: https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html
10 11
 [gitolite]: https://gitolite.com
11 12
 [Debian]: https://www.debian.org
13
+[dedicated user]: https://gitolite.com/gitolite/concepts#the-hosting-user
12 14
 
13 15
 ## Try out
14 16
 
15 17
new file mode 100644
... ...
@@ -0,0 +1,4 @@
1
+---
2
+
3
+gitolite_user_name: "git"
4
+gitolite_user_home: "/home/{{ gitolite_user_name }}"
... ...
@@ -7,3 +7,9 @@
7 7
       apt:
8 8
         name: 'gitolite3'
9 9
         state: 'present'
10
+
11
+    - name: "Create gitolite user '{{ gitolite_user_name }}'"
12
+      user:
13
+        name: "{{ gitolite_user_name }}"
14
+        home: "{{ gitolite_user_home }}"
15
+        shell: "/bin/bash"