-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
[WIP] Initial Work to create AzureRM Extensions #6548
Conversation
Basic creation and deletion is currently done.
The trouble we have right now is the
Settings needs to have the following JSON structure:
So the fileUris list needs to be created as part of the map.. USeful link for creation: https://azure.microsoft.com/en-us/blog/automate-linux-vm-customization-tasks-using-customscript-extension/ |
@stack72 This feature would be perfect for our use case. If you need anyone to test, just let me know. |
@stack72 I got to spend some time playing with this feature today. Seems very useful to us AzureRM people. I ended up using version 1.4 of the customScriptForLinux (type_handler_version = "1.4") I got the commandToExecute to work well. Did you get to the point where you could set an array of file_uris? Thanks |
oh you have tried this branch? |
I did, hope that is ok. |
that's brilliant that it sort of worked for you :) I will get the fileUrls working - I have some issues to fix first due to their SDK api for that part :( |
So I am not that familiar with Azure VMs. What sources would you use for a file uri here? Can I just put a simple bash script into a github gist and use that? P. |
You are correct. That would work. We currently upload to a storage account in azure then link from there with our powershell scripts. |
and for that scenario you would need private_settings declared as well right? |
Currently we are not using the SA name and key (if this is what private_setting is). We just set the files to Blob (which makes them accessible from a public url) |
@stack72 Any updates on when this PR will be completed? Thanks! |
ok, after looking into this more, there is no way that this is easily achieved with Terraform. The Extension schema is very specific to each extension type. The work here is only for CustomExtensions. We can continue down that path if we want to but this will then only work for that type There are many different types: https://acom-swtest-2.azurewebsites.net/en-gb/documentation/articles/virtual-machines-extensions-configuration-samples-linux/ @jen20 would love your thoughts here P |
I guess we should support some of the ones that seem useful (on a case-by-case basis) on that page and the custom one that is part of this PR. I don't know offhand what is useful though! |
@stack72 I have been adding extensions to my vms using azurerm_template_deployment after the vm has been created but this seems pretty hacky. You linked to VM extensions from Linux. For what is worth these extensions are really useful for windows vms as well. I mostly use the DSC one myself to bootstrap the vm configuration. Also if there is a plan for vm extensions would this include adding extensions to vm scale sets? |
Hi all I am going to close this out. I am not getting time right now to circle back to it but i know that @tombuildsstuff is looking at this :) P. |
Picked up from where hashicorp#6548 left off settings and protected_settings take JSON objects as strings to make extension generic TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m === RUN TestAccAzureRMVirtualMachineExtension_importBasic --- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (810.44s) === RUN TestAccAzureRMVirtualMachineExtension_basic --- PASS: TestAccAzureRMVirtualMachineExtension_basic (839.55s) === RUN TestAccAzureRMVirtualMachineExtension_concurrent --- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (689.69s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 2339.695s
Picked up from where hashicorp#6548 left off settings and protected_settings take JSON objects as strings to make extension generic TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m === RUN TestAccAzureRMVirtualMachineExtension_importBasic --- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (810.44s) === RUN TestAccAzureRMVirtualMachineExtension_basic --- PASS: TestAccAzureRMVirtualMachineExtension_basic (839.55s) === RUN TestAccAzureRMVirtualMachineExtension_concurrent --- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (689.69s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 2339.695s
Picked up from where hashicorp#6548 left off settings and protected_settings take JSON objects as strings to make extension generic TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m === RUN TestAccAzureRMVirtualMachineExtension_importBasic --- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (810.44s) === RUN TestAccAzureRMVirtualMachineExtension_basic --- PASS: TestAccAzureRMVirtualMachineExtension_basic (839.55s) === RUN TestAccAzureRMVirtualMachineExtension_concurrent --- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (689.69s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 2339.695s
Picked up from where hashicorp#6548 left off settings and protected_settings take JSON objects as strings to make extension generic TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m === RUN TestAccAzureRMVirtualMachineExtension_importBasic --- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (697.55s) === RUN TestAccAzureRMVirtualMachineExtension_basic --- PASS: TestAccAzureRMVirtualMachineExtension_basic (824.17s) === RUN TestAccAzureRMVirtualMachineExtension_concurrent --- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (929.74s) === RUN TestAccAzureRMVirtualMachineExtension_linuxDiagnostics --- PASS: TestAccAzureRMVirtualMachineExtension_linuxDiagnostics (803.19s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 3254.663s
Picked up from where #6548 left off settings and protected_settings take JSON objects as strings to make extension generic TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m === RUN TestAccAzureRMVirtualMachineExtension_importBasic --- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (697.55s) === RUN TestAccAzureRMVirtualMachineExtension_basic --- PASS: TestAccAzureRMVirtualMachineExtension_basic (824.17s) === RUN TestAccAzureRMVirtualMachineExtension_concurrent --- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (929.74s) === RUN TestAccAzureRMVirtualMachineExtension_linuxDiagnostics --- PASS: TestAccAzureRMVirtualMachineExtension_linuxDiagnostics (803.19s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 3254.663s
Picked up from where #6548 left off settings and protected_settings take JSON objects as strings to make extension generic TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m === RUN TestAccAzureRMVirtualMachineExtension_importBasic --- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (697.55s) === RUN TestAccAzureRMVirtualMachineExtension_basic --- PASS: TestAccAzureRMVirtualMachineExtension_basic (824.17s) === RUN TestAccAzureRMVirtualMachineExtension_concurrent --- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (929.74s) === RUN TestAccAzureRMVirtualMachineExtension_linuxDiagnostics --- PASS: TestAccAzureRMVirtualMachineExtension_linuxDiagnostics (803.19s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 3254.663s
) Picked up from where hashicorp#6548 left off settings and protected_settings take JSON objects as strings to make extension generic TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachineExtension" -timeout 120m === RUN TestAccAzureRMVirtualMachineExtension_importBasic --- PASS: TestAccAzureRMVirtualMachineExtension_importBasic (697.55s) === RUN TestAccAzureRMVirtualMachineExtension_basic --- PASS: TestAccAzureRMVirtualMachineExtension_basic (824.17s) === RUN TestAccAzureRMVirtualMachineExtension_concurrent --- PASS: TestAccAzureRMVirtualMachineExtension_concurrent (929.74s) === RUN TestAccAzureRMVirtualMachineExtension_linuxDiagnostics --- PASS: TestAccAzureRMVirtualMachineExtension_linuxDiagnostics (803.19s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 3254.663s
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Work to allow AzureRM Extensions (for things like joining a domain)