Skip to content

Commit

Permalink
Merge pull request #208 from skuark/master
Browse files Browse the repository at this point in the history
Makes optional shared paths and basedir shared files creation
  • Loading branch information
ricardclau authored Feb 22, 2017
2 parents 7ae8ed0 + 0460657 commit ff3d20e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions tasks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
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
file:
state: directory
path: "{{ ansistrano_deploy_to }}/shared/{{ item | dirname }}"
with_items: "{{ ansistrano_shared_files }}"
when: ansistrano_ensure_basedirs_shared_files_exist

0 comments on commit ff3d20e

Please sign in to comment.