Discussion:
[PVE-User] Add runcmd and custom parameters in Cloudinit
José Manuel Giner
2018-06-23 12:32:09 UTC
Permalink
Hello friends,

Would there be any possibility of adding custom options to the cloudinit?

We would like to customize the ssh configuration values, to allow SSH
access as it is done in OpenVZ or LXC, for example:

Port 2222
PermitRootLogin yes
PasswordAuthentication yes

One option would be to execute a command on the first boot with the
"runcmd:" parameter. Only with this we can begin to customize the system
to our liking in an easy way.

What would be the way to do it?

Thank you!
--
José Manuel Giner
http://ginernet.com
Dietmar Maurer
2018-06-23 14:48:06 UTC
Permalink
Post by José Manuel Giner
What would be the way to do it?
You can customize the template instead.
José Manuel Giner
2018-06-23 16:25:24 UTC
Permalink
Hello Dietmar,

thanks for answering. If I understand correctly, you propose to make a
customized installation of the operating system and then install
cloudinit and convert it to template.

But this approach is much more complicated to manage over the time. If
we want to provide more specific software, you must create a template
for each of them.

It does not make much sense to have 10 or 20 templates of Ubuntu 18.04,
when we can have only 1 and configure it in the first boot with a single
command that allows you to execute your own script that applies the
configuration you want. I understand that this is the great advantage of
Cloudinit.

For example, if I want to provide an installation with cPanel, within 3
months when cPanel pulls out a new version I would have to prepare a new
template and repeat the same job every 3 months, however if I could
execute a script on the first startup it would be valid regardless of
when it is run as it would always provide an installation of the latest
version of cPanel available.

In the same way that the SSH key can be added in a very simple way with
the interface, a key in each line, the parameter runcmd could be added
with a command in each line. That's why I think it's simple to develop.

Or am I forgetting something?

Thanks!
Post by Dietmar Maurer
Post by José Manuel Giner
What would be the way to do it?
You can customize the template instead.
--
José Manuel Giner
http://ginernet.com
Dietmar Maurer
2018-06-23 16:41:56 UTC
Permalink
Post by José Manuel Giner
Hello Dietmar,
thanks for answering. If I understand correctly, you propose to make a
customized installation of the operating system and then install
cloudinit and convert it to template.
But this approach is much more complicated to manage over the time. If
we want to provide more specific software, you must create a template
for each of them.
It does not make much sense to have 10 or 20 templates of Ubuntu 18.04,
I also does not make much sense to change ssh port to 2222 ...

Anyways, the current approach does not allow you to configure such values.
José Manuel Giner
2018-06-23 17:27:50 UTC
Permalink
Hello Dietmar,

those were example values. I just wanted to explain a more specific
situation, but the possibilities are much wider, each user may need it
for very different cases.

The goal is to be able to run include the runcmd parameter in cloudinit.

Thank you.
Post by Dietmar Maurer
Post by José Manuel Giner
Hello Dietmar,
thanks for answering. If I understand correctly, you propose to make a
customized installation of the operating system and then install
cloudinit and convert it to template.
But this approach is much more complicated to manage over the time. If
we want to provide more specific software, you must create a template
for each of them.
It does not make much sense to have 10 or 20 templates of Ubuntu 18.04,
I also does not make much sense to change ssh port to 2222 ...
Anyways, the current approach does not allow you to configure such values.
--
José Manuel Giner
http://ginernet.com
Loading...