Compare commits
7 commits
d85c10e13e
...
18f4a8725d
Author | SHA1 | Date | |
---|---|---|---|
18f4a8725d | |||
9538ca2f0f | |||
b7c2aa69d1 | |||
8f4bbebe96 | |||
8b2dccc9be | |||
a68a1a43bf | |||
430a902ab0 |
12 changed files with 280 additions and 13 deletions
28
.gitignore
vendored
Normal file
28
.gitignore
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Created by https://www.toptal.com/developers/gitignore/api/ansible,vim
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=ansible,vim
|
||||
|
||||
### Ansible ###
|
||||
*.retry
|
||||
|
||||
### Vim ###
|
||||
# Swap
|
||||
[._]*.s[a-v][a-z]
|
||||
!*.svg # comment out if you don't need vector files
|
||||
[._]*.sw[a-p]
|
||||
[._]s[a-rt-v][a-z]
|
||||
[._]ss[a-gi-z]
|
||||
[._]sw[a-p]
|
||||
|
||||
# Session
|
||||
Session.vim
|
||||
Sessionx.vim
|
||||
|
||||
# Temporary
|
||||
.netrwhist
|
||||
*~
|
||||
# Auto-generated tag files
|
||||
tags
|
||||
# Persistent undo
|
||||
[._]*.un~
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/ansible,vim
|
22
README.md
22
README.md
|
@ -9,23 +9,29 @@ Ils ont été écris afin d'être lancé sur Debian 10.
|
|||
|
||||
`ansible-playbook main.yml -i inventaire.ini` pour lancer l'installation.
|
||||
|
||||
Chaque dossier `vars` des différents rôles contient des variables pour indiquer
|
||||
le chemin du site, l'utilisateur, etc. Les variables propres à chaque rôle
|
||||
sont expliquées en commentaires.
|
||||
|
||||
## Services
|
||||
|
||||
* bubger : permet de faire des archives html de mailing lists
|
||||
* cgit : serveur web git (utilise gitolite pour gérer les dépôts)
|
||||
* libretls : bibliothèque alternative pour pounce
|
||||
* pounce : bouncer irc (contient litterbox, logger, et scooper, interface
|
||||
graphique; installe aussi sqlite)
|
||||
* site : mon site personnel (installe emacs)
|
||||
|
||||
## inventaire.ini
|
||||
|
||||
Mettez ou l'ip ou le nom de la configuration SSH de votre machine distante.
|
||||
Ici, il s'agit du nom de la configuration SSH pour cacher l'IP de la machine
|
||||
de test.
|
||||
|
||||
## vars
|
||||
|
||||
* sites : Contient les différents noms de domains à utiliser.
|
||||
* cgit : variables pour cgit
|
||||
|
||||
## cgit
|
||||
|
||||
Ces fichiers se trouvent dans `roles/cgit/` dans les dossiers `tasks`
|
||||
et `templates`.
|
||||
Ces fichiers se trouvent dans `roles/cgit/` dans le dossier `templates`.
|
||||
|
||||
- cgit.yml : script ansible d'installation
|
||||
- config-cgit.conf : template de configuration pour la compilation de cgit. Ici,
|
||||
tout est installé dans le même dossier (/home/git).
|
||||
- cgit-nginx : template pour la configuration nginx de cgit
|
||||
|
|
5
main.yml
5
main.yml
|
@ -39,19 +39,22 @@
|
|||
apt:
|
||||
name:
|
||||
- acl
|
||||
- apache2-utils
|
||||
- certbot
|
||||
- gcc
|
||||
- git
|
||||
- make
|
||||
- nginx
|
||||
- python3
|
||||
- python3-pip
|
||||
- sudo
|
||||
- ufw
|
||||
|
||||
roles:
|
||||
- libretls
|
||||
- cgit
|
||||
- site
|
||||
- bubger
|
||||
- pounce
|
||||
|
||||
post_tasks:
|
||||
- name: démarrage par défaut de nginx
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
---
|
||||
private_name: ""
|
||||
# nom du dossier des archives privées
|
||||
private_name: "perso"
|
||||
# chemin d'installation du binaire compilé
|
||||
path: "{{ home_user_default }}/bubger"
|
||||
# chemin où sera enregistré les fichiers HTML
|
||||
path_site: "/var/www/mailing_list"
|
||||
# chemins où seront lié par lien symbolique les dossiers public et private
|
||||
path_site_public: "{{ path_site }}/archives"
|
||||
path_site_private: "{{ path_site }}/{{ private_name }}"
|
||||
|
||||
# dossiers contenant les fichiers HTML générés
|
||||
# les archives publiques
|
||||
public: "{{ path }}/archives"
|
||||
# les archives privées
|
||||
private: "{{ path }}/{{ private_name }}"
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
ansible.builtin.lineinfile:
|
||||
path: "{{ home_user }}/.gitolite.rc"
|
||||
regex: "GIT_CONFIG_KEYS"
|
||||
line: "\tGIT_CONFIG_KEYS => 'cgit\.owner cgit\.section cgit\.hide cgit\.desc',"
|
||||
line: "\tGIT_CONFIG_KEYS => 'cgit\\.owner cgit\\.section cgit\\.hide cgit\\.desc',"
|
||||
|
||||
- name: configuration de la branche par défaut de git
|
||||
community.general.git_config:
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
ansible.builtin.git:
|
||||
dest: "{{ path_tmp_git }}"
|
||||
repo: "{{ git }}"
|
||||
refspec: "{{ tag_git }}"
|
||||
single_branch: yes
|
||||
|
||||
- name: autoreconf
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
git: "https://git.causal.agency/libretls/"
|
||||
tag_git: "3.7.0"
|
||||
path_tmp_git: "/tmp/libretls"
|
||||
lib_name: "libtls.so.25"
|
||||
lib_name: "libtls.so.26.0.1"
|
||||
path_local_lib: "/usr/local/lib/{{ lib_name }}"
|
||||
path_global_lib: "/usr/lib/{{ lib_name }}"
|
||||
|
|
49
roles/pounce/tasks/litterbox.yml
Normal file
49
roles/pounce/tasks/litterbox.yml
Normal file
|
@ -0,0 +1,49 @@
|
|||
################################################################################
|
||||
# installation de litterbox
|
||||
#
|
||||
# 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: 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
|
68
roles/pounce/tasks/main.yml
Normal file
68
roles/pounce/tasks/main.yml
Normal file
|
@ -0,0 +1,68 @@
|
|||
################################################################################
|
||||
# installation de pounce et de litterbox, scooper et kcgi
|
||||
#
|
||||
# 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:
|
||||
- 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
|
78
roles/pounce/tasks/scooper.yml
Normal file
78
roles/pounce/tasks/scooper.yml
Normal file
|
@ -0,0 +1,78 @@
|
|||
################################################################################
|
||||
# installation de kcgi et scooper
|
||||
#
|
||||
# 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: 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 }}"
|
20
roles/pounce/vars/main.yml
Normal file
20
roles/pounce/vars/main.yml
Normal file
|
@ -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/"
|
|
@ -1,8 +1,13 @@
|
|||
---
|
||||
# contient les différents noms de domaines ainsi que les informations de base
|
||||
# de la machine qui peuvent être utilisées dans ni'mporte quel rôle.
|
||||
|
||||
# nom-service_site
|
||||
site: ""
|
||||
cgit_site: ""
|
||||
pounce_site: ""
|
||||
|
||||
user_default: "ubuntu"
|
||||
user_default: ""
|
||||
home_user_default: "/home/{{ user_default }}"
|
||||
ava: "/etc/nginx/sites-available"
|
||||
ena: "/etc/nginx/sites-enabled"
|
||||
|
|
Loading…
Add table
Reference in a new issue