@Megan - Could you please elaborate.

My requirement is to change the winrm_username between running 2 
provisioners and the user_data_file runs only once when the instance starts.

On Friday, 18 May 2018 10:29:18 UTC-6, Megan Marsh wrote:
>
> Alternatively, you can make the change in the script that you send in as 
> your "user_data_file", before you run any provisioners.
>
> On Thu, May 17, 2018 at 1:17 PM, Rickard von Essen <[email protected] 
> <javascript:>> wrote:
>
>> That is not currently possible.
>>
>> I think the only solution is to deley the change to the end. 
>>
>> On Thu, May 17, 2018, 22:03 Sayantan Choudhury <[email protected] 
>> <javascript:>> wrote:
>>
>>> Hi,
>>>
>>> I have a requirement where I need to build a Windows AMI in AWS and as 
>>> per CIS recommendations, I need to rename the default windows Administrator 
>>> username. I have multiple powershell provisioners in my build template and 
>>> in one of the provisioners, I am changing the default windows Administrator 
>>> username. I also have a requirement that I need to run provisioners after 
>>> changing the default windows Administrator username. I am using winrm to 
>>> connect to the EC2 machine and from the start, I am using the default 
>>> windows Administrator username to connect.
>>>
>>> After I change the default windows Administrator username, I need to 
>>> somehow change the username to the new one. I was trying to use 
>>> https://www.packer.io/docs/templates/provisioners.html#build-specific-overrides
>>>  
>>> to override the "winrm_username" parameter, but that does not seem to work. 
>>> Error: "* unknown configuration key: "winrm_username"". Same with any other 
>>> configuration key that I use.
>>>
>>> Please suggest if there is any other way to meet my requirements.
>>>
>>> -- 
>>> This mailing list is governed under the HashiCorp Community Guidelines - 
>>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>>> violation of those guidelines may result in your removal from this mailing 
>>> list.
>>>  
>>> GitHub Issues: https://github.com/mitchellh/packer/issues
>>> IRC: #packer-tool on Freenode
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Packer" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected] <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/packer-tool/1cc25d83-8c4d-45e8-9312-4c7fa46bb7ed%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/packer-tool/1cc25d83-8c4d-45e8-9312-4c7fa46bb7ed%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation of those guidelines may result in your removal from this mailing 
>> list.
>>  
>> GitHub Issues: https://github.com/mitchellh/packer/issues
>> IRC: #packer-tool on Freenode
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Packer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/CALz9Rt-uYW48F%3Dw9Dnp%2Bo3K05wesj5oSr6h-aqy2kjxTpNEDWw%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt-uYW48F%3Dw9Dnp%2Bo3K05wesj5oSr6h-aqy2kjxTpNEDWw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
On Friday, 18 May 2018 10:29:18 UTC-6, Megan Marsh wrote:
>
> Alternatively, you can make the change in the script that you send in as 
> your "user_data_file", before you run any provisioners.
>
> On Thu, May 17, 2018 at 1:17 PM, Rickard von Essen <[email protected] 
> <javascript:>> wrote:
>
>> That is not currently possible.
>>
>> I think the only solution is to deley the change to the end. 
>>
>> On Thu, May 17, 2018, 22:03 Sayantan Choudhury <[email protected] 
>> <javascript:>> wrote:
>>
>>> Hi,
>>>
>>> I have a requirement where I need to build a Windows AMI in AWS and as 
>>> per CIS recommendations, I need to rename the default windows Administrator 
>>> username. I have multiple powershell provisioners in my build template and 
>>> in one of the provisioners, I am changing the default windows Administrator 
>>> username. I also have a requirement that I need to run provisioners after 
>>> changing the default windows Administrator username. I am using winrm to 
>>> connect to the EC2 machine and from the start, I am using the default 
>>> windows Administrator username to connect.
>>>
>>> After I change the default windows Administrator username, I need to 
>>> somehow change the username to the new one. I was trying to use 
>>> https://www.packer.io/docs/templates/provisioners.html#build-specific-overrides
>>>  
>>> to override the "winrm_username" parameter, but that does not seem to work. 
>>> Error: "* unknown configuration key: "winrm_username"". Same with any other 
>>> configuration key that I use.
>>>
>>> Please suggest if there is any other way to meet my requirements.
>>>
>>> -- 
>>> This mailing list is governed under the HashiCorp Community Guidelines - 
>>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>>> violation of those guidelines may result in your removal from this mailing 
>>> list.
>>>  
>>> GitHub Issues: https://github.com/mitchellh/packer/issues
>>> IRC: #packer-tool on Freenode
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Packer" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected] <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/packer-tool/1cc25d83-8c4d-45e8-9312-4c7fa46bb7ed%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/packer-tool/1cc25d83-8c4d-45e8-9312-4c7fa46bb7ed%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation of those guidelines may result in your removal from this mailing 
>> list.
>>  
>> GitHub Issues: https://github.com/mitchellh/packer/issues
>> IRC: #packer-tool on Freenode
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Packer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/CALz9Rt-uYW48F%3Dw9Dnp%2Bo3K05wesj5oSr6h-aqy2kjxTpNEDWw%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/packer-tool/CALz9Rt-uYW48F%3Dw9Dnp%2Bo3K05wesj5oSr6h-aqy2kjxTpNEDWw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/1dd3b204-7780-4dd7-8802-2819aa0a117f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to