diff --git a/README.md b/README.md index 3c51878..53f1a99 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_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 9375b13..09336f6 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_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 0a5cc22..946fe09 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_exist # 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_basedirs_shared_files_exist