win_firewall_rule is removing even when state=present

13 views
Skip to first unread message

Justin Dugan

unread,
Sep 2, 2016, 9:44:40 AM9/2/16
to Ansible Project
 I created the rule using the following in powershell:

netsh advfirewall firewall add rule name=JBoss dir=in action=allow protocol=tcp localport="8080,8443,9990"

Then after running the following in ansible, the rule is removed:

- name: Setup firewall for JBoss
  win_firewall_rule:
    name: JBoss
    state: present
    localport: '8080,8443,9990'
    action: allow
    direction: in
    protocol: tcp
    force: yes

If force is commented, it complains the rule already exists. With force, it removes the rule instead of updating it if required. If the rule doesn't already exist, it is not created using ansible. 
Reply all
Reply to author
Forward
0 new messages