diff --git a/deployment/ansible/playbooks/install-composer-dependencies.yml b/deployment/ansible/playbooks/install-composer-dependencies.yml index ac06f151..57ccf0e1 100644 --- a/deployment/ansible/playbooks/install-composer-dependencies.yml +++ b/deployment/ansible/playbooks/install-composer-dependencies.yml @@ -47,13 +47,21 @@ debug: msg: "Container status: {{ container_status.stdout }}" - - name: Start container if not running - shell: | - cd {{ application_code_dest }} - docker compose -f docker-compose.base.yml -f docker-compose.{{ application_compose_suffix }} up -d {{ php_service_name }} + - name: Fail if container is not running + fail: + msg: | + Container '{{ php_service_name }}' is not running! + + The container must be started before installing composer dependencies. + This is typically done by the 'deploy-image.yml' playbook which should run before this. + + To start the container manually: + cd {{ application_code_dest }} + docker compose -f docker-compose.base.yml -f docker-compose.{{ application_compose_suffix }} up -d {{ php_service_name }} + + Note: The container requires environment variables (DB_USERNAME, DB_PASSWORD, etc.) + which should be set in a .env file or via docker-compose environment configuration. when: container_status.rc != 0 or '"State":"running"' not in container_status.stdout - register: container_start - changed_when: container_start.rc == 0 - name: Install composer dependencies in PHP container shell: |