project-lakitu: enable set_passwords modules in cloud-init
BUG=b/180626914
TEST=manual verification and presubmit
RELEASE_NOTE=None
Change-Id: I8dd99cc628489662254f6259bb7da7928b25db3f
Reviewed-on: https://cos-review.googlesource.com/c/cos/overlays/board-overlays/+/14352
Reviewed-by: Varsha Teratipally <teratipally@google.com>
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
diff --git a/project-lakitu/app-emulation/cloud-init-config/cloud-init-config-1.0.0.ebuild b/project-lakitu/app-emulation/cloud-init-config/cloud-init-config-1.0.0.ebuild
index 54f33a2..80dc656 100644
--- a/project-lakitu/app-emulation/cloud-init-config/cloud-init-config-1.0.0.ebuild
+++ b/project-lakitu/app-emulation/cloud-init-config/cloud-init-config-1.0.0.ebuild
@@ -26,6 +26,8 @@
insinto /etc/cloud
if use platform_azure; then
doins "${FILESDIR}"/azure/cloud.cfg
+ elif use platform_vsphere; then
+ doins "${FILESDIR}"/vsphere/cloud.cfg
else
doins "${FILESDIR}"/cloud.cfg
fi
diff --git a/project-lakitu/app-emulation/cloud-init-config/files/vsphere/cloud.cfg b/project-lakitu/app-emulation/cloud-init-config/files/vsphere/cloud.cfg
new file mode 100644
index 0000000..742f1f6
--- /dev/null
+++ b/project-lakitu/app-emulation/cloud-init-config/files/vsphere/cloud.cfg
@@ -0,0 +1,65 @@
+# The top level settings are used as module
+# and system configuration.
+
+# If this is set, 'root' will not be able to ssh in and they
+# will get a message to login instead as the above $user (ubuntu)
+disable_root: true
+
+# This will cause the set+update hostname module to not operate (if true)
+preserve_hostname: true
+
+# Example datasource config
+# datasource:
+# Ec2:
+# metadata_urls: [ 'blah.com' ]
+# timeout: 5 # (defaults to 50 seconds)
+# max_wait: 10 # (defaults to 120 seconds)
+
+# Disable network-config because Lakitu doesn't support any network renders
+# of cloud-init (eni, netplan, sysconfig).
+network:
+ config: disabled
+
+# Lakitu specific: Lakitu has a "stateless" cloud-init, so the following modules
+# are all executed upon reboot. Therefore, the concept of module run frequency
+# in lakitu is different from Ubuntu. There are only two run frequencies "always"
+# and "once" in lakitu. If we rerun cloud-init without rebooting the instance,
+# modules with "always" frequency will be rerun, while modules with "once"
+# frequency will not.
+
+# The modules that run in the 'init' stage
+cloud_init_modules:
+ - [bootcmd, once]
+ - [update_etc_hosts, always]
+ - [users-groups, once]
+ - [write-files, always]
+ - [ssh, once]
+
+# The modules that run in the 'config' stage
+cloud_config_modules:
+ - [mounts, once]
+ - [ssh-import-id, once]
+ - [timezone, once]
+ - [disable-ec2-metadata, always]
+ - [runcmd, always]
+ - [set-passwords, once]
+
+# The modules that run in the 'final' stage
+cloud_final_modules:
+ - [rightscale_userdata, once]
+ - [scripts-vendor, once]
+ - [scripts-per-once, once]
+ - [scripts-per-boot, once]
+ - [scripts-per-instance, once]
+ - [scripts-user, always]
+ - [ssh-authkey-fingerprints, once]
+ - [keys-to-console, once]
+ - [phone-home, once]
+ - [final-message, always]
+
+# System and/or distro specific settings
+# (not accessible to handlers/transforms)
+system_info:
+ paths:
+ cloud_dir: /var/lib/cloud/
+ templates_dir: /etc/cloud/templates/