chore: first commit

This commit is contained in:
Clément Désiles
2025-07-25 20:23:54 +02:00
parent 5c4016357f
commit c612cc7839
88 changed files with 3255 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
# Networking
This role configures the networking on the target machine.
## Requirements
Roles:
- net-persist
- net-config
## Inventory Variables
| Name | Description | Required |
| ------------------ | ----------------------------------------------- | -------- |
| network.interfaces | A dictionary of network interfaces to configure | yes |
Example:
```yaml
network:
interfaces:
lan0:
mac_address: 02:a0:c9:8d:7e:b6
ip: 192.168.1.2
netmask: 255.255.255.0
gateway: 192.168.1.254
dns:
- 1.1.1.1
- 8.8.8.8
lan1:
mac_address: 0a:3f:5b:1c:d2:e4
```
## License
MIT
## Author Information
Jokester <main@jokester.fr>
+18
View File
@@ -0,0 +1,18 @@
---
galaxy_info:
author: Jokester <main@jokester.fr>
description: Meta role to configure the network
license: MIT
min_ansible_version: "2.10"
galaxy_tags:
- network
- linux
- debian
- archlinux
platforms:
- name: Debian
versions:
- all
- name: ArchLinux
versions:
- all
+31
View File
@@ -0,0 +1,31 @@
---
- name: "Setup persistent network interface(s)"
include_role:
name: net-persist
public: yes
vars:
interface: "{{ item }}"
loop: "{{ hostvars[inventory_hostname].network_interfaces | default([]) }}"
- name: "Configure network interface(s)"
include_role:
name: net-config
public: yes
vars:
interface: "{{ item }}"
loop: "{{ hostvars[inventory_hostname].network_interfaces | default([]) }}"
- name: Reload networkd and resolved
systemd:
name: "{{ item }}"
state: reloaded
daemon_reload: yes
loop:
- systemd-networkd
- systemd-resolved
when: reboot_required is false and network_reload_required is true
- name: Reboot the machine
when: reboot_required is true
ansible.builtin.reboot:
reboot_timeout: 60