From 60e43ac4497dee75f86c073ee5f5e2fb210d381d Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 12 Dec 2014 13:58:00 +0100 Subject: Fix missing directory creation, and add a variable for that along default value --- roles/local_deploy/defaults/main.yml | 1 + roles/local_deploy/tasks/main.yml | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 roles/local_deploy/defaults/main.yml (limited to 'roles') 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 -- cgit