|
@@ -53,6 +53,14 @@
|
53
|
53
|
service: name=gpodder state=stopped
|
54
|
54
|
ignore_errors: True
|
55
|
55
|
|
|
56
|
+- name: Stop old gpodder worker instance
|
|
57
|
+ service: name=gpodder_worker state=stopped
|
|
58
|
+ ignore_errors: True
|
|
59
|
+
|
|
60
|
+- name: Stop old gpodder beat instance
|
|
61
|
+ service: name=gpodder_beat state=stopped
|
|
62
|
+ ignore_errors: True
|
|
63
|
+
|
56
|
64
|
- name: Remove old gpodder directory
|
57
|
65
|
shell: rm -rf /home/gpodder/gpodder
|
58
|
66
|
|
|
@@ -80,6 +88,9 @@
|
80
|
88
|
- name: Install dependencies for production in virtualenv
|
81
|
89
|
shell: bash -c 'source venv/bin/activate && pip install -r requirements-setup.txt' chdir=/home/gpodder/gpodder
|
82
|
90
|
|
|
91
|
+- name: Create gpodder logs directory
|
|
92
|
+ file: state=directory path=/home/gpodder/logs owner=gpodder group=gpodder
|
|
93
|
+
|
83
|
94
|
- name: Create gpodder media directory
|
84
|
95
|
file:
|
85
|
96
|
state: directory
|
|
@@ -88,10 +99,31 @@
|
88
|
99
|
group: gpodder
|
89
|
100
|
mode: 0750
|
90
|
101
|
|
91
|
|
-# TODO put env somewhere so we can use it for systemd unit, migration and cron
|
|
102
|
+- name: Add gpodder wrapper script
|
|
103
|
+ template:
|
|
104
|
+ src=home_gpodder_env.j2
|
|
105
|
+ dest=/home/gpodder/env.sh
|
|
106
|
+ owner=gpodder
|
|
107
|
+ group=gpodder
|
|
108
|
+ mode=0750
|
|
109
|
+
|
|
110
|
+- name: Fix ownership of installed files
|
|
111
|
+ shell: chown -R gpodder:gpodder /home/gpodder/gpodder
|
|
112
|
+
|
|
113
|
+- name: Run collecting script for static files
|
|
114
|
+ become: true
|
|
115
|
+ become_user: gpodder
|
|
116
|
+ shell: ./env.sh python manage.py collectstatic --no-input chdir=/home/gpodder
|
|
117
|
+
|
|
118
|
+#- name: Run compiling script for messages
|
|
119
|
+# become: true
|
|
120
|
+# become_user: gpodder
|
|
121
|
+# shell: ./env.sh python manage.py compilemessages chdir=/home/gpodder
|
92
|
122
|
|
93
|
123
|
- name: Run database migration script
|
94
|
|
- shell: bash -c 'source venv/bin/activate && DATABASE_URL=postgres://{{ gpodder_db_username }}:{{ gpodder_db_password }}@localhost:5432/{{ gpodder_db_database }}?sslmode=disable SECRET_KEY={{ gpodder_secret }} python manage.py migrate' chdir=/home/gpodder/gpodder
|
|
124
|
+ become: true
|
|
125
|
+ become_user: gpodder
|
|
126
|
+ shell: ./env.sh python manage.py migrate chdir=/home/gpodder
|
95
|
127
|
|
96
|
128
|
- name: Add systemd service to start gpodder automatically
|
97
|
129
|
template:
|
|
@@ -100,12 +132,38 @@
|
100
|
132
|
owner=root
|
101
|
133
|
group=root
|
102
|
134
|
|
|
135
|
+- name: Add systemd service to start gpodder worker automatically
|
|
136
|
+ template:
|
|
137
|
+ src=etc_systemd_system_gpodder_worker.j2
|
|
138
|
+ dest=/etc/systemd/system/gpodder_worker.service
|
|
139
|
+ owner=root
|
|
140
|
+ group=root
|
|
141
|
+
|
|
142
|
+- name: Add systemd service to start gpodder beat automatically
|
|
143
|
+ template:
|
|
144
|
+ src=etc_systemd_system_gpodder_beat.j2
|
|
145
|
+ dest=/etc/systemd/system/gpodder_beat.service
|
|
146
|
+ owner=root
|
|
147
|
+ group=root
|
|
148
|
+
|
103
|
149
|
- name: Register new gpodder service
|
104
|
150
|
systemd: name=gpodder daemon_reload=yes enabled=yes
|
105
|
151
|
|
|
152
|
+- name: Register new gpodder worker service
|
|
153
|
+ systemd: name=gpodder_worker daemon_reload=yes enabled=yes
|
|
154
|
+
|
|
155
|
+- name: Register new gpodder beat service
|
|
156
|
+ systemd: name=gpodder_beat daemon_reload=yes enabled=yes
|
|
157
|
+
|
106
|
158
|
- name: Start new gpodder instance
|
107
|
159
|
service: name=gpodder state=started
|
108
|
160
|
|
|
161
|
+- name: Start new gpodder worker instance
|
|
162
|
+ service: name=gpodder_worker state=started
|
|
163
|
+
|
|
164
|
+- name: Start new gpodder beat instance
|
|
165
|
+ service: name=gpodder_beat state=started
|
|
166
|
+
|
109
|
167
|
# TODO cron jobs
|
110
|
168
|
# envdir envs/dev python manage.py update-toplist
|
111
|
169
|
# envdir envs/dev python manage.py update-episode-toplist
|
|
@@ -117,6 +175,14 @@
|
117
|
175
|
# envdir envs/dev python manage.py feed-downloader --toplist --max <max-updates>
|
118
|
176
|
# envdir envs/dev python manage.py feed-downloader --update-new --max <max-updates>
|
119
|
177
|
|
|
178
|
+- name: Configure gpodder logrotate
|
|
179
|
+ copy:
|
|
180
|
+ src=etc_logrotate_gpodder
|
|
181
|
+ dest=/etc/logrotate.d/gpodder
|
|
182
|
+ owner=root
|
|
183
|
+ group=root
|
|
184
|
+ mode=0644
|
|
185
|
+
|
120
|
186
|
- name: Create the Apache gpodder sites config files
|
121
|
187
|
template:
|
122
|
188
|
src=etc_apache2_sites-available_gpodder.j2
|