- name: create sites directory become: true file: path: '/srv/docker' state: directory owner: root group: root mode: 0755 - name: create sentry dir become: true file: path: '{{ app_dir }}' state: directory owner: '{{ app_user }}' group: '{{ app_user }}' mode: 0755 - name: clone project git: repo: '{{ app_repository }}' dest: '{{ app_dir }}' version: '{{ app_branch }}' update: true - name: copy over sentry configurations template: src: '{{ item.src }}' dest: '{{ item.dest }}' owner: '{{ app_user }}' group: '{{ app_user }}' mode: '0644' loop: - { src: 'templates/sentry.conf.j2', dest: '{{ app_dir }}/sentry/sentry.conf.py' } - { src: 'templates/sentry.config.j2', dest: '{{ app_dir }}/sentry/config.yml' } - name: stop running containers docker_compose: project_src: '{{ app_dir }}' env_file: '{{ app_dir }}/.env' state: absent # Note: run `docker-compose run --rm web export > backup.json` before upgrading # TODO: tag other sentry images aswell # can be ran multiple times to upgrade sentry - name: run sentry installer command: './install.sh' args: chdir: '{{ app_dir }}' environment: SENTRY_IMAGE: 'getsentry/sentry:{{ app_branch }}' SENTRY_BIND: '{{ bind_address }}' REPORT_SELF_HOSTED_ISSUES: 0 register: installer_output - name: log installer output debug: var: installer_output.stdout_lines - name: start sentry docker_compose: project_src: '{{ app_dir }}' # Note: docker-compose versions <=1.28 load the env file from the current working # directory of the docker-compose command rather than project_src. env_file: '{{ app_dir }}/.env'