From 6d31dc158430b914bdb8fbee958e0306d7fe16c5 Mon Sep 17 00:00:00 2001 From: trigkeyb Date: Sat, 1 Feb 2025 17:33:01 +0100 Subject: [PATCH] rescritura netplan --- clonar/0.crea_VM.sh | 2 +- clonar/50-cloud-init.yaml | 10 ++++++++++ clonar/genera_yaml_k8s.sh | 13 +++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 clonar/50-cloud-init.yaml diff --git a/clonar/0.crea_VM.sh b/clonar/0.crea_VM.sh index 40a99ba..93819cd 100755 --- a/clonar/0.crea_VM.sh +++ b/clonar/0.crea_VM.sh @@ -1,6 +1,6 @@ # Crea variables # ID de VM -VMID="919200" +VMID="920000" # lugar de almacenamiento para el disco ### VMSTORAGE="VMs_storage-E" diff --git a/clonar/50-cloud-init.yaml b/clonar/50-cloud-init.yaml new file mode 100644 index 0000000..f79adb9 --- /dev/null +++ b/clonar/50-cloud-init.yaml @@ -0,0 +1,10 @@ +network: + version: 2 + renderer: networkd + ethernets: + default: + match: + name: e* + dhcp4: yes + dhcp-identifier: mac + \ No newline at end of file diff --git a/clonar/genera_yaml_k8s.sh b/clonar/genera_yaml_k8s.sh index c26d9a7..52a1936 100755 --- a/clonar/genera_yaml_k8s.sh +++ b/clonar/genera_yaml_k8s.sh @@ -27,6 +27,19 @@ ssh_pwauth: true hostname: $VMHOST manage_etc_hosts: true fqdn: $VMHOST +write_files: + - path: /etc/netplan/50-cloud-init.yaml + content: | + network: + version: 2 + renderer: networkd + ethernets: + default: + match: + name: e* + dhcp4: yes + dhcp-identifier: mac + runcmd: - cd /root - git clone https://git.lfgut.duckdns.org/luis/infra_cloudinit.git