none
ARM Template to create a puppet master server

    Question

  • Hi,

    Do we have example of ARM template to create a puppet master server in github

    Thanks

    Anita

    Thursday, December 10, 2015 11:16 AM

Answers

  • Hi anita,

    I just tried the mentioned template by myself and it worked. Here's what I did:

    1. I created a bash script (mycustomscript.sh) file containing my custom script
    2. I uploaded it to one of my Azure storage accounts and set the access level to "public read access for blobs". You can verify that this works by opening a browsers and try to navigate to the uploaded script file. If it is publicly accessible the browser will try to download the file (or display it in the browser window - depending on the browsers and type of content)
    3. Create a new instance using the mentioned ARM template. Here I use the URL of the uploaded script as the opetional parameter for the "FileUris" parameter (this parameter will tell the extension to download the specified files) and then I simply call my script by using "bash mycustomscript.sh" in the "commandtoexecute" parameter

    This perfectly worked on my side. The error message you posted seems to be result of some error within your custom script.

    BTW you have to option to log some data into a certain extension log file - this helps a lot when doing troubleshooting.

    In general, this blog article http://blog.fullscale180.com/format-data-disks-with-azure-vm-custom-script-extension-for-linux/ demonstrates how to use custom script extension for Linux VMs. The approach I described above is pretty much doing the same thing.... you might find this helpful. Plus you'll find some additional information where to find the log file I mentioned, etc.

    So that's what you might want to do when working with complex scripts. However, if you just want to check if the extension works, you can simply run the mentioned ARM template with the following parameters:

    • "commandtoexecute": echo "hello extension"
    • "FileUris": <don't use it - keep it blank>

    You can verify that your command has been executed by looking into the extension log file (I mentioned earlier) - you'll find "hello extension" string in the log file.

    --------------------------------------------
    P.S: If I was able to answer your question please markt this as an answer. This will help other forum members to quickly identify helpful guidance for similar issues.

    Monday, December 14, 2015 11:22 AM

All replies

  • Hi anita,
    in Azure ARM repository you'll find a template on how to deploy a VM with a puppet client (but no puppet server).

    However you have 2 options:
    1. Use ARM to create a vanilla VM and define/invoke a deployment script (which installs the puppet server) - something like this https://azure.microsoft.com/en-gb/documentation/templates/201-customscript-extension-public-storage-on-ubuntu/
    2. Use an existing Azure marketplace image (Puppet Enterprise like this https://azure.microsoft.com/en-us/marketplace/partners/puppetlabs/puppetenterprise37/) and follow this description to deploy this image programmatically (you need to check if this inmage supports this, though)

    Hope this helps!
    Best,Oliver

    Thursday, December 10, 2015 5:02 PM
  • Hi Oliver,

    Thanks for the response though it failed with this error when I tried to create the server using the template you provided

      https://azure.microsoft.com/en-gb/documentation/templates/201-customscript-extension-public-storage-on-ubuntu/

    Creating master resource in location North Europe in resourceGroupName PPTmasterGroup, please wait...

    cmdlet New-AzureRmResourceGroupDeployment at command pipeline position 1

    Supply values for the following parameters:

    (Type !? for Help.)


    New-AzureRmResourceGroupDeployment : 15:05:50 - Resource Microsoft.Compute/virtualMachines/extensions 'customscriptLinuxVM/installcustomscript' failed with

    message 'The resource operation completed with terminal provisioning state 'Failed'.'

    At C:\Users\AnitaK\myAzureResource\scripts\createCloud resource1.ps1:28 char:4

    +    New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGro ...

    +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception

        + FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.NewAzureResourceGroupDeploymentCommand

    New-AzureRmResourceGroupDeployment : 15:05:50 - VM has reported a failure when processing extension 'installcustomscript'. Error message: "Enable failed:

    <urlopen error [Errno -2] Name or service not known>".

    At C:\Users\AnitaK\myAzureResource\scripts\createCloud resource1.ps1:28 char:4

    +    New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGro ...

    +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception

        + FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.NewAzureResourceGroupDeploymentCommand

    Friday, December 11, 2015 3:25 PM
  • Hi anita,

    I just tried the mentioned template by myself and it worked. Here's what I did:

    1. I created a bash script (mycustomscript.sh) file containing my custom script
    2. I uploaded it to one of my Azure storage accounts and set the access level to "public read access for blobs". You can verify that this works by opening a browsers and try to navigate to the uploaded script file. If it is publicly accessible the browser will try to download the file (or display it in the browser window - depending on the browsers and type of content)
    3. Create a new instance using the mentioned ARM template. Here I use the URL of the uploaded script as the opetional parameter for the "FileUris" parameter (this parameter will tell the extension to download the specified files) and then I simply call my script by using "bash mycustomscript.sh" in the "commandtoexecute" parameter

    This perfectly worked on my side. The error message you posted seems to be result of some error within your custom script.

    BTW you have to option to log some data into a certain extension log file - this helps a lot when doing troubleshooting.

    In general, this blog article http://blog.fullscale180.com/format-data-disks-with-azure-vm-custom-script-extension-for-linux/ demonstrates how to use custom script extension for Linux VMs. The approach I described above is pretty much doing the same thing.... you might find this helpful. Plus you'll find some additional information where to find the log file I mentioned, etc.

    So that's what you might want to do when working with complex scripts. However, if you just want to check if the extension works, you can simply run the mentioned ARM template with the following parameters:

    • "commandtoexecute": echo "hello extension"
    • "FileUris": <don't use it - keep it blank>

    You can verify that your command has been executed by looking into the extension log file (I mentioned earlier) - you'll find "hello extension" string in the log file.

    --------------------------------------------
    P.S: If I was able to answer your question please markt this as an answer. This will help other forum members to quickly identify helpful guidance for similar issues.

    Monday, December 14, 2015 11:22 AM
  • Hi Anita,

    do you have an update whether you still have the issue you described above?! Or where you able to solve it? It any of the answers in this thread helped to solve you problem please mark them as "Answer" - this will help other forum members to quickly identify solutions for a particular problem.

    Thanks,Oliver

    Thursday, December 17, 2015 9:40 AM
  • For me, I had a similar issue where I was attempting to run a custom script on a Linux VM in Azure.

    the issue was that I was typing the wrong value for PrivateConfig's storageAccountName, I had incorrectly used an fqdn instead of just the storage account name.

    so for me the fix was to replace:

    $PrivateConf = '{
        "storageAccountName": "<storageAccountName>.blob.core.windows.net",
        "storageAccountKey": "<storageAccountKey>"
    }'

    with 

    $PrivateConf = '{
        "storageAccountName": "<storageAccountName>",
        "storageAccountKey": "<storageAccountKey>"
    }'


    Tuesday, March 15, 2016 8:05 AM