feat: initial commit — Ansible roles storage-01/gpu-01 opérationnels

This commit is contained in:
alkatrazz 2026-05-12 17:17:03 +02:00
commit b3fce8af5d
70 changed files with 2688 additions and 0 deletions

View file

@ -0,0 +1,16 @@
---
dns_upstream:
- 8.8.8.8
- 8.8.4.4
dns_cluster_hosts:
- name: storage-01
ip: 192.168.10.1
- name: gpu-01
ip: 192.168.10.20
- name: compute-01
ip: 192.168.10.11
- name: compute-02
ip: 192.168.10.12
- name: compute-03
ip: 192.168.10.13

View file

@ -0,0 +1,9 @@
---
- name: Restart dnsmasq
ansible.builtin.systemd:
name: dnsmasq
state: restarted
- name: Reload systemd
ansible.builtin.systemd:
daemon_reload: true

View file

@ -0,0 +1,29 @@
---
- name: Install dnsmasq
ansible.builtin.dnf:
name: dnsmasq
state: present
- name: Deploy dnsmasq config
ansible.builtin.template:
src: dnsmasq.conf.j2
dest: /etc/dnsmasq.conf
mode: '0644'
notify: Restart dnsmasq
- name: Deploy dnsmasq systemd override (wait for USB ethernet)
ansible.builtin.copy:
dest: /etc/systemd/system/dnsmasq.service.d/wait-for-network.conf
content: |
[Unit]
After=network-online.target
Wants=network-online.target
mode: '0644'
notify: Reload systemd
- name: Enable and start dnsmasq
ansible.builtin.systemd:
name: dnsmasq
enabled: true
daemon_reload: true
state: started

View file

@ -0,0 +1,31 @@
# Géré par Ansible — ne pas modifier manuellement
# Écoute uniquement sur le LAN cluster
interface={{ lan_interface }}
bind-interfaces
# Domaine local
domain={{ dns_domain }}
local=/{{ dns_domain }}/
expand-hosts
# Ne pas lire /etc/resolv.conf pour les upstream
no-resolv
# Upstream DNS pour tout ce qui n'est pas lab.local
{% for server in dns_upstream %}
server={{ server }}
{% endfor %}
# Enregistrements statiques des machines du cluster
{% for host in dns_cluster_hosts %}
address=/{{ host.name }}.{{ dns_domain }}/{{ host.ip }}
address=/{{ host.name }}/{{ host.ip }}
{% endfor %}
# Cache
cache-size=1000
# Logs (désactiver en prod si trop verbeux)
log-queries
log-facility=/var/log/dnsmasq.log