Thanks Matt, 
That was my idea too, but both my IDE and yamllint tells me that's not 
valid yaml:

- name: Configure data disk storage pool
  script: configure_disks.ps1
    creates: "C:/scripts/storagepool_configured.txt"

Ansible chokes on that aswell, which is why I figured I'd had to use the 
"free_form" option since that's the one that (seemingly) takes the script 
name argument.


On Monday, June 13, 2016 at 7:30:44 PM UTC+2, Matt Davis wrote:
>
> "free_form" is a horrible doc artifact that I'm still unsure why it 
> exists... It just means that the script/args go after the action name, eg:
>
> - name: Configure data disk storage pool
>   script: "configure_disks.ps1"
>     creates: "C:/scripts/storagepool_configured.txt"
>
> The script under the role's files directory is correct (and because of 
> DWIM, you don't need to specify files/)- once you fix the task to point at 
> the script in the expected way, it should work.
>
> On Monday, June 13, 2016 at 8:59:28 AM UTC-7, Trond Hindenes wrote:
>>
>> Hi all, 
>> I have a role where the file "configure_disks.ps1" is placed in folder 
>> "files".
>> From the role task I'm trying to run the "script" module using that file:
>> - name: Configure data disk storage pool
>>   script: 
>>     free_form: "configure_disks.ps1" (I have also tried 
>> "files/configure_disks.ps1")
>>     creates: "C:/scripts/storagepool_configured.txt"
>>
>> Shouldn't this work? I can't seem to find exact documentation on when I 
>> can use the "files" folder and when I can't. 
>>
>> Failing that, I guess I can copy the script out to nodes first, but that 
>> means I'm unable to use the script module since that expects a source file 
>> existing on the control node, right?
>>
>> I haven't used the "script" module much, so any pointers would be great. 
>>
>

-- 
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/b09ad4fb-2ed8-40ad-b6ef-a59013b53fc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to