Created
July 27, 2018 10:17
-
-
Save mlvnds/97f941c8dbfebc4c937502c8bdfba837 to your computer and use it in GitHub Desktop.
Template ansistrano pour le playbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
any_errors_fatal: true | |
vars_files: | |
- vars.yml | |
tasks: | |
- block: | |
- include_role: | |
name: "cbrunnkvist.ansistrano-symfony-deploy" | |
rescue: | |
- name: ROLLBACK | Fetch stat of current symlink | |
stat: | |
path: "{{ ansistrano_deploy_to }}/{{ ansistrano_current_dir }}" | |
register: stat_current_link | |
- name: ROLLBACK | Remove not fully deployed release | |
file: | |
state: absent | |
path: "{{ ansistrano_release_path.stdout }}" | |
when: > | |
(stat_current_link.stat.islnk is not defined) | |
or | |
(ansistrano_release_path.stdout != stat_current_link.stat.lnk_source) | |
- name: ROLLBACK | Force Ansible to return an exit code error | |
fail: | |
msg: "Something gone wrong during deployment, refer to logs." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment