split role in multiple files

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2025-11-24 23:30:06 +01:00
commit 165b48cd61
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
4 changed files with 59 additions and 47 deletions

20
tasks/dnsmasq.yml Normal file
View file

@ -0,0 +1,20 @@
---
- name: disable and stop dnsmasq
ansible.builtin.systemd:
name: "dnsmasq.service"
enabled: False
state: "stopped"
masked: true
notify: systemctl daemon-reload
- name: deploy dnsmasq
ansible.builtin.template:
src: etc/systemd/system/dnsmasq.j2
dest: "/etc/systemd/system/dnsmasq@.service"
notify: systemctl daemon-reload
- name: deploy dnsmasq in netns
ansible.builtin.template:
src: usr/local/bin/run-dnsmasq-in-netns.sh.j2
dest: "/usr/local/bin/run-dnsmasq-in-netns.sh"

27
tasks/git.yml Normal file
View file

@ -0,0 +1,27 @@
---
- name: Cloner un two_with_git
ansible.builtin.git:
repo: "https://{{ __git.__user }}:{{ __git.__token }}@{{ __git.__host }}/syonad/two_with_bash.git"
dest: "/opt/two_with_bash"
version: "main"
- name: Cron git pull two_with_git
ansible.builtin.cron:
name: "update_repo_two_with_git"
user: "root"
minute: "*/5"
job: "cd /opt/two_with_bash && git pull > /var/log/git-pull.log 2>&1"
- name: Cloner un two
ansible.builtin.git:
repo: "https://{{ __git.__user }}:{{ __git.__token }}@{{ __git.__host }}/syonad/two.git"
dest: "/opt/two"
version: "main"
- name: Cron git pull two
ansible.builtin.cron:
name: "update_repo_two"
user: "root"
minute: "*/5"
job: "cd /opt/two && git pull > /var/log/git-pull.log 2>&1"

View file

@ -1,51 +1,10 @@
---
- name: "Install packages"
apt:
name: "{{ item.key }}"
loop: "{{ __packages | dict2items }}"
- name: import packages
import_tasks: packages.yml
- name: Cloner un two_with_git
ansible.builtin.git:
repo: "https://{{ __git.__user }}:{{ __git.__token }}@{{ __git.__host }}/syonad/two_with_bash.git"
dest: "/opt/two_with_bash"
version: "main"
- name: import git
import_tasks: git.yml
- name: Cron git pull two_with_git
ansible.builtin.cron:
name: "update_repo_two_with_git"
user: "root"
minute: "*/5"
job: "cd /opt/two_with_bash && git pull > /var/log/git-pull.log 2>&1"
- name: Cloner un two
ansible.builtin.git:
repo: "https://{{ __git.__user }}:{{ __git.__token }}@{{ __git.__host }}/syonad/two.git"
dest: "/opt/two"
version: "main"
- name: Cron git pull two
ansible.builtin.cron:
name: "update_repo_two"
user: "root"
minute: "*/5"
job: "cd /opt/two && git pull > /var/log/git-pull.log 2>&1"
- name: disable and stop dnsmasq
ansible.builtin.systemd:
name: "dnsmasq.service"
enabled: False
state: "stopped"
masked: true
notify: systemctl daemon-reload
- name: deploy dnsmasq
ansible.builtin.template:
src: etc/systemd/system/dnsmasq.j2
dest: "/etc/systemd/system/dnsmasq@.service"
notify: systemctl daemon-reload
- name: deploy dnsmasq in netns
ansible.builtin.template:
src: usr/local/bin/run-dnsmasq-in-netns.sh.j2
dest: "/usr/local/bin/run-dnsmasq-in-netns.sh"
- name: import dnsmasq
import_tasks: dnsmasq.yml

6
tasks/packages.yml Normal file
View file

@ -0,0 +1,6 @@
---
- name: "Install packages"
apt:
name: "{{ item.key }}"
loop: "{{ __packages | dict2items }}"