diff --git a/roles/nullptr/tasks/main.yml b/roles/nullptr/tasks/main.yml new file mode 100644 index 0000000..801c4ed --- /dev/null +++ b/roles/nullptr/tasks/main.yml @@ -0,0 +1,66 @@ +################################################################################ +# installation de Null Pointer +# +# Copyright (C) 2022 rick G. +# +# 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 . +################################################################################ + +--- +- 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 }}" diff --git a/roles/nullptr/vars/main.yml b/roles/nullptr/vars/main.yml new file mode 100644 index 0000000..fd363c9 --- /dev/null +++ b/roles/nullptr/vars/main.yml @@ -0,0 +1,5 @@ +--- +git: "https://git.0x0.st/mia/0x0" +user: "zero" +home_user: "/home/{{ user }}" +path_tmp_git: "{{ home_user }}/tmp"