feat: add tasks to copy the project to the vm
This commit is contained in:
parent
142d3cc7f2
commit
f50eccd6ac
|
|
@ -82,3 +82,4 @@ ssh-copy-id -p 2222 bapasqui@localhost
|
|||
### Ressources
|
||||
|
||||
https://zenn.dev/zenogawa/articles/gitea_keycloak?locale=en
|
||||
https://caddyserver.com/docs/
|
||||
|
|
|
|||
|
|
@ -21,3 +21,6 @@
|
|||
|
||||
- name: Include Docker installation tasks
|
||||
include_tasks: tasks/docker.yml
|
||||
|
||||
- name: Copy the project to the VM
|
||||
include_tasks: tasks/copy-to-vm.yml
|
||||
|
|
|
|||
25
ansible/playbooks/tasks/copy-to-vm.yml
Normal file
25
ansible/playbooks/tasks/copy-to-vm.yml
Normal 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
|
||||
Loading…
Reference in a new issue