Skip to content

Commit

Permalink
feat: configure hl01 static ipv4 address
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrarimarco committed Jun 3, 2024
1 parent fd0ba7a commit f708b8b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ is_proxmox_node: true
proxmox_vms:
- hostname: hl01
default_network_interface_mac_address: "bc:24:11:d4:f6:64"
default_network_interface_name: eth0
...
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
become: true
vars:
cloud_init_instance_mac_address: "{{ item.default_network_interface_mac_address }}"
cloud_init_network_interface_addresses: [ "{{ todo }}" ]

Check failure on line 30 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

30:46 [brackets] too many spaces inside brackets

Check failure on line 30 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

30:59 [brackets] too many spaces inside brackets

Check failure on line 30 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

30:46 [brackets] too many spaces inside brackets

Check failure on line 30 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

30:59 [brackets] too many spaces inside brackets
cloud_init_network_interface_default_ipv4_gateway: "{{ todo }}"
cloud_init_network_interface_dns_addresses: [ "{{ todo }}" ]

Check failure on line 32 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

32:50 [brackets] too many spaces inside brackets

Check failure on line 32 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

32:63 [brackets] too many spaces inside brackets

Check failure on line 32 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

32:50 [brackets] too many spaces inside brackets

Check failure on line 32 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

32:63 [brackets] too many spaces inside brackets
cloud_init_network_interface_name: "{{ item.default_network_interface_name }}"
cloud_init_network_interface_search: [ "{{ todo }}" ]

Check failure on line 34 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

34:43 [brackets] too many spaces inside brackets

Check failure on line 34 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

34:56 [brackets] too many spaces inside brackets

Check failure on line 34 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

34:43 [brackets] too many spaces inside brackets

Check failure on line 34 in config/ansible/roles/ferrarimarco_home_lab_proxmox/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / pre_commit

34:56 [brackets] too many spaces inside brackets
with_items: "{{ proxmox_vms | default([]) }}"

- name: Render cloud-init user-data snippets
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
---
# Ref: https://cloudinit.readthedocs.io/en/latest/reference/network-config-format-v2.html
network:
version: 2
ethernets:
eth0:
dhcp4: true
dhcp4-overrides:
use-domains: true
{{ cloud_init_network_interface_name }}:
addresses:
nameservers: {{ cloud_init_network_interface_addresses }}
addresses: {{ cloud_init_network_interface_dns_addresses }}
search: {{ cloud_init_network_interface_search }}
match:
macaddress: {{ cloud_init_instance_mac_address }}
set-name: eth0
routes:
- to: 0.0.0.0/0
via: {{ cloud_init_network_interface_default_ipv4_gateway }}
set-name: {{ cloud_init_network_interface_name }}
...

0 comments on commit f708b8b

Please sign in to comment.