parent
4b808ce1a9
commit
4b3a7aae82
|
@ -15,6 +15,8 @@ git_branch: "py3"
|
||||||
le_endpoint: https://acme-v02.api.letsencrypt.org/directory
|
le_endpoint: https://acme-v02.api.letsencrypt.org/directory
|
||||||
#le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
#le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
alt_server_name: ""
|
alt_server_name: ""
|
||||||
|
deploy_type: 'dev' # change to 'test' to activate send_test_email
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Variables in settings.prod.py ###
|
### Variables in settings.prod.py ###
|
||||||
|
|
|
@ -15,6 +15,7 @@ git_branch: "production"
|
||||||
le_endpoint: https://acme-v02.api.letsencrypt.org/directory
|
le_endpoint: https://acme-v02.api.letsencrypt.org/directory
|
||||||
#le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
#le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
alt_server_name: "www.unglue.it"
|
alt_server_name: "www.unglue.it"
|
||||||
|
deploy_type: 'prod'
|
||||||
|
|
||||||
### Variables in settings.prod.py ###
|
### Variables in settings.prod.py ###
|
||||||
mysql_db_name: "{{ vault_mysql_db_name }}"
|
mysql_db_name: "{{ vault_mysql_db_name }}"
|
||||||
|
|
|
@ -65,6 +65,9 @@ INTERNAL_IPS = ('127.0.0.1',)
|
||||||
|
|
||||||
WORKER_LOG_LEVEL = "INFO"
|
WORKER_LOG_LEVEL = "INFO"
|
||||||
|
|
||||||
|
# start out with nothing scheduled
|
||||||
|
CELERYBEAT_SCHEDULE = {}
|
||||||
|
|
||||||
# decide which of the period tasks to add to the schedule
|
# decide which of the period tasks to add to the schedule
|
||||||
#CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
|
#CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
|
||||||
#CELERYBEAT_SCHEDULE['refresh_acqs'] = REFRESH_ACQS_JOB
|
#CELERYBEAT_SCHEDULE['refresh_acqs'] = REFRESH_ACQS_JOB
|
||||||
|
|
|
@ -60,8 +60,8 @@
|
||||||
|
|
||||||
- name: Start celeryd
|
- name: Start celeryd
|
||||||
become: yes
|
become: yes
|
||||||
command: /etc/init.d/celeryd start
|
command: /etc/init.d/celeryd restart
|
||||||
|
|
||||||
- name: Start celerybeat
|
- name: Start celerybeat
|
||||||
become: yes
|
become: yes
|
||||||
command: /etc/init.d/celerybeat start
|
command: /etc/init.d/celerybeat restart
|
|
@ -6,7 +6,7 @@ CELERYD_PID_FILE="/var/run/celery/%n.pid"
|
||||||
CELERY_BIN="{{ project_path }}/{{ virtualenv_name }}/bin/celery"
|
CELERY_BIN="{{ project_path }}/{{ virtualenv_name }}/bin/celery"
|
||||||
CELERYD_USER="celery"
|
CELERYD_USER="celery"
|
||||||
CELERYD_GROUP="celery"
|
CELERYD_GROUP="celery"
|
||||||
CELERYD_LOG_LEVEL="DEBUG"
|
CELERYD_LOG_LEVEL="INFO"
|
||||||
|
|
||||||
VIRTUALENV_ACTIVATE="{{ project_path }}/{{ virtualenv_name }}/bin/activate"
|
VIRTUALENV_ACTIVATE="{{ project_path }}/{{ virtualenv_name }}/bin/activate"
|
||||||
export DJANGO_SETTINGS_MODULE="{{ django_settings_module }}"
|
export DJANGO_SETTINGS_MODULE="{{ django_settings_module }}"
|
||||||
|
|
|
@ -98,16 +98,22 @@ STATIC_ROOT = '/var/www/static'
|
||||||
#CKEDITOR_UPLOAD_PATH = '/var/www/static/media/'
|
#CKEDITOR_UPLOAD_PATH = '/var/www/static/media/'
|
||||||
#CKEDITOR_UPLOAD_PREFIX = 'https://unglue.it/static/media/'
|
#CKEDITOR_UPLOAD_PREFIX = 'https://unglue.it/static/media/'
|
||||||
|
|
||||||
|
# start out with nothing scheduled
|
||||||
|
CELERYBEAT_SCHEDULE = {}
|
||||||
|
|
||||||
# decide which of the period tasks to add to the schedule
|
# decide which of the period tasks to add to the schedule
|
||||||
# CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
|
if '{{ deploy_type }}' == 'test':
|
||||||
# update the statuses of campaigns
|
CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
|
||||||
CELERYBEAT_SCHEDULE['update_active_campaign_statuses'] = UPDATE_ACTIVE_CAMPAIGN_STATUSES
|
elif '{{ deploy_type }}' == 'prod':
|
||||||
CELERYBEAT_SCHEDULE['report_new_ebooks'] = EBOOK_NOTIFICATIONS_JOB
|
# update the statuses of campaigns
|
||||||
CELERYBEAT_SCHEDULE['notify_ending_soon'] = NOTIFY_ENDING_SOON_JOB
|
CELERYBEAT_SCHEDULE['update_active_campaign_statuses'] = UPDATE_ACTIVE_CAMPAIGN_STATUSES
|
||||||
CELERYBEAT_SCHEDULE['update_account_statuses'] = UPDATE_ACCOUNT_STATUSES
|
CELERYBEAT_SCHEDULE['report_new_ebooks'] = EBOOK_NOTIFICATIONS_JOB
|
||||||
CELERYBEAT_SCHEDULE['notify_expiring_accounts'] = NOTIFY_EXPIRING_ACCOUNTS
|
CELERYBEAT_SCHEDULE['notify_ending_soon'] = NOTIFY_ENDING_SOON_JOB
|
||||||
CELERYBEAT_SCHEDULE['refresh_acqs'] = REFRESH_ACQS_JOB
|
CELERYBEAT_SCHEDULE['update_account_statuses'] = UPDATE_ACCOUNT_STATUSES
|
||||||
CELERYBEAT_SCHEDULE['refresh_acqs'] = NOTIFY_UNCLAIMED_GIFTS
|
CELERYBEAT_SCHEDULE['notify_expiring_accounts'] = NOTIFY_EXPIRING_ACCOUNTS
|
||||||
|
CELERYBEAT_SCHEDULE['refresh_acqs'] = REFRESH_ACQS_JOB
|
||||||
|
CELERYBEAT_SCHEDULE['refresh_acqs'] = NOTIFY_UNCLAIMED_GIFTS
|
||||||
|
|
||||||
|
|
||||||
ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
|
ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
- hosts: regluit-prod
|
- hosts: regluit-prod
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
tasks:
|
tasks:
|
||||||
# Need to install python2.7 and pip first so Ansible will function
|
# Need to install python3.6 and pip first so Ansible will function
|
||||||
# This is due to Ubuntu 16 shipping with Python3 by default
|
- name: Install python3.6 and pip for dev
|
||||||
- name: Install python2.7 and pip
|
|
||||||
become: true
|
become: true
|
||||||
raw: bash -c "apt -qqy update && apt install -qqy python2.7-dev python-pip"
|
raw: bash -c "apt -qqy update && apt install -y python3.6 python3-pip python3-apt"
|
||||||
register: output
|
register: output
|
||||||
changed_when: output.stdout != ""
|
changed_when: output.stdout != ""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue