# win\_firewall\_rule "The property 'failed' cannot be found on this object. Verify that the property exists."

**URL:** <https://forum.ansible.com/t/win-firewall-rule-the-property-failed-cannot-be-found-on-this-object-verify-that-the-property-exists/20319>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [January 22, 2016, 5:07pm UTC](https://forum.ansible.com/t/win-firewall-rule-the-property-failed-cannot-be-found-on-this-object-verify-that-the-property-exists/20319 "2016-01-22T17:07:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Levis](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Joe\_Levis](https://forum.ansible.com/u/Joe_Levis)\
**Post date:** [January 22, 2016, 5:07pm UTC](https://forum.ansible.com/t/win-firewall-rule-the-property-failed-cannot-be-found-on-this-object-verify-that-the-property-exists/20319/1 "2016-01-22T17:07:34Z")

</div>

**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?

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [January 27, 2016, 10:59am UTC](https://forum.ansible.com/t/win-firewall-rule-the-property-failed-cannot-be-found-on-this-object-verify-that-the-property-exists/20319/2 "2016-01-27T10:59:47Z")

</div>

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

> <https://github.com/ansible/ansible-modules-extras/issues/1406>
>
> Hi,
> I'm experiencing the following errors in ansible 2:
> 
> \`\`\` sh
> TASK \[0\_base : B…e sure winrm http is disabled\] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> fatal: \[ga-z170x-g3\]: FAILED! =\> {"changed": false, "error": "The property 'Enable' cannot be found on this object. Verify that the property exists.", "failed": true, "msg": \["The rule 'Deny WinRM HTTP' exists."\]}
> 
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> ga-z170x-g3 : ok=3 changed=0 unreachable=0 failed=1   
> 
> \# and
> 
> TASK \[0\_base : Be sure winrm http is disabled\] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> fatal: \[ga-z170x-g3\]: FAILED! =\> {"changed": false, "error": "The property 'profile' cannot be found on this object. Verify that the property exists.", "failed": true, "msg": \["The rule 'Deny WinRM HTTP' exists."\]}
> 
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> ga-z170x-g3 : ok=3 changed=0 unreachable=0 failed=1   
> \`\`\`
> 
> Where the task being run looks like this in my playbook:
> 
> \`\`\` yaml
> \- name: Be sure winrm http is disabled
> win\_firewall\_rule:
> name: Deny WinRM HTTP
> enable: yes
> profile: Domain,Private,Public
> protocol: tcp
> localport: 5985
> direction: in
> action: block
> state: present
> force: yes
> tags: firewall
> \`\`\`
> 
> These errors do not happen on ansible v1.9.4.

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.

---

<div class="post-metadata">

**Author:** ![Joe\_Levis](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Joe\_Levis](https://forum.ansible.com/u/Joe_Levis)\
**Post date:** [January 27, 2016, 4:35pm UTC](https://forum.ansible.com/t/win-firewall-rule-the-property-failed-cannot-be-found-on-this-object-verify-that-the-property-exists/20319/3 "2016-01-27T16:35:42Z")

</div>

Yep, that works!

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

-Joe
