# If artisan exists, then set the application into maint. mode - name: checking for artisan's existance in current symlink stat: path={{ hostvars[item].www_dir }}/current/artisan register: artisan_current delegate_to: "{{ item }}" with_items: groups.queue_managers
# This makes sure we don't keep serving an old release from the pool if the deployment fails # NGinx doesn't use the symlink so might keep serving from an old path - name: set maint.mode in current version command: php {{ hostvars[item].www_dir }}/current/artisan down when: artisan_current.stat.exists is defined and artisan_current.stat.exists delegate_to: "{{ item }}" with_items: groups.queue_managers
- name: checking for artisan's existance in current symlink
stat: path={{ hostvars[item].www_dir }}/curthe rent/artisan
register: hostvars[item].artisan_current
delegate_to: "{{ item }}"
with_items: groups.queue_managers
- name: set maint.mode in current version
command: php {{ hostvars[item].www_dir }}/current/artisan down
when: hostvars[item].artisan_current.stat.exists is defined and hostvars[item].artisan_current.stat.exists
delegate_to: "{{ item }}"
with_items: groups.queue_managers build 07-Mar-2016 11:57:06 TASK [checking for artisan's existance in current symlink] *********************
build 07-Mar-2016 11:57:07 ok: [redacted -> redacted ] => (item=redacted) => {"changed": false, "item": "redacted", "stat": {"atime": 1457350038.6739905, "checksum": "659b7d3cb04a4d3b4fd58cb147c2c9b33e0ea831", "ctime": 1457349988.065974, "dev": 64769, "exists": true, ...lots more output here...}}
build 07-Mar-2016 11:57:07 build 07-Mar-2016 11:57:07 TASK [set maint.mode in current version] ***************************************
build 07-Mar-2016 11:57:07 skipping: [redacted] => (item=redacted) => {"changed": false, "item": "redacted", "skip_reason": "Conditional check failed", "skipped": true}
Can anyone help me work out where the register actually puts the results of the stat and therefore how I can present the results to the when: statement.
Thanks,
Steve