Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: configure hl01 static ipv4 address #1359

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ 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 }}" ]
cloud_init_network_interface_default_ipv4_gateway: "{{ todo }}"
cloud_init_network_interface_dns_addresses: [ "{{ todo }}" ]
cloud_init_network_interface_name: "{{ item.default_network_interface_name }}"
cloud_init_network_interface_search: [ "{{ todo }}" ]
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 }}
...
Loading