Skip to content
Snippets Groups Projects
Commit 3a329e37 authored by Hinrikus Wolf's avatar Hinrikus Wolf
Browse files

rum probiert

parent 639a88e0
No related branches found
No related tags found
1 merge request!3Unify uwsgi python
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure we have python 3 - name: ensure we have python 3
apt: apt:
...@@ -30,18 +31,7 @@ ...@@ -30,18 +31,7 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure we have the necessary libraries for ldap
apt:
name: "{{ item }}"
state: installed
with_items:
- libsasl2-dev
- libssl-dev
- libldap2-dev
tags:
- uwsgi-app
- "{{ app_name }}"
- include: sqlite.yml - include: sqlite.yml
when: app_db == "sqlite" when: app_db == "sqlite"
...@@ -60,6 +50,7 @@ ...@@ -60,6 +50,7 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure we have a user - name: ensure we have a user
user: user:
...@@ -73,6 +64,7 @@ ...@@ -73,6 +64,7 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure a temporary directory exists - name: ensure a temporary directory exists
template: template:
...@@ -86,17 +78,19 @@ ...@@ -86,17 +78,19 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure we have our uwsgi config file - name: ensure we have our uwsgi config file
template: template:
src: uwsgi.ini.j2 src: uwsgi.ini.j2
dest: "/etc/uwsgi/apps/{{ app_name }}.ini" dest: "/etc/uwsgi/apps/{{ app_instance }}.ini"
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure additional software is installed - name: ensure additional software is installed
apt: name={{ item }} state=present apt: name={{ item }} state=present
...@@ -106,6 +100,7 @@ ...@@ -106,6 +100,7 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure the deploy key is available - name: ensure the deploy key is available
copy: copy:
...@@ -117,6 +112,7 @@ ...@@ -117,6 +112,7 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
# https://github.com/ansible/ansible/issues/27699 # https://github.com/ansible/ansible/issues/27699
- name: ensure git module is able to clone - name: ensure git module is able to clone
...@@ -124,6 +120,7 @@ ...@@ -124,6 +120,7 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure we have the program - name: ensure we have the program
git: git:
...@@ -137,12 +134,14 @@ ...@@ -137,12 +134,14 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure git module is not able to clone anymore - name: ensure git module is not able to clone anymore
command: mount -o remount,noexec /tmp command: mount -o remount,noexec /tmp
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure we have a virtualenv - name: ensure we have a virtualenv
pip: pip:
...@@ -154,6 +153,7 @@ ...@@ -154,6 +153,7 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure we have our config - name: ensure we have our config
template: template:
...@@ -167,6 +167,7 @@ ...@@ -167,6 +167,7 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- name: ensure we have our secret config - name: ensure we have our secret config
template: template:
...@@ -181,6 +182,7 @@ ...@@ -181,6 +182,7 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
when: when:
- secret_config is defined - secret_config is defined
- secret_config == True - secret_config == True
...@@ -194,14 +196,18 @@ ...@@ -194,14 +196,18 @@
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
- meta: flush_handlers - meta: flush_handlers
- name: ensure the service is enabled - name: ensure the service is enabled
service: service:
name: "uwsgi@{{ app_name }}" name: "uwsgi@{{ app_instance }}"
enabled: yes enabled: yes
state: started state: started
tags: tags:
- uwsgi-app - uwsgi-app
- "{{ app_name }}" - "{{ app_name }}"
- "{{ app_instance }}"
...@@ -38,8 +38,11 @@ ...@@ -38,8 +38,11 @@
# enthält webapps eine mehr-instanz-app mehrfach? wenn ja, ist ../vars/item.yml doof # enthält webapps eine mehr-instanz-app mehrfach? wenn ja, ist ../vars/item.yml doof
# wenn nein, wie realisieren wir das? bsp: schildergenerator mit schilder, boxes # wenn nein, wie realisieren wir das? bsp: schildergenerator mit schilder, boxes
- include_tasks: app.yml - include_tasks: app.yml
vars:
app_instance: instance #"{{ item.instance }}"
app_name: name #"{{ item.app }}"
vars_files: vars_files:
- "../vars/{{ item }}.yml" - "../vars/{{ item.app }}.yml"
- "{{ inventory_dir }}/vars/{{ item }}.yml" - "{{ inventory_dir }}/vars/{{ item.app_vars }}"
with_items: "{{ webapps }}" with_items: "{{ webapps }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment