deploiement/roles/site/tasks/main.yml
2022-06-26 13:27:42 +02:00

69 lines
2 KiB
YAML

################################################################################
# installation de mon site personnel
#
# 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:
- emacs
- name: installation de htmlize
block:
- name: copie du script d'installation
ansible.builtin.copy:
src: "../files/install-packages.el"
dest: "/tmp/init.el"
- name: installation de htmlize
ansible.builtin.command:
cmd: "emacs -u {{ user_default }} --script /tmp/init.el"
ignore_errors: yes
- name: clonage du site
ansible.builtin.git:
dest: "{{ path_clone }}"
repo: "{{ git }}"
single_branch: yes
- name: compilation du site
ansible.builtin.command:
cmd: "{{ path_clone }}/generate.sh"
chdir: "{{ path_clone }}"
- name: génération du lien symbolique
file:
src: "{{ path_clone }}/www"
path: "{{ path_site }}"
state: link
- name: configuration de nginx
template:
src: "site-nginx"
dest: "{{ ava }}/gyiwr.conf"
mode: 0644
- name: suppression de la configuration par défaut
ansible.builtin.file:
path: "{{ ena }}/default"
state: absent
- name: lien symbolique pour le site
file:
src: "{{ ava }}/gyiwr.conf"
dest: "{{ ena }}/gyiwr.conf"
state: link