win_firewall_rule "The property 'failed' cannot be found on this object. Verify that the property exists."

181 views
Skip to first unread message

Joe Levis

unread,
Jan 22, 2016, 12:07:35 PM1/22/16
to Ansible Project
I'm running Ansible 2.0.0.2 on a Ubuntu 14.04 Control Machine, trying to enable an Inbound port on a target Windows Server 2012 R2 using the win_firewall_rule.

Here's my playbook:

- name: Allow inbound connection to port 12398

  action: win_firewall_rule

  args:

    name: "Port 12398"

    enabled: yes

    state: present

    localport: 12398

    protocol: TCP

    action: allow

    direction: In


Receiving this error message:

FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "win_firewall_rule"}, "msg": "The property 'failed' cannot be found on this object. Verify that the property exists."}



Am I missing something or configured it wrong?

J Hawkesworth

unread,
Jan 27, 2016, 5:59:47 AM1/27/16
to Ansible Project
This is likely due to the change to enforce strict mode which was introduced in ansible 2.

There is an issue open on this module 

If you can't wait for the module to be fixed you could try setting strict mode off at the start of the module code

To do so, copy the module (win_firewall_rule.ps1 and win_firewall_rule.py) into your /etc/ansible/library or into your role's library folder and then after

 # WANT_JSON
 # POWERSHELL_COMMON

add this line:
   Set-StrictMode -Off

Might get you out of a hole.

Let us know how you get on.

Joe Levis

unread,
Jan 27, 2016, 11:35:42 AM1/27/16
to Ansible Project
Yep, that works!

Thanks Jon. Once again, you've helped me overcome a major hurdle.

-Joe
Reply all
Reply to author
Forward
0 new messages