-
Notifications
You must be signed in to change notification settings - Fork 0
/
hxat_play.yml
55 lines (38 loc) · 1.27 KB
/
hxat_play.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
- import_playbook: common_play.yml
- hosts: '{{ target_hosts | default("tag_service_hxat", true) }}'
remote_user: "{{ my_remote_user }}"
become: yes
vars_files:
- vars/common_vars.yml
- vars/hxat_vars.yml
handlers:
- include_tasks: handlers/main.yml
tasks:
- name: install redis
include_role:
name: external/geerlingguy.redis
- name: install webapp
include_role:
name: webapp_install
- name: run migration and collectstatic
include_tasks: 'roles/webapp_install/tasks/django_manage.yml'
- name: create django admin user
include_tasks: 'roles/webapp_install/tasks/django_admin_user.yml'
- name: config nginx
include_role:
name: nginx
- name: cronjob to clear sessions
cron:
name: 'clear django sessions'
user: '{{ service_user }}'
hour: '7'
minute: '0'
state: present
job: >
{{ service_name | upper }}_DOTENV_PATH={{ service_dotenv_path }} {{ service_venv_dir }}/bin/python3 {{ service_install_dir }}/manage.py clearsessions 2>&1 | logger -t '[clear django sessions]'
- import_playbook: rds_service_dbdump_play.yml
vars:
project_name: hxat
when: ec2_tag_cluster == 'prod'
- import_playbook: backup_play.yml