so i have an environment with control machine:
ansible --version
ansible 1.9.1
configured module search path = /usr/share/ansible
i'm trying to use the integrated powershell utilities for sending and returning (Exit-Json, Fail-Json) but the powershell script i am using does not recognize these:
changed: [] => {"changed": true, "rc": 0, "stderr": "Set-Attr : The term 'Set-Attr' is not recognized as the name of a cmdlet, \r\nfunction, script file, or operable program. Check the spelling of the name, or \r\nif a path was included, verify that the path is correct and try again...
i am new to ansible and maybe i am missing something here, please assist.
here is the playbook:
---
- hosts: [MYHOSTS]
gather_facts: no
tasks:
- name: Run powershell test script
script: scripts/test.ps1
here is the script test.ps1:
#!powershell
# WANT_JSON
# POWERSHELL_COMMON
$result = New-Object psobject
Set-Attr $result "changed" $true
Exit-Json $result