From 6ed7b4f4d3242629e68bdc90548517c6639ad446 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 3 Mar 2017 15:21:43 +0100 Subject: [PATCH] Crony : Structure du projet --- apps/crony/deploy.yml | 2 +- apps/crony/tasks/before-setup.yml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 apps/crony/tasks/before-setup.yml diff --git a/apps/crony/deploy.yml b/apps/crony/deploy.yml index 99bb891..cb33b52 100644 --- a/apps/crony/deploy.yml +++ b/apps/crony/deploy.yml @@ -25,7 +25,7 @@ #ansistrano_git_branch: master #ansistrano_git_identity_key_path: "" # Hooks: custom tasks if you need them - #ansistrano_before_setup_tasks_file: "{{playbook_dir}}//my-before-setup-tasks.yml" + ansistrano_before_setup_tasks_file: "{{playbook_dir}}/tasks/before-setup.yml" #ansistrano_after_setup_tasks_file: "{{playbook_dir}}/tasks/after-setup.yml" ansistrano_before_update_code_tasks_file: "{{playbook_dir}}/tasks/before-updatecode.yml" #ansistrano_after_update_code_tasks_file: "{{playbook_dir}}/tasks/after-updatecode.yml" diff --git a/apps/crony/tasks/before-setup.yml b/apps/crony/tasks/before-setup.yml new file mode 100644 index 0000000..c5b3319 --- /dev/null +++ b/apps/crony/tasks/before-setup.yml @@ -0,0 +1,19 @@ +--- +- name: CRONY | Project directory + file: path="{{ansistrano_deploy_to}}" state=directory + +- name: CRONY | Project releases directory + file: path="{{ansistrano_deploy_to}}/releases" state=directory + +- name: CRONY | Project shared directories + file: path="{{ansistrano_deploy_to}}/shared/{{item.src}}" state=directory recurse=yes + with_items: + - { src: 'log' } + +- stat: + path: "{{ansistrano_deploy_to}}/shared/sources" + register: st +- fail: + msg: "Symlink manquant {{ansistrano_deploy_to}}/shared/sources" + when: st.stat.islnk is not defined or st.stat.islnk == False + \ No newline at end of file