summaryrefslogtreecommitdiff
path: root/roles/git-deps
diff options
context:
space:
mode:
Diffstat (limited to 'roles/git-deps')
-rw-r--r--roles/git-deps/files/git_logrotate2
-rw-r--r--roles/git-deps/handlers/main.yml3
-rw-r--r--roles/git-deps/tasks/daemon.yml21
-rw-r--r--roles/git-deps/tasks/pkgs.yml3
-rw-r--r--roles/git-deps/templates/git-daemon.service21
5 files changed, 48 insertions, 2 deletions
diff --git a/roles/git-deps/files/git_logrotate b/roles/git-deps/files/git_logrotate
index b1ff9a83..a310920a 100644
--- a/roles/git-deps/files/git_logrotate
+++ b/roles/git-deps/files/git_logrotate
@@ -1,6 +1,6 @@
# MANAGED BY ANSIBLE
# We need daily log timestamps for the git daemon.30 days should be ample for
-# rotation since weblogs should store what it needs long term
+# rotation.
/var/log/git.log {
daily
missingok
diff --git a/roles/git-deps/handlers/main.yml b/roles/git-deps/handlers/main.yml
index 20fff236..fe723acd 100644
--- a/roles/git-deps/handlers/main.yml
+++ b/roles/git-deps/handlers/main.yml
@@ -1,4 +1,7 @@
---
+- name: reload-systemd
+ systemd: daemon_reload=yes
+
- name: restart-git
service: name=git-daemon state=restarted
diff --git a/roles/git-deps/tasks/daemon.yml b/roles/git-deps/tasks/daemon.yml
index 9a5ba610..c1ef0311 100644
--- a/roles/git-deps/tasks/daemon.yml
+++ b/roles/git-deps/tasks/daemon.yml
@@ -16,4 +16,25 @@
mode=0644
owner=root
group=root
+ when: ansible_distribution_release == "trusty"
notify: restart-git
+
+- name: Install git-daemon systemd configuration
+ template: src=git-daemon.service
+ dest=/etc/systemd/system/git-daemon.service
+ mode=0644
+ owner=root
+ group=root
+ when: ansible_distribution_release != "trusty"
+ notify:
+ - reload-systemd
+ - restart-git
+
+- name: Enable git-daemon systemd configuration
+ systemd:
+ name: git-daemon
+ enabled: yes
+ when: ansible_distribution_release != "trusty"
+ notify:
+ - reload-systemd
+ - restart-git
diff --git a/roles/git-deps/tasks/pkgs.yml b/roles/git-deps/tasks/pkgs.yml
index e7e029c1..b9dd7e78 100644
--- a/roles/git-deps/tasks/pkgs.yml
+++ b/roles/git-deps/tasks/pkgs.yml
@@ -3,6 +3,7 @@
apt_repository:
repo: ppa:git-core/ppa
update_cache: yes
+ when: ansible_distribution == 'Ubuntu'
- name: Install common OS dependencies
apt:
@@ -16,7 +17,7 @@
- libclass-std-storable-perl
- libcache-cache-perl
- ntp
- - python-requests
+ - python3-requests
- rsyslog
- name: Enable Apache modules
diff --git a/roles/git-deps/templates/git-daemon.service b/roles/git-deps/templates/git-daemon.service
new file mode 100644
index 00000000..222ef537
--- /dev/null
+++ b/roles/git-deps/templates/git-daemon.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=Start Linaro Git Daemon
+
+[Service]
+ExecStart=/usr/bin/git daemon --max-connections=64 --verbose --reuseaddr --timeout=120 --base-path={{ repo_root }} {{ repo_root }}
+
+Restart=always
+RestartSec=500ms
+
+StandardOutput=syslog
+StandardError=syslog
+SyslogIdentifier=git-daemon
+
+DynamicUser=yes
+# this implies ProtectSystem=strict and ProtectHome=read-only
+
+NoNewPrivileges=yes
+MemoryHigh=4G
+
+[Install]
+WantedBy=multi-user.target