L'installation des SSG se fait par un rôle à part du webserver
This commit is contained in:
parent
1b8d823b65
commit
0604af785f
|
@ -1,5 +1,5 @@
|
||||||
hostname: fr.tild3.org
|
hostname: fr.tild3.org
|
||||||
roles: [ webserver, rust ]
|
roles: [ webserver, rust, ssg ]
|
||||||
peers:
|
peers:
|
||||||
- name: tilde.netlib.re
|
- name: tilde.netlib.re
|
||||||
client_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEHsVZvvVX3VPj2sWxrb8LJrn3650aoLAZgbY7+CB+NU"
|
client_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEHsVZvvVX3VPj2sWxrb8LJrn3650aoLAZgbY7+CB+NU"
|
||||||
|
@ -7,6 +7,7 @@ peers:
|
||||||
packages:
|
packages:
|
||||||
debian: [ subversion, mercurial, htop, tmux, vim, emacs, mutt, weechat, elinks, rsync, dnsutils, make, g++, libssl-dev, mosh, gopher ]
|
debian: [ subversion, mercurial, htop, tmux, vim, emacs, mutt, weechat, elinks, rsync, dnsutils, make, g++, libssl-dev, mosh, gopher ]
|
||||||
rust: [ lsd ]
|
rust: [ lsd ]
|
||||||
|
ssg: [ zola, ttbp ]
|
||||||
users:
|
users:
|
||||||
- name: tofu
|
- name: tofu
|
||||||
sudo: true
|
sudo: true
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
- name: Vérifier quels SSG sont installés
|
||||||
|
stat:
|
||||||
|
path: "/usr/local/bin/{{ item }}"
|
||||||
|
loop: "{{ packages.ssg }}"
|
||||||
|
register: ssg_exists
|
||||||
|
when: packages is defined and packages.ssg is defined
|
||||||
|
|
||||||
|
- name: "Installer les générateurs de sites statiques activés dans la config"
|
||||||
|
include: "{{ item.item }}/main.yml"
|
||||||
|
loop: "{{ ssg_exists.results | default([]) }}"
|
||||||
|
when: not item.stat.exists
|
|
@ -0,0 +1,26 @@
|
||||||
|
- stat:
|
||||||
|
path: /usr/local/bin/ttbp
|
||||||
|
register: ttbp
|
||||||
|
|
||||||
|
- name: Télécharger la source de ttbp
|
||||||
|
git:
|
||||||
|
repo: https://tildegit.org/envs/ttbp.git
|
||||||
|
dest: /tmp/ttbp
|
||||||
|
when: not ttbp.stat.exists
|
||||||
|
|
||||||
|
- name: ttbp a des dépendances non installées dans main.yml
|
||||||
|
apt:
|
||||||
|
name: "python-setuptools"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Compiler ttbp
|
||||||
|
command:
|
||||||
|
cmd: "python /tmp/ttbp/setup.py install"
|
||||||
|
chdir: /tmp/ttbp
|
||||||
|
when: not ttbp.stat.exists
|
||||||
|
|
||||||
|
- name: Supprimer les fichiers temporaires de ttbp
|
||||||
|
file:
|
||||||
|
path: /tmp/ttbp
|
||||||
|
state: absent
|
||||||
|
when: not ttbp.stat.exists
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Malheureusement zola compile pas sur debian buster (rustc v1.34 contre 1.36 requis)
|
||||||
|
# Donc on copie un binaire que j'ai compilé avec amour
|
||||||
|
- name: Installer le générateur de site statique zola
|
||||||
|
copy:
|
||||||
|
src: ../../files/bin/zola
|
||||||
|
dest: /usr/local/bin/zola
|
||||||
|
mode: 0755
|
|
@ -1,6 +1,4 @@
|
||||||
# Install apache and accoutrements www, irrespective of what role they might have
|
- name: Installer les paquets pour le serveur web
|
||||||
---
|
|
||||||
- name: Install packages for webserver
|
|
||||||
apt:
|
apt:
|
||||||
name: "{{ packages }}"
|
name: "{{ packages }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -14,62 +12,3 @@
|
||||||
- php-intl
|
- php-intl
|
||||||
- php-sqlite3
|
- php-sqlite3
|
||||||
- php-mbstring
|
- php-mbstring
|
||||||
|
|
||||||
# Malheureusement zola compile pas sur debian buster (rustc v1.34 contre 1.36 requis)
|
|
||||||
# Donc on copie un binaire que j'ai compilé avec amour
|
|
||||||
- name: Installer le générateur de site statique zola
|
|
||||||
copy:
|
|
||||||
src: ../files/bin/zola
|
|
||||||
dest: /usr/local/bin/zola
|
|
||||||
mode: 0755
|
|
||||||
|
|
||||||
# - stat:
|
|
||||||
# path: /usr/local/bin/zola
|
|
||||||
# register: zola
|
|
||||||
#
|
|
||||||
# - name: Télécharger la source de zola
|
|
||||||
# git:
|
|
||||||
# dest: /tmp/zola
|
|
||||||
# repo: https://github.com/getzola/zola
|
|
||||||
# version: "v0.10.1"
|
|
||||||
# when: not zola.stat.exists
|
|
||||||
#
|
|
||||||
# Zola a besoin de make, g++, libssl-dev et libsass-dev qui sont installés dans main.yml
|
|
||||||
#
|
|
||||||
# - name: Compiler zola
|
|
||||||
# command: "cargo install --path /tmp/zola"
|
|
||||||
# when: not zola.stat.exists
|
|
||||||
#
|
|
||||||
# - name: Supprimer les fichiers temporaires de zola
|
|
||||||
# file:
|
|
||||||
# path: /tmp/zola
|
|
||||||
# state: absent
|
|
||||||
# when: not zola.stat.exists
|
|
||||||
|
|
||||||
|
|
||||||
- stat:
|
|
||||||
path: /usr/local/bin/ttbp
|
|
||||||
register: ttbp
|
|
||||||
|
|
||||||
- name: Télécharger la source de ttbp
|
|
||||||
git:
|
|
||||||
repo: https://tildegit.org/envs/ttbp.git
|
|
||||||
dest: /tmp/ttbp
|
|
||||||
when: not ttbp.stat.exists
|
|
||||||
|
|
||||||
- name: ttbp a des dépendances non installées dans main.yml
|
|
||||||
apt:
|
|
||||||
name: "python-setuptools"
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Compiler ttbp
|
|
||||||
command:
|
|
||||||
cmd: "python /tmp/ttbp/setup.py install"
|
|
||||||
chdir: /tmp/ttbp
|
|
||||||
when: not ttbp.stat.exists
|
|
||||||
|
|
||||||
- name: Supprimer les fichiers temporaires de ttbp
|
|
||||||
file:
|
|
||||||
path: /tmp/ttbp
|
|
||||||
state: absent
|
|
||||||
when: not ttbp.stat.exists
|
|
||||||
|
|
Loading…
Reference in New Issue