1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-18 13:32:28 +00:00

🐛 First fix Ansible installation

This commit is contained in:
Yohann D'ANELLO 2020-07-15 09:27:11 +02:00
parent 3dfed70eb1
commit 3f0208a664
6 changed files with 40 additions and 25 deletions

12
ansible/base.yml Normal file → Executable file
View File

@ -1,9 +1,9 @@
#!/usr/bin/env ansible-python
#!/usr/bin/env ansible-playbook
---
- hosts: beta-nk20
- hosts: bde-nk20-beta.adh.crans.org
roles:
- apt-basic
- nk20
- python-venv
- nginx
- 1-apt-basic
- 2-nk20
- 3-pip
- 4-nginx

View File

@ -15,6 +15,6 @@
- texlive-latex-extra
- texlive-fonts-extra
- texlive-lang-french
register: pkg_result
retries: 3
until: pkg_result is succedded
register: pkg_result
retries: 3
until: pkg_result is succeeded

View File

@ -0,0 +1,23 @@
---
- name: Create note_kfet dir with good permissions
file:
path: /var/www/note_kfet
state: directory
owner: www-data
group: www-data
mode: u=rwx,g=rwxs,o=rx
- name: Clone Note Kfet
git:
repo: https://gitlab.crans.org/bde/nk20.git
dest: /var/www/note_kfet
version: beta-soon
track_submodules: yes
- name: Update permissions for note_kfet dir
file:
path: /var/www/note_kfet
state: directory
recurse: yes
owner: www-data
group: www-data

View File

@ -3,8 +3,10 @@
pip:
requirements: /var/www/note_kfet/requirements/base.txt
virtualenv: /var/www/note_kfet/env
virtualenv_command: /usr/bin/python3 -m venv
- name: Install PIP production dependencies
pip:
requirements: /var/www/note_kfet/requirements/production.txt
virtualenv: /var/www/note_kfet/env
virtualenv_command: /usr/bin/python3 -m venv

View File

@ -1,19 +1,21 @@
---
- name: Copy example conf of Nginx
command: cp /var/www/note_kfet/nginx_note.conf_example /var/www/note_kfet/nginx_note.conf
- name: Update Nginx conf
replace:
path: /var/www/note_kfet/nginx_note.conf.example
dest: /var/www/note_kfet/nginx_note.conf
path: /var/www/note_kfet/nginx_note.conf
regexp: 'note.example.org'
replace: 'bde-nk20-beta.adh.crans.org'
- name: Copy conf to Nginx
file:
path: /var/www/note_kfet/nginx_note.conf
src: /var/www/note_kfet/nginx_note.conf
dest: /etc/nginx/sites-enabled/nginx_note.conf
state: link
- name: Copy conf to UWSGI
file:
path: /var/www/note_kfet/uwsgi_note.ini
src: /var/www/note_kfet/uwsgi_note.ini
dest: /etc/uwsgi/apps-enabled/uwsgi_note.ini
state: link

View File

@ -1,12 +0,0 @@
---
- name: Create note_kfet dir with good permissions
file:
path: /var/www
owner: www-data
group: foo
mode: u=rw,g=rws,o=r
- name: Clone Note Kfet
git:
repo: https://gitlab.crans.org/bde/nk20.git
dest: /var/www/note_kfet