From 8b2dccc9be4eb4774a68c70641656260f57156b1 Mon Sep 17 00:00:00 2001 From: rick Date: Sat, 21 Jan 2023 20:04:13 +0100 Subject: [PATCH] add pounce, litterbox and scooper --- roles/pounce/tasks/litterbox.yml | 49 ++++++++++++++++++++ roles/pounce/tasks/main.yml | 68 ++++++++++++++++++++++++++++ roles/pounce/tasks/scooper.yml | 78 ++++++++++++++++++++++++++++++++ roles/pounce/vars/main.yml | 20 ++++++++ 4 files changed, 215 insertions(+) create mode 100644 roles/pounce/tasks/litterbox.yml create mode 100644 roles/pounce/tasks/main.yml create mode 100644 roles/pounce/tasks/scooper.yml create mode 100644 roles/pounce/vars/main.yml diff --git a/roles/pounce/tasks/litterbox.yml b/roles/pounce/tasks/litterbox.yml new file mode 100644 index 0000000..e341ebd --- /dev/null +++ b/roles/pounce/tasks/litterbox.yml @@ -0,0 +1,49 @@ +################################################################################ +# installation de litterbox +# +# 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: création utilisateur litterbox + ansible.builtin.user: + name: "{{ litterbox.user }}" + shell: "/bin/bash" + state: present + +- name: mise en place de litterbox + block: + - name: clonage de litterbox + ansible.builtin.git: + dest: "{{ litterbox.path_tmp_git }}" + repo: "{{ litterbox.git }}" + single_branch: yes + + - name: configuration de la compilation de litterbox + ansible.builtin.command: + cmd: "./configure" + chdir: "{{ litterbox.path_tmp_git }}" + + - name: compilation de litterbox + community.general.make: + chdir: "{{ litterbox.path_tmp_git }}" + + become: yes + become_user: "{{ litterbox.user }}" + +- name: installation de litterbox + community.general.make: + chdir: "{{ litterbox.path_tmp_git }}" + target: install diff --git a/roles/pounce/tasks/main.yml b/roles/pounce/tasks/main.yml new file mode 100644 index 0000000..e96cb0e --- /dev/null +++ b/roles/pounce/tasks/main.yml @@ -0,0 +1,68 @@ +################################################################################ +# installation de pounce et de litterbox, scooper et kcgi +# +# 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: + - bmake + - sqlite3 + - libsqlite3-dev + - universal-ctags + - pkg-config + +- name: création utilisateur pounce + ansible.builtin.user: + name: "{{ user }}" + shell: "/bin/bash" + state: present + +- name: mise en place de pounce + block: + - name: clonage de pounce + ansible.builtin.git: + dest: "{{ path_tmp_git }}" + repo: "{{ git }}" + single_branch: yes + + - name: configuration de la compilation de pounce + ansible.builtin.command: + cmd: "{{ path_tmp_git }}/configure" + chdir: "{{ path_tmp_git }}" + + - name: compilation de pounce + community.general.make: + chdir: "{{ path_tmp_git }}" + + become: yes + become_user: "{{ user }}" + +- name: installation de pounce + community.general.make: + chdir: "{{ path_tmp_git }}" + target: install + +- name: installation du logger + include_role: + name: pounce + tasks_from: litterbox + +- name: installation de l'interface graphique + include_role: + name: pounce + tasks_from: scooper diff --git a/roles/pounce/tasks/scooper.yml b/roles/pounce/tasks/scooper.yml new file mode 100644 index 0000000..ee311bd --- /dev/null +++ b/roles/pounce/tasks/scooper.yml @@ -0,0 +1,78 @@ +################################################################################ +# installation de kcgi et scooper +# +# 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: téléchargement de kcgi + ansible.builtin.get_url: + dest: "{{ kcgi.path_tmp }}" + url: "{{ kcgi.url_file }}" + +- name: décompression de kcgi + ansible.builtin.unarchive: + dest: "{{ kcgi.path_tmp }}" + src: "{{ kcgi.path_tmp }}/{{ kcgi.file_name }}" + list_files: true + register: result + +- name: tset + debug: + msg: "{{ result.files[0] }}" + +- name: modification du makefile + ansible.builtin.command: + cmd: "sed -i -e 's/#CPPFLAG/CPPFLAG/' {{ kcgi.path_tmp }}/{{ result.files[0] }}/Makefile" + +- name: configuration de la compilation de kcgi + ansible.builtin.command: + cmd: "./configure" + chdir: "{{ kcgi.path_tmp }}/{{ result.files[0] }}" + +- name: compilation de kcgi + ansible.builtin.command: + cmd: "bmake" + chdir: "{{ kcgi.path_tmp }}/{{ result.files[0] }}" + +- name: installation de kcgi + ansible.builtin.command: + cmd: "bmake install" + chdir: "{{ kcgi.path_tmp }}/{{ result.files[0] }}" + +- name: mise en place de scooper + block: + - name: téléchargement de scooper + ansible.builtin.git: + dest: "{{ scooper.path_tmp_git }}" + repo: "{{ scooper.git }}" + single_branch: yes + + - name: configuration de la compilation de scooper + ansible.builtin.command: + cmd: "./configure" + chdir: "{{ scooper.path_tmp_git }}" + + - name: compilation de scooper + community.general.make: + chdir: "{{ scooper.path_tmp_git }}" + + - name: installation de scooper + community.general.make: + chdir: "{{ scooper.path_tmp_git }}" + target: install + + become: yes + become_user: "{{ litterbox.user }}" diff --git a/roles/pounce/vars/main.yml b/roles/pounce/vars/main.yml new file mode 100644 index 0000000..f0bfed3 --- /dev/null +++ b/roles/pounce/vars/main.yml @@ -0,0 +1,20 @@ +--- +git: "https://git.causal.agency/pounce" +user: "pounce" +home_user: "/home/{{ user }}" +path_tmp_git: "{{ home_user }}/pounce" + +litterbox: + git: "https://git.causal.agency/litterbox" + user: "litterbox" + home_user: "/home/litterbox" + path_tmp_git: "/home/litterbox/litterbox" + +kcgi: + path_tmp: "/tmp/" + url_file: "https://kristaps.bsd.lv/kcgi/snapshots/kcgi.tgz" + file_name: "kcgi.tgz" + +scooper: + path_tmp_git: "{{ litterbox.home_user }}/scooper" + git: "https://git.causal.agency/scooper/"