Omer Frenkel has uploaded a new change for review. Change subject: core: fix cloud-init userData content ......................................................................
core: fix cloud-init userData content some changes needed to comply with cloud-init userData requirements: * add needed #cloud-config header to userData file: this fix all commands sent in userData like timezone and cloud-init configuration settings * move password from metaData to userData root password parameter should be in userData, and not in metaData. Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1004829 Change-Id: I4642aaf1d9349ebbe82b7c77e562ad5ca19ca3ee Signed-off-by: Omer Frenkel <ofren...@redhat.com> --- M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/CloudInitHandler.java 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/68/21268/1 diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/CloudInitHandler.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/CloudInitHandler.java index f9972aa..e31dca0 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/CloudInitHandler.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/CloudInitHandler.java @@ -76,6 +76,11 @@ String metaDataStr = mapToJson(metaData); String userDataStr = mapToYaml(userData); + // add #cloud-config for user data file head + if (StringUtils.isNotBlank(userDataStr)) { + userDataStr = "#cloud-config\n" + userDataStr; + } + files.put("openstack/latest/meta_data.json", metaDataStr.getBytes("UTF-8")); files.put("openstack/latest/user_data", userDataStr.getBytes("UTF-8")); @@ -200,7 +205,7 @@ private void storeRootPassword() { if (!StringUtils.isEmpty(params.getRootPassword())) { // Note that this is in plain text in the config disk - metaData.put(passwordKey, params.getRootPassword()); + userData.put(passwordKey, params.getRootPassword()); } } -- To view, visit http://gerrit.ovirt.org/21268 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4642aaf1d9349ebbe82b7c77e562ad5ca19ca3ee Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.3 Gerrit-Owner: Omer Frenkel <ofren...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches