diff --git a/README.md b/README.md index d6e9ff7..5874225 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,9 @@ Role Variables ansistrano_git_branch: master # What version of the repository to check out. This can be the full 40-character SHA-1 hash, the literal string HEAD, a branch name, or a tag name ansistrano_git_identity_key_path: "" # If specified this file is copied over and used as the identity key for the git commands, path is relative to the playbook in which it is used + # Variables used in the download deployment strategy + ansistrano_get_url: https://github.com/someproject/somearchive.tar.gz + # Variables used in the S3 deployment strategy ansistrano_s3_bucket: s3bucket ansistrano_s3_object: s3object.tgz diff --git a/defaults/main.yml b/defaults/main.yml index 84a3e29..333d5cf 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -36,6 +36,9 @@ ansistrano_rsync_extra_params: "" ## you should set this parameter to "no". ansistrano_rsync_set_remote_user: yes +## Download strategy +ansistrano_get_url: https://github.com/someproject/somearchive.tar.gz + ## S3 get strategy ansistrano_s3_bucket: s3bucket ansistrano_s3_object: s3object.tgz diff --git a/tasks/update-code/copy_unarchive.yml b/tasks/update-code/copy_unarchive.yml index f646062..d1760b2 100644 --- a/tasks/update-code/copy_unarchive.yml +++ b/tasks/update-code/copy_unarchive.yml @@ -1,7 +1,7 @@ --- - include: copy.yml -- name: ANSISTRANO | copy_unarchive Set archived file +- name: ANSISTRANO | copy_unarchive | Set archived file set_fact: ansistrano_archived_file={{ ansistrano_release_path.stdout }}/{{ ansistrano_deploy_from | basename }} - include: unarchive.yml diff --git a/tasks/update-code/download.yml b/tasks/update-code/download.yml new file mode 100644 index 0000000..455b723 --- /dev/null +++ b/tasks/update-code/download.yml @@ -0,0 +1,6 @@ +--- +- name: ANSISTRANO | download | Create release folder + file: state=directory path={{ ansistrano_release_path.stdout }} + +- name: ANSISTRANO | download | Download artifact + get_url: url={{ ansistrano_get_url }} dest={{ ansistrano_release_path.stdout }} diff --git a/tasks/update-code/download_unarchive.yml b/tasks/update-code/download_unarchive.yml new file mode 100644 index 0000000..d553ab2 --- /dev/null +++ b/tasks/update-code/download_unarchive.yml @@ -0,0 +1,7 @@ +--- +- include: download.yml + +- name: ANSISTRANO | download_unarchive | Set archived file + set_fact: ansistrano_archived_file={{ ansistrano_release_path.stdout }}/{{ ansistrano_get_url | basename }} + +- include: unarchive.yml diff --git a/tasks/update-code/s3_unarchive.yml b/tasks/update-code/s3_unarchive.yml index e1a65d7..26f50c8 100644 --- a/tasks/update-code/s3_unarchive.yml +++ b/tasks/update-code/s3_unarchive.yml @@ -1,7 +1,7 @@ --- - include: s3.yml -- name: ANSISTRANO | s3_unarchive Set archived file +- name: ANSISTRANO | s3_unarchive | Set archived file set_fact: ansistrano_archived_file={{ ansistrano_release_path.stdout }}/{{ ansistrano_s3_object }} -- include: unarchive.yml \ No newline at end of file +- include: unarchive.yml