Shared folder already exists

Hi, i have symlinked uploads folder with mounted folder, and when i want to deploy, it gives me this error

TASK [deploy : Ensure shared sources are present] ******************************
failed: [production_hostname] (item={u’path’: u’web/app/uploads’, u’src’: u’uploads’}) => {“failed”: true, “gid”: 0, “group”: “root”, “item”: {“path”: “web/app/uploads”, “src”: “uploads”}, “mode”: “0777”, “msg”: “/srv/www/ already exists as a link”, “owner”: “root”, “path”: “/srv/www/”, “size”: 12, “state”: “link”, “uid”: 0}
to retry, use: --limit @deploy.retry

i could find this code in share.yml

  • name: Ensure shared sources are present
    path: "{{ deploy_helper.shared_path }}/{{ item.src }}"
    state: "{{ item.type | default(‘directory’) }}"
    mode: "{{ item.mode | default(‘0755’) }}"
    with_items: “{{ project_shared_children }}”

but i want it on staging server so deleting is no option. Is there some way how to write there condition DO NOT DO THIS WHEN ENV == PRODUCTION? thank you

1 Like

Just re-define project_shared_children in group_vars/production/main.yml.

Default is here:

This is just Ansible basics which can be learned from their docs.