From 2c562a49bc29d98c29b4f4a17ef8a66cf5d114e9 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sat, 13 Dec 2014 01:03:20 +0100 Subject: Use a template rather than hardcoding the git repositories --- roles/cgit/files/cgitrepos | 6 ------ roles/cgit/tasks/main.yml | 2 +- roles/cgit/templates/cgitrepos | 8 ++++++++ 3 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 roles/cgit/files/cgitrepos create mode 100644 roles/cgit/templates/cgitrepos 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 %} -- cgit