summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Scherer <misc@zarb.org>2014-12-12 13:58:00 +0100
committerMichael Scherer <misc@zarb.org>2014-12-12 13:58:00 +0100
commit60e43ac4497dee75f86c073ee5f5e2fb210d381d (patch)
tree8b26c2899c21367cf3a4c663967675763066d4a0
parent3f832766198608d2f154d31a81beb526d1776c96 (diff)
Fix missing directory creation, and add a variable for that along default value
-rw-r--r--roles/local_deploy/defaults/main.yml1
-rw-r--r--roles/local_deploy/tasks/main.yml11
2 files changed, 10 insertions, 2 deletions
diff --git a/roles/local_deploy/defaults/main.yml b/roles/local_deploy/defaults/main.yml
new file mode 100644
index 0000000..cb1c653
--- /dev/null
+++ b/roles/local_deploy/defaults/main.yml
@@ -0,0 +1 @@
+git_repositories_dir: /srv/git_repos/
diff --git a/roles/local_deploy/tasks/main.yml b/roles/local_deploy/tasks/main.yml
index b6f466e..e7ee0a4 100644
--- a/roles/local_deploy/tasks/main.yml
+++ b/roles/local_deploy/tasks/main.yml
@@ -4,12 +4,19 @@
- ansible
- git
-- shell: creates=/srv/git_repos/{{ item }}/config chdir=/srv/git_repos/{{ item }} git init --bare -q --shared=group
+- file: path={{ git_repositories_dir }} state=directory
+
+- file: path={{ git_repositories_dir }}/{{ item }} state=directory
+ with_items:
+ - public
+ - private
+
+- shell: creates={{ git_repositories_dir }}/{{ item }}/config chdir={{ git_repositories_dir }}/{{ item }} git init --bare -q --shared=group
with_items:
- public
- private
-- copy: dest=/srv/git_repos/{{ item }}/hooks/post-receive src=post-receive.{{ item }}.sh mode=0755
+- copy: dest={{ git_repositories_dir }}/{{ item }}/hooks/post-receive src=post-receive.{{ item }}.sh mode=0755
with_items:
- public
- private