diff options
| author | Joe Carstairs <me@joeac.net> | 2026-08-26 10:27:32 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-08-26 10:27:32 +0100 |
| commit | 690f218cbdf89327408ea75f2d21fde257a29411 (patch) | |
| tree | c0d695883f761afe8f1b0f0c90bdf73309cc1e5a /roles/git-daemon/tasks | |
| parent | 9ec180130f0085340f3a6f2828b2f49d558a2548 (diff) | |
refactor git into cgit, git-daemon and git-http-backend
Diffstat (limited to 'roles/git-daemon/tasks')
| -rw-r--r-- | roles/git-daemon/tasks/main.yml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/roles/git-daemon/tasks/main.yml b/roles/git-daemon/tasks/main.yml new file mode 100644 index 0000000..5508b1e --- /dev/null +++ b/roles/git-daemon/tasks/main.yml @@ -0,0 +1,35 @@ +- name: Install git daemon + community.general.apk: + name: git-daemon-openrc + +- name: Create read-only git user + ansible.builtin.user: + name: "{{ git_readonly_user }}" + group: "{{ git_readonly_group }}" + +- name: Configure git daemon + register: gitd_conf + ansible.builtin.template: + src: conf.d/git-daemon + dest: /etc/conf.d/git-daemon + +- name: Restart git daemon and configure to start on boot + when: gitd_conf is changed + ansible.builtin.service: + name: git-daemon + enabled: true + state: restarted + +- name: Start git daemon and configure to start on boot + when: not ( gitd_conf is changed ) + ansible.builtin.service: + name: git-daemon + enabled: true + state: started + +- name: Mark git directory safe in system-wide git config + register: gitconfig + community.general.git_config: + name: safe.directory + add_mode: add + value: "{{ git_directory }}/*" |
