I have a task in my Ansible Bitbucket role that simply starts two docker-compose.yml files. When executing this from Ansible it fails but when I execute the same command over ssh on the actual server it works just fine. I am currently executing my playbook as root, and when i manually execute docker-compose -f <path> up -d I am also root.
- name: Create and start services
- name: docker compose up
docker_compose:
project_src: "{{ bitbucket__install_path }}"
files: "{{ bitbucket__compose_files }}"
state: present
register: output
Ansible command:
ansible-playbook -i inventory/staging playbooks/bitbucket-server.yml -vvvv -kKu root --ask-vault-pass --start-at-task "Setup bitbucket"
Ansible sucessfully starts 2 out of 3 containers but the third crashes with the error:
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/my_entrypoint.sh": permission denied: unknown Error: failed to start containers: nginx_bitbucket_1
My question is, why do Ansible receive an error when executing the above task while executing "docker-compose -f <path> up -d over ssh works just fine? What is the difference between the two cases?