Ubuntu user on custom image

How can I set the nocloud datasource?

I tried the following option with NoCloud in the cloud-config, but this didn’t work out either:

#cloud-config
debug:
  verbose: true
NoCloud:
  seedfrom: None
  user-data: None
snap:
...

Should the nocloud setting be in another file?
Like in this post https://gist.github.com/Informatic/0b6b24374b54d09c77b9d25595cdbd47:

meta-data:
dsmode: local

Where do I have to put the meta-data file in the image?