The first thing to verify is that the command will run successfully thru a 
PSRemoting session. From another computer, issue an "enter-pssession" to 
the target computer, using the same authentication type as you do from 
Ansible (Basic/Kerberos). Then, execute your command.

Not sure why you're not using the Add-Computer cmdlet instead of djoin, but 
I guess you have your reasons.

On Saturday, November 7, 2015 at 2:35:36 AM UTC+1, Elliott Barrere wrote:
>
> Hi there -
>
> I'm trying to get the following domain join script to execute through 
> ansible, but it always fails with error code 1:
>
> C:\windows\system32\djoin.exe /PROVISION /REUSE /DOMAIN **redacted** /MACHINE 
> {{ansible_hostname}} /SAVEFILE c:\{{ansible_hostname}}.txt
>
> The exact same code works fine when I run it from a command prompt on the 
> machine, so I'm very confused why it wouldn't work.
>
> I've tried using raw to execute a script I copied up before, using raw 
> with the script embedded, and also using the script directive.
>
> Here is the error data:
>
> fatal: [vagrant1 -> **redacted**]: FAILED! => {"changed": false, "failed": 
> true, "invocation": {"module_args": {"_raw_params": 
> "C:\\windows\\system32\\djoin.exe 
> /PROVISION /REUSE /DOMAIN **redacted** /MACHINE VAGRANT-2012-R2 /SAVEFILE 
> c:\\VAGRANT-2012-R2.txt"}, "module_name": "raw"}, "rc": 1, "stderr": "", 
> "stdout": "", "stdout_lines": []}
>
>
> Any thoughts on how to debug this?  I can execute other commands via 
> "raw", and this command works just fine (even running the script ansible 
> copied up directly).
>
> Thanks in advance!
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/26965c75-328f-4a67-83ae-2d04316f0f09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to