Ansible is used to deploy docker-compose on a system and subsequently start the container.

When ansible runs from the local system, the docker-compose file is deployed using Ansible.

When the code is pushed to bitbucket the file content is:


and the CI deploys this on the system as well.






In order to prevent that the docker-compose.yml need to be changed on two places, a symlink has been created, but that seems to be ignored by bitbucket as the link instead of the content reside in this file.

This Q&A indicates that:

The data referenced by the symlink is not stored in the repository.

and creating a symlink to avoid code duplication in docker-compose.yml seems to cause the problem.

1 Answer 1


Instead of using a symlink that will be stored as is in BitBucket one could use:

- name: Copy docker-compose.yml
    src: ../../../../docker-compose.yml
    dest: /path/to/docker-compose.yml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.