cloud-init team mailing list archive
-
cloud-init team
-
Mailing list archive
-
Message #00148
Re: Customize cloudinit to process a single yaml file
On Fri, Mar 30, 2018 at 1:13 PM, Ravi Parimi (parimi) <parimi@xxxxxxxxx> wrote:
>
> I would like to leverage cloud-init to configure networking etc. on my Centos VM running on VMware. My understanding is that cloud-init configuration
> for VM's running VMware should be packaged into an ISO or floppy that is attached to the VM (from slide 26 in https://people.redhat.com/mskinner/rhug/q3.2014/cloud-init.pdf)
>
> My environment doesn't allow access to either the cdrom or floppy device and hence I'd like to explore alternate ways of applying cloudinit config to my VM. Instead of enabling the cloud-init systemd service to run on boot, I want to simply call cloud-init manually to apply a pre-cooked config file that resides on the filesystem.
My understanding is that VMware instances use the DatasourceOVF which
does support reading ovf configuration from a file inside the image:
/var/lib/cloud/seed/ovf/ovf-env.xml
Alternatively, you can also use the NoCloud datasource[1] which uses
/var/lib/cloud/seed/nocloud-net/
>
> My specific question is this:
>
> If I save a cloud-config .yaml file on the filesystem, is there a way to ask cloud-init to process and apply it? From a cursory look of the command-line options and documentation, I don't see how this can be achieved.
There are a couple ways, it depends on what sort of config you want to apply.
For config modules, one way is:
cloud-init --file /path/to/cloud-config.yaml single --name
cc_<modulename> --frequency always
For network-configuration you really want cloud-init to run during
boot as it will read and render config
before the Os networking services start.
It's pretty straight-forward to use the NoCloud datasource for
networking configuration by placing
a 'network-config' file in the nocloud-net seed dir; the
network-config file format is network-config v1[2]
1. http://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
2. http://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v1.html#network-config-v1
>
> If the above isn't possible, are there any suggestions on how I can implement this solution?
>
> thanks
> --
> Mailing list: https://launchpad.net/~cloud-init
> Post to : cloud-init@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~cloud-init
> More help : https://help.launchpad.net/ListHelp
Follow ups
References