diff --git a/Deployment/playbooks/roles/frontend/tasks/main.yaml b/Deployment/playbooks/roles/frontend/tasks/main.yaml index 9aca3b15acc17a3ee0f9b1948d8accb76dcbf06f..dbada99cdc3c7ddbce9785227058e43d1667296e 100644 --- a/Deployment/playbooks/roles/frontend/tasks/main.yaml +++ b/Deployment/playbooks/roles/frontend/tasks/main.yaml @@ -6,36 +6,17 @@ environment: "{{ proxy_env }}" become: true -# Create Docker config directory -- name: Make sure that Docker config directory exists - become: yes - file: - path: '~/.docker' - state: 'directory' - -# Set Docker proxy for University of Melbourne Research Cloud -- name: Ensure Docker client proxy settings are present on the server - become: yes - copy: - content: "{{ docker_proxy_settings }}" - dest: ~/.docker/config.json - -# Build Docker image for web frontend and web backend -- name: Configure compose - become: yes - template: - src: "{{ playbook_dir }}/../web/docker-compose.yaml.j2" - dest: "~/cluster-and-cloud-computing-assignment-2/web/docker-compose.yaml" - owner: "{{ ansible_user }}" - group: "{{ ansible_user }}" -# Run Docker compose to activate web frontend and web backend +# Start nginx and webapp - name: Run docker compose + tags: 'webapp' become: yes docker_compose: - project_src: "~/cluster-and-cloud-computing-assignment-2/web/" - pull: false + remove_images: local + project_src: "~/cluster-and-cloud-computing-assignment-2/frontend" build: yes + nocache: yes + pull: yes state: present - remove_orphans: no + remove_orphans: yes recreate: always \ No newline at end of file diff --git a/Deployment/playbooks/setup.sh b/Deployment/playbooks/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..7607b32183e3c985c57a58271cac84df2091eab0 --- /dev/null +++ b/Deployment/playbooks/setup.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +. ./openrc.sh; ansible-playbook -vv -i hosts--ask-become-pass setup.yaml --check | tee output.txt