add blog redeployment playbook

This commit is contained in:
2026-04-03 17:27:33 +02:00
parent 6351939804
commit c751e3c15b

23
playbooks/reload_blog.yml Normal file
View File

@@ -0,0 +1,23 @@
---
- name: Deploy the fresh version of the blog
hosts: strato2
become: yes
gather_facts: yes
tasks:
- name: Pull blog repo via ssh
ansible.builtin.git:
repo: git@82.165.198.84:vashqlf/benji0x3c.git
dest: /root/benji0x3c
version: main
accept_hostkey: yes
become_user: root # run as a specific user with SSH key access
- name: Run zola build
ansible.builtin.command:
cmd: zola build
chdir: /root/benji0x3c # directory containing config.toml
- name: Rsync build on remote
ansible.builtin.command:
cmd: rsync -av /root/benji0x3c/public/ /var/www/public/