- block:
- name: Update database schema
shell: cd '{{ ansible_web_deployment_webroot }}/releases/{{ ansible_web_deployment_release }}' && php7.1 console.php orm:schema-tool:update --force
when: inventory_hostname in groups['schema']
- name: Deployment
debug:
msg: 'Deploying'
rescue:
- name: Rollback
debug:
msg: 'Rollback'
any_errors_fatal: true
PLAY [test] ********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [x1.example.com]
ok: [x2.example.com]
ok: [x3.example.com]
ok: [x4.example.com]
TASK [ansible_web_deployment : Update database schema] *************************
skipping: [x2.example.com]
skipping: [x3.example.com]
skipping: [x4.example.com]
fatal: [x1.example.com]: FAILED! => {"changed": true, "cmd": "cd '/var/www/x.example.com/releases/20171113081452' && php7.1 console.php orm:schema-tool:update --force", "delta": "0:00:00.007578", "end": "2017-11-13 08:15:05.709148", "failed": true, "msg": "non-zero return code", "rc": 2, "start": "2017-11-13 08:15:05.701570", "stderr": "/bin/sh: 1: cd: can't cd to /var/www/x.example.com/releases/20171113081452", "stderr_lines": ["/bin/sh: 1: cd: can't cd to /var/www/x.example.com/releases/20171113081452"], "stdout": "", "stdout_lines": []}
TASK [ansible_web_deployment : Rollback] *****************************
ok: [x1.example.com] => {
"msg": "Rollback"
}
ok: [x2.example.com] => {
"msg": "Rollback"
}
ok: [x2.example.com] => {
"msg": "Rollback"
}
ok: [x4.example.com] => {
"msg": "Rollback"
}
PLAY RECAP *********************************************************************
127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0
x1.example.com : ok=2 changed=1 unreachable=0 failed=1
x2.example.com : ok=2 changed=1 unreachable=0 failed=1
x3.example.com : ok=2 changed=1 unreachable=0 failed=1
x4.example.com : ok=2 changed=1 unreachable=0 failed=1
PLAY [test] ********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [x1.example.com]
ok: [x2.example.com]
ok: [x3.example.com]
ok: [x4.example.com]
TASK [ansible_web_deployment : Update database schema] *************************
skipping: [x2.example.com]
skipping: [x3.example.com]
skipping: [x4.example.com]
fatal: [x1.example.com]: FAILED! => {"changed": true, "cmd": "cd '/var/www/x.example.com/releases/20171113081452' && php7.1 console.php orm:schema-tool:update --force", "delta": "0:00:00.007578", "end": "2017-11-13 08:15:05.709148", "failed": true, "msg": "non-zero return code", "rc": 2, "start": "2017-11-13 08:15:05.701570", "stderr": "/bin/sh: 1: cd: can't cd to /var/www/x.example.com/releases/20171113081452", "stderr_lines": ["/bin/sh: 1: cd: can't cd to /var/www/x.example.com/releases/20171113081452"], "stdout": "", "stdout_lines": []}
TASK [ansible_web_deployment : Restart services] *****************************
ok: [x2.example.com] => {
"msg": "Deploying"
}
ok: [x2.example.com] => {
"msg": "Deploying"
}
ok: [x4.example.com] => {
"msg": "Deploying"
}
TASK [ansible_web_deployment : Rollback] *****************************
ok: [x1.example.com] => {
"msg": "Rollback"
})
PLAY RECAP *********************************************************************
127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0
x1.example.com : ok=2 changed=1 unreachable=0 failed=1
x2.example.com : ok=2 changed=1 unreachable=0 failed=0
x3.example.com : ok=2 changed=1 unreachable=0 failed=0
x4.example.com : ok=2 changed=1 unreachable=0 failed=0
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/661b16c0-7a35-45ed-9b8d-84eaaf836140%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.