Skip to content

Instantly share code, notes, and snippets.

@nhernandezga-old
Forked from Informatic/README.md
Created June 15, 2019 08:12
Show Gist options
  • Save nhernandezga-old/e1af39ba6066c39072799bf659870e40 to your computer and use it in GitHub Desktop.
Save nhernandezga-old/e1af39ba6066c39072799bf659870e40 to your computer and use it in GitHub Desktop.
cloud-init "nocloud" networking setup

cloud-init is absolute cancer. Its code is horrible. It has no documentation at all.

It took me 5 fucking hours to figure out how to properly configure networking on recent cloud-init (Ubuntu 16.04 cloud image) with local datasource.

It's not mentioned anywhere you need to provide dsmode: local. (but only if you need network-config, besides that everything is fine; someone below noted that -m flag does the same thing, good to know) Of course nobody needs documentation for network-config format either. (cloudinit/net/__init__.py is a protip, enjoy the feces dive)

Oh, and by the way - no, it's not possible to provide network-config to uvt-kvm without patching shit.

Use -N flag for cloud-localds for network-config.

dsmode: local
# ↑ THIS. SHIT.
---
version: 1
config:
- type: physical
name: ens3
subnets:
- control: auto
type: static
address: |
192.168.21.37
pre-up echo xD > /tmp/yesitsthereyo # quality configuration injection, real thing
#cloud-config
chpasswd:
list: |
root:password
expire: False
write_files:
- content: |
You don't really need that, just a bloody test.
path: /root/test.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment