-
Notifications
You must be signed in to change notification settings - Fork 436
[Draft] Try to address the cloudbase init running order #1719
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export AZURE_LOCATION="uksouth" | ||
export AZURE_CLIENT_ID="aa0caef4-31da-4426-9908-f75af27075c8" | ||
export AZURE_SUBSCRIPTION_ID="1c8c4edc-b188-4199-9580-3173033d75f7" | ||
export USE_AZURE_CLI_AUTH=true | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,11 +43,9 @@ | |
src: templates/cloudbase-init.conf | ||
dest: "{{ programfiles.stdout | trim }}\\Cloudbase Solutions\\Cloudbase-Init\\conf\\cloudbase-init.conf" | ||
|
||
- name: Configure set up complete | ||
- name: Configure Cloudbase-Init to run on startup | ||
ansible.windows.win_shell: | | ||
# If this file already exists then the following command fails | ||
Remove-Item -Force {{ systemdrive.stdout | trim }}\Windows\Setup\Scripts\SetupComplete.cmd | ||
& "{{ programfiles.stdout | trim }}\Cloudbase Solutions\Cloudbase-Init\bin\SetSetupComplete.cmd" | ||
cmd /c sc config cloudbase-init depend= WindowsAzureGuestAgent start= auto | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whats the impact of this on non-Azure systems or providers? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc: @laozc |
||
become: true | ||
become_method: runas | ||
become_user: System |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,15 +25,17 @@ if( Test-Path $Env:SystemRoot\system32\Sysprep\unattend.xml ) { | |
Remove-Item $Env:SystemRoot\system32\Sysprep\unattend.xml -Force | ||
} | ||
|
||
$unattendedXml = "$ENV:ProgramFiles\Cloudbase Solutions\Cloudbase-Init\conf\Unattend.xml" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removal of this might break things. Might want to confirm this change |
||
$FileExists = Test-Path $unattendedXml | ||
If ($FileExists -eq $True) { | ||
# Use the Cloudbase-init provided unattend file during install | ||
Write-Output "Using cloudbase-init unattend file for sysprep: $unattendedXml" | ||
& $Env:SystemRoot\System32\Sysprep\Sysprep.exe /oobe /generalize /mode:vm /quit /quiet /unattend:$unattendedXml | ||
}else { | ||
& $Env:SystemRoot\System32\Sysprep\Sysprep.exe /oobe /generalize /mode:vm /quit /quiet | ||
} | ||
& $Env:SystemRoot\System32\Sysprep\Sysprep.exe /oobe /generalize /mode:vm /quit /quiet | ||
|
||
# $unattendedXml = "$ENV:ProgramFiles\Cloudbase Solutions\Cloudbase-Init\conf\Unattend.xml" | ||
# $FileExists = Test-Path $unattendedXml | ||
# If ($FileExists -eq $True) { | ||
# # Use the Cloudbase-init provided unattend file during install | ||
# Write-Output "Using cloudbase-init unattend file for sysprep: $unattendedXml" | ||
# & $Env:SystemRoot\System32\Sysprep\Sysprep.exe /oobe /generalize /mode:vm /quit /quiet /unattend:$unattendedXml | ||
# }else { | ||
# & $Env:SystemRoot\System32\Sysprep\Sysprep.exe /oobe /generalize /mode:vm /quit /quiet | ||
# } | ||
|
||
# Wait for the image to be reset | ||
while($true) { | ||
|
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.
you prob want to remove this file from the draft :)
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.
+1