feat: add tasks to copy the project to the vm

This commit is contained in:
Haletran 2026-03-01 23:54:22 +01:00
parent 142d3cc7f2
commit f50eccd6ac
3 changed files with 29 additions and 0 deletions

View file

@ -82,3 +82,4 @@ ssh-copy-id -p 2222 bapasqui@localhost
### Ressources ### Ressources
https://zenn.dev/zenogawa/articles/gitea_keycloak?locale=en https://zenn.dev/zenogawa/articles/gitea_keycloak?locale=en
https://caddyserver.com/docs/

View file

@ -21,3 +21,6 @@
- name: Include Docker installation tasks - name: Include Docker installation tasks
include_tasks: tasks/docker.yml include_tasks: tasks/docker.yml
- name: Copy the project to the VM
include_tasks: tasks/copy-to-vm.yml

View file

@ -0,0 +1,25 @@
---
- name: Install rsync
apt:
name: rsync
state: present
become: yes
- name: Ensure project directory exists
file:
path: "/home/{{ ansible_user }}/projects/ft_chatons"
state: directory
mode: '0755'
become: no
- name: Sync project files to VM
synchronize:
src: "{{ playbook_dir }}/../../"
dest: "/home/{{ ansible_user }}/projects/ft_chatons/"
delete: yes
rsync_opts:
- "--exclude=.git"
- "--exclude=.vscode"
- "--exclude=ansible"
- "--exclude=*.qcow2"
become: no