summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorMichael Scherer <misc@zarb.org>2014-12-13 01:03:20 +0100
committerMichael Scherer <misc@zarb.org>2014-12-13 01:03:20 +0100
commit2c562a49bc29d98c29b4f4a17ef8a66cf5d114e9 (patch)
tree08cf6ee669cab52ace3ede524bc91dae45e83031 /roles
parentc5fb1a829d6cb80d2af4620308f91e68ce282476 (diff)
Use a template rather than hardcoding the git repositories
Diffstat (limited to 'roles')
-rw-r--r--roles/cgit/files/cgitrepos6
-rw-r--r--roles/cgit/tasks/main.yml2
-rw-r--r--roles/cgit/templates/cgitrepos8
3 files changed, 9 insertions, 7 deletions
diff --git a/roles/cgit/files/cgitrepos b/roles/cgit/files/cgitrepos
deleted file mode 100644
index 72089e3..0000000
--- a/roles/cgit/files/cgitrepos
+++ /dev/null
@@ -1,6 +0,0 @@
-repo.url=ansible
-repo.path=/srv/git_repos/public
-repo.desc=Ansible configuration for the server
-repo.owner=mscherer@redhat.com
-#repo.readme=info/web/about.html
-
diff --git a/roles/cgit/tasks/main.yml b/roles/cgit/tasks/main.yml
index 065f237..f6ac30a 100644
--- a/roles/cgit/tasks/main.yml
+++ b/roles/cgit/tasks/main.yml
@@ -5,7 +5,7 @@
- lineinfile: dest=/etc/cgitrc line=include=/etc/cgitrepos
-- copy: mode=0644 src=cgitrepos dest=/etc/cgitrepos
+- template: mode=0644 src=cgitrepos dest=/etc/cgitrepos
- copy: mode=0644 src=cgit.httpd.conf dest=/etc/httpd/conf.d/cgit.conf
notify: restart httpd
diff --git a/roles/cgit/templates/cgitrepos b/roles/cgit/templates/cgitrepos
new file mode 100644
index 0000000..e5b2cd6
--- /dev/null
+++ b/roles/cgit/templates/cgitrepos
@@ -0,0 +1,8 @@
+{% if git_repositories is defined %}
+{% for repo in git_repositories %}
+repo.url={{ repo.name }}
+repo.path={{ repo.path }}
+repo.desc={{ repo.desc }}
+repo.owner={{ repo.owner }}
+{% endfor %}
+{% endif %}