aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2025-10-11 10:52:14 +0200
committeralex <alex@pdp7.net>2025-10-11 10:52:14 +0200
commitceb1150b8741c3008c678d083910f61c10e6f743 (patch)
treecadbec6243c8fad19234a7c7b976a82482733adb
parent935f18e5ecdbc7d95f9ce46d88194dd0ae50e2cb (diff)
Add basic Git hosting
-rw-r--r--infrastructure/roles/git/README.md19
-rw-r--r--infrastructure/roles/git/tasks/main.yaml3
-rw-r--r--infrastructure/site.yaml2
3 files changed, 23 insertions, 1 deletions
diff --git a/infrastructure/roles/git/README.md b/infrastructure/roles/git/README.md
new file mode 100644
index 0000000..ca32c99
--- /dev/null
+++ b/infrastructure/roles/git/README.md
@@ -0,0 +1,19 @@
+# git
+
+## Create a repository
+
+On the server:
+
+```
+mkdir -p ~/git
+cd ~/git
+git init --bare $REPO
+```
+
+## Push an existing repository
+
+```
+git remote add $REMOTE_NAME $SERVER:git/$REPO
+git push $REMOTE_NAME main
+```
+
diff --git a/infrastructure/roles/git/tasks/main.yaml b/infrastructure/roles/git/tasks/main.yaml
new file mode 100644
index 0000000..79fad63
--- /dev/null
+++ b/infrastructure/roles/git/tasks/main.yaml
@@ -0,0 +1,3 @@
+- name: install git
+ ansible.builtin.package:
+ name: git
diff --git a/infrastructure/site.yaml b/infrastructure/site.yaml
index 9febc36..96e7048 100644
--- a/infrastructure/site.yaml
+++ b/infrastructure/site.yaml
@@ -3,4 +3,4 @@
roles:
- users
- motd
-
+ - git