role_hugo/tasks/configuration.yml

49 lines
1.1 KiB
YAML

---
# tasks file for hugo
- name: Récupérer les informations sur le dossier des données
ansible.builtin.stat:
path: "{{ hugo_data_path }}"
become: true
register: data_path_infos
- name: Créer l'emplacement des données
ansible.builtin.file:
state: directory
path: "{{ hugo_data_path }}"
owner: root
group: root
mode: u=rw,g=r,o=
when: not data_path_infos.stat.exists
become: true
- name: Déployer le service
ansible.builtin.template:
owner: root
group: root
mode: u=rw,g=r,o=r
src: hugo.service.j2
dest: /etc/systemd/system/hugo.service
become: true
notify: Redémarrer le service
- name: Activer le service
ansible.builtin.systemd:
enabled: true
daemon_reload: true
state: restarted
name: hugo.service
when: hugo_timer_enabled
become: true
- name: Déployer la planification
ansible.builtin.template:
owner: root
group: root
mode: u=rw,g=r,o=r
src: hugo.timer.j2
dest: /etc/systemd/system/hugo.timer
when: hugo_timer_enabled
become: true
notify: Activer et exécuter la planification