From fb6f4cdd9a0ff883c24e4b950d95b7ab4a2ba7a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Manuel=20Garci=CC=81a=20Mun=CC=83oz?= Date: Tue, 21 Feb 2017 19:42:26 +0100 Subject: [PATCH 1/3] Makes optional shared paths and basedir shared files creation --- defaults/main.yml | 4 ++++ tasks/setup.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 9375b13..20391bb 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -26,6 +26,10 @@ ansistrano_shared_paths: [] # Shared files to symlink to release dir ansistrano_shared_files: [] +# Shared paths and basedir shared files creation +ansistrano_ensure_shared_paths_exists: yes +ansistrano_ensure_basedir_shared_files_exists: yes + # Number of releases to keep in your hosts, if 0, unlimited releases will be kept ansistrano_keep_releases: 0 diff --git a/tasks/setup.yml b/tasks/setup.yml index 0a5cc22..e94d1fe 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -21,6 +21,7 @@ state: directory path: "{{ ansistrano_deploy_to }}/shared/{{ item }}" with_items: "{{ ansistrano_shared_paths }}" + when: ansistrano_ensure_shared_paths_exists # Ensure basedir shared files exists - name: ANSISTRANO | Ensure basedir shared files exists @@ -28,3 +29,4 @@ state: directory path: "{{ ansistrano_deploy_to }}/shared/{{ item | dirname }}" with_items: "{{ ansistrano_shared_files }}" + when: ansistrano_ensure_basedir_shared_files_exists From 61809f4e05e0ef6e16a4e02f668f239108eca145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Manuel=20Garci=CC=81a=20Mun=CC=83oz?= Date: Wed, 22 Feb 2017 00:10:56 +0100 Subject: [PATCH 2/3] Updated README. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 3c51878..c34d20b 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,12 @@ Role Variables ansistrano_shared_paths: [] ansistrano_shared_files: [] + + # Shared paths and basedir shared files creation. + # By default the shared paths directories and base directories for shared files are created automatically if not exists. But in some scenarios those paths could be symlinks to another directories in the filesystem, and the deployment process would fails. With these variables you can disable the involved tasks. If you have two or three shared paths, and don't need creation only for some of them, you always could disable the automatic creation and add a custom task in a hook. + ansistrano_ensure_shared_paths_exists: yes + ansistrano_ensure_basedir_shared_files_exists: yes + ansistrano_deploy_via: "rsync" # Method used to deliver the code to the server. Options are copy, rsync, git, svn, s3 or download. Copy, download and s3 have an optional step to unarchive the downloaded file which can be used by adding _unarchive. You can check all the options inside tasks/update-code folder! ansistrano_allow_anonymous_stats: yes From 0460657f9fe4a30b78a18d6f5bccc71a26b8b79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Manuel=20Garci=CC=81a=20Mun=CC=83oz?= Date: Wed, 22 Feb 2017 10:45:01 +0100 Subject: [PATCH 3/3] Revised variable naming. --- README.md | 4 ++-- defaults/main.yml | 4 ++-- tasks/setup.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c34d20b..53f1a99 100644 --- a/README.md +++ b/README.md @@ -147,8 +147,8 @@ Role Variables # Shared paths and basedir shared files creation. # By default the shared paths directories and base directories for shared files are created automatically if not exists. But in some scenarios those paths could be symlinks to another directories in the filesystem, and the deployment process would fails. With these variables you can disable the involved tasks. If you have two or three shared paths, and don't need creation only for some of them, you always could disable the automatic creation and add a custom task in a hook. - ansistrano_ensure_shared_paths_exists: yes - ansistrano_ensure_basedir_shared_files_exists: yes + ansistrano_ensure_shared_paths_exist: yes + ansistrano_ensure_basedirs_shared_files_exist: yes ansistrano_deploy_via: "rsync" # Method used to deliver the code to the server. Options are copy, rsync, git, svn, s3 or download. Copy, download and s3 have an optional step to unarchive the downloaded file which can be used by adding _unarchive. You can check all the options inside tasks/update-code folder! ansistrano_allow_anonymous_stats: yes diff --git a/defaults/main.yml b/defaults/main.yml index 20391bb..09336f6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -27,8 +27,8 @@ ansistrano_shared_paths: [] ansistrano_shared_files: [] # Shared paths and basedir shared files creation -ansistrano_ensure_shared_paths_exists: yes -ansistrano_ensure_basedir_shared_files_exists: yes +ansistrano_ensure_shared_paths_exist: yes +ansistrano_ensure_basedirs_shared_files_exist: yes # Number of releases to keep in your hosts, if 0, unlimited releases will be kept ansistrano_keep_releases: 0 diff --git a/tasks/setup.yml b/tasks/setup.yml index e94d1fe..946fe09 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -21,7 +21,7 @@ state: directory path: "{{ ansistrano_deploy_to }}/shared/{{ item }}" with_items: "{{ ansistrano_shared_paths }}" - when: ansistrano_ensure_shared_paths_exists + when: ansistrano_ensure_shared_paths_exist # Ensure basedir shared files exists - name: ANSISTRANO | Ensure basedir shared files exists @@ -29,4 +29,4 @@ state: directory path: "{{ ansistrano_deploy_to }}/shared/{{ item | dirname }}" with_items: "{{ ansistrano_shared_files }}" - when: ansistrano_ensure_basedir_shared_files_exists + when: ansistrano_ensure_basedirs_shared_files_exist