-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Windows 2019/2022 to OCI capi provider image builder #1051
Add support for Windows 2019/2022 to OCI capi provider image builder #1051
Conversation
Skipping CI for Draft Pull Request. |
e138a87
to
1150d54
Compare
1150d54
to
3914053
Compare
/assign |
- name: Set up cloudbase-init-oci configuration | ||
win_template: | ||
src: templates/cloudbase-init-oci.conf | ||
dest: '{{ programfiles.stdout | trim }}\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between these? most configuration should be configurable through cloudbase_metadata_services
and cloudbase_plugins
I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw I could modify the cloudbase_plugins
but it appeared to only be addition, I couldn't figure out how to remove plugins OCI doesn't support https://github.com/kubernetes-sigs/image-builder/blob/master/images/capi/ansible/windows/roles/cloudbase-init/templates/cloudbase-init.conf#L35.
The OCI template removes
cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,
cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,
cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be better to move these out of the base template to avoid duplicating this file as much as we can. what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved all the plugins to their respective packer-windows.json
files and reduced the amount of default cloudbase_plugins
in the cloudbase-init.conf
file.
3914053
to
e445cba
Compare
/retest |
e445cba
to
02d6674
Compare
centos failed when updating with yum. I don't know much about yum and centos, would a retry to this command help flakes?
/retest |
02d6674
to
325c8fb
Compare
I had to push a change. After removing |
/retest |
|
||
echo "Changing Password in winrm_bootstrap.txt" | ||
|
||
sed "s/(\[adsi\].*/([adsi](\"WinNT:\/\/\"+\$opcUser.caption).replace(\"\\\\\",\"\/\")).SetPassword(\"$OPC_USER_PASSWORD\")/g" packer/oci/scripts/winrm_bootstrap.txt | tee packer/oci/scripts/winrm_bootstrap.txt >/dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to leave the password in a file as plain text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will modify the password set in the winrm_bootstrap.txt
to be set a launch. From my understanding I need to set a password at launch as our image process sets the password to automatically reset on launch and it won't be known.
Here is an old example related issue: hashicorp/packer#7033 (comment)
I'm not sure how to use the ENV
to set the value in winrm_bootstrap.txt
without saving it to the file for launch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this password is only used during bootstrapping but the password when a new image is created will be generated? If that is the case can we make a comment so that we know we are not leaking passwords in plain text here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated how this works now. When the image is built we temporarily set the password to the user provided password, when the image create the file containing the provided password is deleted. I've also updated the book to call that out.
/retest |
325c8fb
to
25eba9c
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: joekr, jsturtevant The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Adds support to build windows images to using with CAPOCI provider using cluster-api.
Which issue(s) this PR fixes (optional, in fixes #(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): No open issues
Additional context
the
oci_iad_windows_bm.json
file contentsBuild logs