add null pointer

This commit is contained in:
rick 2023-01-22 02:18:26 +01:00
parent 18f4a8725d
commit 6ad98ea645
Signed by: Rick
GPG key ID: 4A6223D66294EB20
2 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,66 @@
################################################################################
# installation de Null Pointer
#
# Copyright (C) 2022 rick G. <rick@gnous.eu>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.
################################################################################
---
- name: installation des paquets nécessaires
apt:
name:
- sqlite3
- libmagic-dev
- name: installation de uwsgi
ansible.builtin.pip:
name:
- uwsgi
- name: création utilisateur zero
ansible.builtin.user:
name: "{{ user }}"
shell: "/bin/bash"
state: present
- name: mise en place de nullptr
block:
- name: clonage
ansible.builtin.git:
dest: "{{ path_tmp_git }}"
repo: "{{ git }}"
single_branch: yes
- name: copie du fichier de configuration
ansible.builtin.copy:
src: "{{ path_tmp_git }}/instance/config.example.py"
dest: "{{ path_tmp_git }}/instance/config.py"
remote_src: true
- name: changement de la base de données
ansible.builtin.command:
cmd: sed -i -e "s/'\/path\/to/'\/home\/{{ user }}/" "{{ path_tmp_git }}"/instance/config.py
- name: installation des dépendances de nullptr
ansible.builtin.pip:
requirements: "{{ path_tmp_git }}/requirements.txt"
- name: initialisation bdd
ansible.builtin.command:
cmd: "{{ home_user }}/.local/bin/flask db upgrade"
chdir: "{{ path_tmp_git }}"
environment:
FLASK_APP: fhost
become: yes
become_user: "{{ user }}"

View file

@ -0,0 +1,5 @@
---
git: "https://git.0x0.st/mia/0x0"
user: "zero"
home_user: "/home/{{ user }}"
path_tmp_git: "{{ home_user }}/tmp"