Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the uwsgi role, add a cleanup role. #31

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion globalInstall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
roles:
- systemInit
- nginx
- uwsgi
- dnsmasq
- hostapd
- iptables
Expand Down
11 changes: 11 additions & 0 deletions roles/cleanup/tasks/uwsgi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

- name: Remove uwsgi installed using pip (bug #17)
pip: name=uwsgi state=absent
tags:
- cleanup

- name: Remove the old service file
file: path=/etc/systemd/system/uwsgi.service state=absent
tags:
- cleanup
3 changes: 3 additions & 0 deletions roles/mongodb/files/before-uwsgi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Unit]
# This is needed for BSF Campus
Before=uwsgi.service
17 changes: 0 additions & 17 deletions roles/mongodb/files/uwsgi.service

This file was deleted.

8 changes: 6 additions & 2 deletions roles/mongodb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@
copy: src=mongodb.service dest=/etc/systemd/system/mongodb.service owner=root group=root
when: ansible_architecture == 'armhf' or ansible_architecture == 'armv7l' and mongodb.changed

- name: Copy new uwsgi startup file. Uwsgi must start after MongoDB
copy: src=uwsgi.service dest=/etc/systemd/system/uwsgi.service owner=root group=root
- name: Create a mongodb service override unit directory
file: path=dest=/etc/systemd/system/mongodb.service.d state=directory owner=root group=root
when: ansible_architecture == 'armhf' or ansible_architecture == 'armv7l' and mongodb.changed

- name: Drop in a unit file so uwsgi starts after mongodb
copy: src=before-uwsgi.conf dest=/etc/systemd/system/mongodb.service.d/before-uwsgi.conf owner=root group=root
when: ansible_architecture == 'armhf' or ansible_architecture == 'armv7l' and mongodb.changed

- name: Enable service mongodb
Expand Down
3 changes: 3 additions & 0 deletions roles/updateMook/files/before-uwsgi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Unit]
# This is needed for BSF Campus
Before=uwsgi.service
17 changes: 0 additions & 17 deletions roles/updateMook/files/uwsgi.service

This file was deleted.

13 changes: 8 additions & 5 deletions roles/updateMook/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,17 @@
copy: src=mongodb.service dest=/etc/systemd/system/mongodb.service owner=root group=root
when: st.stat.exists == False

- name: Enable service mongodb
service: name=mongodb enabled=yes
- name: Create a mongodb service override unit directory
file: dest=/etc/systemd/system/mongodb.service.d state=directory owner=root group=root
when: st.stat.exists == False

- name: Copy new uwsgi startup file. Uwsgi must start after MongoDB
copy: src=uwsgi.service dest=/etc/systemd/system/uwsgi.service owner=root group=root
- name: Drop in a unit file so uwsgi starts after mongodb
copy: src=before-uwsgi.conf dest=/etc/systemd/system/mongodb.service.d/before-uwsgi.conf owner=root group=root
when: st.stat.exists == False

- name: Enable service mongodb
service: name=mongodb enabled=yes


####
# Systemd startup script
Expand All @@ -157,4 +160,4 @@

- name: Update is over, let's reboot!
command: reboot
when: st.stat.exists == False
when: st.stat.exists == False
16 changes: 0 additions & 16 deletions roles/uwsgi/files/uwsgi.service

This file was deleted.

3 changes: 0 additions & 3 deletions roles/uwsgi/handlers/main.yml

This file was deleted.

21 changes: 0 additions & 21 deletions roles/uwsgi/tasks/main.yml

This file was deleted.