Hi,

Sorry role not shared anywhere right now.  Keep meaning to put stuff on 
galaxy but haven't found the time.

My apologies, looking at the code I'd forgotten that I'd tweaked the 
powershell script so I could pass in plaintext password.  I doubt a 
SecureString would be serializable.

I think the only bit I changed was at the start of the process section.  
Instead of this

process {
 
    try {
        $ErrorActionPreference = "Stop"
         
        $decryptedPass = [Runtime.InteropServices.Marshal]::PtrToStringAuto(
            [Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password)
        )

I have this

process {
 
    try {
        $ErrorActionPreference = "Stop"
  
        $secPass = ConvertTo-SecureString -String $Password -AsPlainText 
-Force         

        $decryptedPass = [Runtime.InteropServices.Marshal]::PtrToStringAuto(
            # [Runtime.InteropServices.Marshal]::SecureStringToBSTR(
$Password)
            [Runtime.InteropServices.Marshal]::SecureStringToBSTR($secPass)

        )

Hope that helps,

Jon

On Monday, July 11, 2016 at 6:33:50 PM UTC+1, skinnedknuckles wrote:
>
> I tried converting my password to a secureString by using 
> "ConvertTo-SecureString" commandlet of powershell like this.
>
>
>   - name Convert password to secure string
>     raw: ConvertTo-SecureString "password" -AsPlainTest -Force
>     register: result
>   - set_fact: ssPassword={{result.stdout_lines.0}}
>   - name Setup Auto Reboot
>     script: Set-SecureAutoLogon.ps1 "{{userName}}" "{{ssPassword}}" "acme" 
> "1" "true"
>
>
> Then when I run it I get "Cannot process argument transformation non 
> parameter "Password" Cannot convert the System.SecuritySecureString value 
> of type System.String to type System.Security.SecureString"
>
>
>
>
> On Wednesday, May 11, 2016 at 10:01:52 AM UTC-5, skinnedknuckles wrote:
>>
>> Management Node:
>> CentOs 7.1
>> Ansible 2.1
>> Remote Node:
>> Windows 7
>> Powershell 3.0
>>
>> How do I launch an executable on a remote node running Windows 7?  As I 
>> understand win_scheduled_task only works with Windows Server 2012 and 
>> win_nssm is only for startup services.  Is there any other way do do this? 
>>  If not, is there any way to access the Invoke-Command option of 
>> Powershell?  I suppose a module could be written to do that but I'm new to 
>> python and doubt I could pull it off.
>>
>> Thanks,
>>
>> Jonathan
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3c1d4f85-8bfe-4f95-ba3e-856098e13e55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to