diff --git a/deploy/main.yml b/deploy/main.yml index 78bf747..5abd51d 100644 --- a/deploy/main.yml +++ b/deploy/main.yml @@ -1,82 +1,82 @@ --- - hosts: toolforge become: yes become_user: "tools.wikiloves" gather_facts: no vars: base_path: /data/project/wikiloves checkout_path: "{{ base_path }}/wikiloves" toolforge_path: "{{ base_path }}/www/python" virtualenv_path: "{{ toolforge_path }}/venv" source_path: "{{ toolforge_path }}/src" handlers: - name: Display message debug: msg: > Deploy done. Please update the Server Admin Log via IRC: https://webchat.freenode.net/?channels=#wikimedia-labs tasks: - name: Ensure directories exist file: path: "{{ toolforge_path }}" state: directory tags: - paths - name: Clone Git repository git: repo: 'https://github.com/JeanFred/wikiloves' dest: '{{ checkout_path }}' notify: - Display message tags: - git - skip_ansible_lint # Skip E401, we always want latest version - name: Install requirements pip: requirements: '{{ checkout_path }}/requirements.txt' virtualenv: '{{ virtualenv_path }}' tags: - requirements - name: Symlink src directory file: src: '{{ checkout_path }}' path: '{{ source_path }}' state: link tags: - paths - name: Cron environment variables cron: name: "{{ item.name }}" env: yes value: "{{ item.value }}" with_items: - {name: 'UPDATE_SCRIPT', value: '/data/project/wikiloves/wikiloves/bin/update_database.sh'} - {name: 'UPDATE_LOG_FILE', value: '/data/project/wikiloves/logs/update-database.log'} - {name: 'CRONTAB_LOG_FILE', value: '/data/project/wikiloves/logs/crontab.log'} - {name: 'JSUB_PARAMS', value: '-mem 1000m -once -j y'} tags: - crontab - name: Nightly job updating the database for all competitions cron: name: Nightly update minute: 56 hour: 0 job: jsub $JSUB_PARAMS -o $UPDATE_LOG_FILE -N update_database_high $UPDATE_SCRIPT >> $CRONTAB_LOG_FILE tags: - crontab - name: High-frequency job updating the current competition cron: name: High-frequency update for the current competition minute: '*/15' - job: jsub $JSUB_PARAMS -o $UPDATE_LOG_FILE -N update_database_low $UPDATE_SCRIPT monuments2018 >> $CRONTAB_LOG_FILE + job: jsub $JSUB_PARAMS -o $UPDATE_LOG_FILE -N update_database_low $UPDATE_SCRIPT africa2019 >> $CRONTAB_LOG_FILE tags: - crontab