mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-30 12:23:00 +00:00
dfbf9972c2
Signed-off-by: Yohann D'ANELLO <yohann.danello@gmail.com>
49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
---
|
|
- 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: "{{ note.git_branch }}"
|
|
force: true
|
|
|
|
- name: Use default env vars (should be updated!)
|
|
template:
|
|
src: "env.j2"
|
|
dest: "/var/www/note_kfet/.env"
|
|
mode: 0644
|
|
force: false
|
|
|
|
- name: Update permissions for note_kfet dir
|
|
file:
|
|
path: /var/www/note_kfet
|
|
state: directory
|
|
recurse: yes
|
|
owner: www-data
|
|
group: www-data
|
|
|
|
- name: Setup cron jobs
|
|
when: "note.cron_enabled"
|
|
template:
|
|
src: note.cron.j2
|
|
dest: /etc/cron.d/note
|
|
owner: root
|
|
group: root
|
|
|
|
- name: Set default directory to /var/www/note_kfet
|
|
lineinfile:
|
|
path: /etc/skel/.bashrc
|
|
line: 'cd /var/www/note_kfet'
|
|
|
|
- name: Automatically source Python virtual environment
|
|
lineinfile:
|
|
path: /etc/skel/.bashrc
|
|
line: 'source /var/www/note_kfet/env/bin/activate'
|