aboutsummaryrefslogtreecommitdiffstats
path: root/roles/gitdaemon
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2021-01-18 08:54:25 +0100
committerbinary <me@rgoncalves.se>2021-01-18 08:54:25 +0100
commit0378077bac137f4055f5d025895f432a106986bd (patch)
tree549fd756c77d7c45370f2a24470a03d2f4a60f4b /roles/gitdaemon
parentf8124a3dac2a52053fab01e21f229e7a042365e9 (diff)
downloadinfrastructure-0378077bac137f4055f5d025895f432a106986bd.tar.gz
Rewrite gitdaemon setup in separate role
Diffstat (limited to 'roles/gitdaemon')
-rw-r--r--roles/gitdaemon/meta/main.yml8
-rw-r--r--roles/gitdaemon/tasks/main.yml18
-rw-r--r--roles/gitdaemon/vars/main.yml7
3 files changed, 33 insertions, 0 deletions
diff --git a/roles/gitdaemon/meta/main.yml b/roles/gitdaemon/meta/main.yml
new file mode 100644
index 0000000..d9b7088
--- /dev/null
+++ b/roles/gitdaemon/meta/main.yml
@@ -0,0 +1,8 @@
+
+# gitdaemon ~~ roles/gitdaemon/meta/main.yml
+# Meta parameters
+
+---
+
+dependencies:
+ - { role: git, tags: "dependency" }
diff --git a/roles/gitdaemon/tasks/main.yml b/roles/gitdaemon/tasks/main.yml
new file mode 100644
index 0000000..f155c1d
--- /dev/null
+++ b/roles/gitdaemon/tasks/main.yml
@@ -0,0 +1,18 @@
+
+# git ~~ roles/git/tasks/main.yml
+# Init git user and settings
+
+---
+
+- name: enable gitdaemon
+ lineinfile:
+ path: /etc/rc.conf.local
+ regexp: "^gitdaemon_flags="
+ line: "gitdaemon_flags=--reuseaddr --base-path={{ gitdaemon_git_dir }}"
+ when: ansible_distribution == "OpenBSD"
+
+- name: start and enable git-daemon service
+ service:
+ name: gitdaemon
+ state: restarted
+ enabled: true
diff --git a/roles/gitdaemon/vars/main.yml b/roles/gitdaemon/vars/main.yml
new file mode 100644
index 0000000..6632085
--- /dev/null
+++ b/roles/gitdaemon/vars/main.yml
@@ -0,0 +1,7 @@
+
+# gitdaemon ~~ roles/gitdaemon/tasks/vars.yml
+# default vars for gitdaemon role
+
+---
+
+gitdaemon_git_dir: "/data/git"
remember that computers suck.