--- ### tags: ### update_deployment - name: "Send mattermost message" uri: url: "{{ mattermost_hook_smardigo }}" method: POST body: "{{ lookup('template','mattermost-deploy-start.json.j2') }}" body_format: json headers: Content-Type: "application/json" delegate_to: 127.0.0.1 become: false when: - send_status_messages - name: "Setup DNS configuration for {{ connect_id }}" include_role: name: _digitalocean tasks_from: domain vars: record_data: "{{ stage_server_ip }}" record_name: "{{ connect_id }}" - name: "Check if {{ connect_id }}/docker-compose.yml exists" stat: path: '{{ service_base_path }}/{{ connect_id }}/docker-compose.yml' register: check_docker_compose_file tags: - update_deployment - name: "Stop {{ connect_id }}" shell: docker-compose down args: chdir: '{{ service_base_path }}/{{ connect_id }}' when: check_docker_compose_file.stat.exists ignore_errors: yes tags: - update_deployment - name: "Deploy docker templates for {{ connect_id }}" include_role: name: _deploy tasks_from: templates vars: current_config: "_docker" current_base_path: "{{ service_base_path }}" current_destination: "{{ connect_id }}" current_owner: "{{ docker_owner }}" current_group: "{{ docker_group }}" current_docker: "{{ connect_docker }}" - name: "Deploy service templates for {{ connect_id }}" include_role: name: _deploy tasks_from: templates vars: current_config: "connect" current_base_path: "{{ service_base_path }}" current_destination: "{{ connect_id }}" current_owner: "{{ docker_owner }}" current_group: "{{ docker_group }}" - name: "Deploy certificate templates for connect" include_role: name: _deploy tasks_from: templates vars: current_config: "elastic-certs/certs" current_base_path: "{{ service_base_path }}" current_destination: "{{ connect_id }}/certs" current_owner: "{{ docker_owner }}" current_group: "{{ docker_group }}" - name: "Update {{ connect_id }}" shell: docker-compose pull args: chdir: '{{ service_base_path }}/{{ connect_id }}' tags: - update_deployment - name: "Start {{ connect_id }}" shell: docker-compose up -d args: chdir: '{{ service_base_path }}/{{ connect_id }}' tags: - update_deployment - name: "Send mattermost messsge" uri: url: "{{ mattermost_hook_smardigo }}" method: POST body: "{{ lookup('template','mattermost-deploy-end.json.j2') }}" body_format: json headers: Content-Type: "application/json" delegate_to: 127.0.0.1 become: false when: - send_status_messages