diff --git a/roles/live_symlink/defaults/main.yml b/roles/live_symlink/defaults/main.yml index 8bf22492..daea7ab3 100644 --- a/roles/live_symlink/defaults/main.yml +++ b/roles/live_symlink/defaults/main.yml @@ -1,8 +1,7 @@ --- deploy_user: 'deploy' live_symlink: - # Either update (for successful builds) or revert. - operation: update + revert_on_fail: true # Specify any additional directory symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') diff --git a/roles/live_symlink/tasks/main.yml b/roles/live_symlink/tasks/main.yml index 63225e16..2682e55c 100644 --- a/roles/live_symlink/tasks/main.yml +++ b/roles/live_symlink/tasks/main.yml @@ -4,7 +4,9 @@ - ansible.builtin.set_fact: _live_symlink_build_target: "{{ deploy_base_path }}/{{ project_name }}_{{ build_type }}_build_{{ previous_build_number }}" - when: deploy_operation == 'revert' + when: + - deploy_operation == 'revert' + - live_symlink.revert_on_fail - ansible.builtin.set_fact: _live_symlink_dest_target: "{{ live_symlink_dest }}"