<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">module: win_firewall_rule</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">ansible 2.3.0.0<br>
config file = /Users/derek/.ansible.cfg<br>
configured module search path = Default w/o overrides<br>
python version = 2.7.10 (default, Jul 30 2016, 19:40:32) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]</p>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">[defaults]<br>
roles_path=~/development/OCC/ansible-roles/</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Not platform specific, but am running on MacOS Sierra using virtualenv - python 2.7.10</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Using the included playbook, I think each ip_address would be appended to the RemoteIP value of the firewall rule in Windows.  Currently, it just replaces the existing value or it errors out with "The rule exists but has different values", "There was already a rule SFTP 22 TCP - test with different values, use force=True to overwrite it"</p>
<p dir="auto">It would be nice to take the existing RemoteIP of the Rule and append ",{{item}}" to the String.</p>
<p dir="auto">"site.yml"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="---
- hosts: all
  tasks:
    - name: Open firewall
      win_firewall_rule:
        action: allow
        name: SFTP 22 TCP - test
        description: SFTP Port 22 TCP-In
        protocol: tcp
        localport: 22
        direction: in
        remoteip: {{ item }}
        state: present
        force: yes
      with_items:
        - &quot;{{ ip_addresses }}&quot;"><pre class="notranslate"><code class="notranslate">---
- hosts: all
  tasks:
    - name: Open firewall
      win_firewall_rule:
        action: allow
        name: SFTP 22 TCP - test
        description: SFTP Port 22 TCP-In
        protocol: tcp
        localport: 22
        direction: in
        remoteip: {{ item }}
        state: present
        force: yes
      with_items:
        - "{{ ip_addresses }}"
</code></pre></div>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="---
ip_addresses:
  - 127.0.0.1
  - 192.168.1.1
  - 192.168.100.1"><pre class="notranslate"><code class="notranslate">---
ip_addresses:
  - 127.0.0.1
  - 192.168.1.1
  - 192.168.100.1
</code></pre></div>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Just run the above playbook</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">In Windows server:</p>
<p dir="auto">PS C:\Users\Administrator\Desktop&gt; @(netsh advfirewall firewall show rule name="SFTP 22 TCP - test" verbose)</p>
<p dir="auto">After first IP Address:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Rule Name:                            SFTP 22 TCP - test
----------------------------------------------------------------------
Description:                          SFTP Port 22 TCP-In for CrushFTP
Enabled:                              Yes
Direction:                            In
Profiles:                             Domain,Private,Public
Grouping:
LocalIP:                              Any
RemoteIP:                             127.0.0.1/32
Protocol:                             TCP
LocalPort:                            22
RemotePort:                           Any
Edge traversal:                       No
Service:                              Any
InterfaceTypes:                       Any
Security:                             NotRequired
Rule source:                          Local Setting
Action:                               Allow
Ok."><pre class="notranslate"><code class="notranslate">Rule Name:                            SFTP 22 TCP - test
----------------------------------------------------------------------
Description:                          SFTP Port 22 TCP-In for CrushFTP
Enabled:                              Yes
Direction:                            In
Profiles:                             Domain,Private,Public
Grouping:
LocalIP:                              Any
RemoteIP:                             127.0.0.1/32
Protocol:                             TCP
LocalPort:                            22
RemotePort:                           Any
Edge traversal:                       No
Service:                              Any
InterfaceTypes:                       Any
Security:                             NotRequired
Rule source:                          Local Setting
Action:                               Allow
Ok.
</code></pre></div>
<p dir="auto">After second IP address:<br>
PS C:\Users\Administrator\Desktop&gt; @(netsh advfirewall firewall show rule name="SFTP 22 TCP - test" verbose)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Rule Name:                            SFTP 22 TCP - test
----------------------------------------------------------------------
Description:                          SFTP Port 22 TCP-In for CrushFTP
Enabled:                              Yes
Direction:                            In
Profiles:                             Domain,Private,Public
Grouping:
LocalIP:                              Any
RemoteIP:                             127.0.0.1/32,192.168.1.1/32
Protocol:                             TCP
LocalPort:                            22
RemotePort:                           Any
Edge traversal:                       No
Service:                              Any
InterfaceTypes:                       Any
Security:                             NotRequired
Rule source:                          Local Setting
Action:                               Allow
Ok."><pre class="notranslate"><code class="notranslate">Rule Name:                            SFTP 22 TCP - test
----------------------------------------------------------------------
Description:                          SFTP Port 22 TCP-In for CrushFTP
Enabled:                              Yes
Direction:                            In
Profiles:                             Domain,Private,Public
Grouping:
LocalIP:                              Any
RemoteIP:                             127.0.0.1/32,192.168.1.1/32
Protocol:                             TCP
LocalPort:                            22
RemotePort:                           Any
Edge traversal:                       No
Service:                              Any
InterfaceTypes:                       Any
Security:                             NotRequired
Rule source:                          Local Setting
Action:                               Allow
Ok.
</code></pre></div>
<p dir="auto">And so on...</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="failed: [server01] (item=192.168.1.1) =&gt; {&quot;changed&quot;: false, &quot;difference&quot;: [&quot;SFTP Port 22 TCP-In&quot;, &quot;192.168.1.1&quot;], &quot;failed&quot;: true, &quot;fwsettings&quot;: {&quot;Action&quot;: &quot;allow&quot;, &quot;Description&quot;: &quot;SFTP Port 22 TCP-In&quot;, &quot;Direction&quot;: &quot;in&quot;, &quot;Enabled&quot;: &quot;yes&quot;, &quot;LocalIP&quot;: &quot;any&quot;, &quot;LocalPort&quot;: 22, &quot;Profiles&quot;: &quot;any&quot;, &quot;Protocol&quot;: &quot;tcp&quot;, &quot;RemoteIP&quot;: &quot;192.168.1.1&quot;, &quot;RemotePort&quot;: &quot;any&quot;, &quot;Rule Name&quot;: &quot;SFTP 22 TCP - test&quot;, &quot;Service&quot;: &quot;any&quot;}, &quot;item&quot;: &quot;192.168.1.1&quot;, &quot;msg&quot;: [&quot;The rule 'SFTP 22 TCP - test' exists.&quot;, &quot;The rule exists but has different values&quot;, &quot;There was already a rule SFTP 22 TCP - test with different values, use force=True to overwrite it&quot;]}"><pre class="notranslate"><code class="notranslate">failed: [server01] (item=192.168.1.1) =&gt; {"changed": false, "difference": ["SFTP Port 22 TCP-In", "192.168.1.1"], "failed": true, "fwsettings": {"Action": "allow", "Description": "SFTP Port 22 TCP-In", "Direction": "in", "Enabled": "yes", "LocalIP": "any", "LocalPort": 22, "Profiles": "any", "Protocol": "tcp", "RemoteIP": "192.168.1.1", "RemotePort": "any", "Rule Name": "SFTP 22 TCP - test", "Service": "any"}, "item": "192.168.1.1", "msg": ["The rule 'SFTP 22 TCP - test' exists.", "The rule exists but has different values", "There was already a rule SFTP 22 TCP - test with different values, use force=True to overwrite it"]}
</code></pre></div>
<p dir="auto">Setting force=True just overwrites the value with the new IP Address.</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">ansible-vault, single vaulted variable</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0
  config file =
  configured module search path = Default w/o overrides
  python version = 2.6.9 (unknown, Sep  1 2016, 23:34:39) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0
  config file =
  configured module search path = Default w/o overrides
  python version = 2.6.9 (unknown, Sep  1 2016, 23:34:39) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<ul dir="auto">
<li>ANSIBLE_VAULT_PASSWORD_FILE=</li>
<li>ansible.cfg</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[defaults]
inventory      = ./ec2.py
library        = ~/git/ansible-run/lib/
forks          = 50
sudo_user      = root
transport      = smart
gathering = smart
roles_path    = ~/git/ansible-run/roles:~/git/ansible-run/roles_galaxy:./roles:./roles_galaxy
host_key_checking = False
hash_behaviour = replace
ansible_managed = Ansible managed: {file} on {host}
system_warnings = False
deprecation_warnings = False
command_warnings = True
nocows = 1
retry_files_enabled = False
[ssh_connection]
ssh_args = -o ForwardAgent=yes
pipelining = False"><pre class="notranslate"><code class="notranslate">[defaults]
inventory      = ./ec2.py
library        = ~/git/ansible-run/lib/
forks          = 50
sudo_user      = root
transport      = smart
gathering = smart
roles_path    = ~/git/ansible-run/roles:~/git/ansible-run/roles_galaxy:./roles:./roles_galaxy
host_key_checking = False
hash_behaviour = replace
ansible_managed = Ansible managed: {file} on {host}
system_warnings = False
deprecation_warnings = False
command_warnings = True
nocows = 1
retry_files_enabled = False
[ssh_connection]
ssh_args = -o ForwardAgent=yes
pipelining = False
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">control box</p>
<ul dir="auto">
<li>Amazon Linux AMI release 2014.03</li>
</ul>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Being able to encrypt passwords and the like on the command line by echoing to ansible-vault's stdin and receiving the encrypted data to stdout. Doesn't work, although this feature is documented here: <a href="http://docs.ansible.com/ansible/playbooks_vault.html#single-encrypted-variable" rel="nofollow">http://docs.ansible.com/ansible/playbooks_vault.html#single-encrypted-variable</a></p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="echo flibbityFloo | ansible-vault encrypt"><pre class="notranslate"><span class="pl-s">echo flibbityFloo | ansible-vault encrypt</span></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ANSIBLE_VAULT;1.1;AES256
soOnsoON...."><pre class="notranslate"><code class="notranslate">$ANSIBLE_VAULT;1.1;AES256
soOnsoON....
</code></pre></div>
<p dir="auto">to stdout.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR! [Errno 2] No such file or directory: '/home/gchavez/git/ansible-run/-'"><pre class="notranslate"><code class="notranslate">ERROR! [Errno 2] No such file or directory: '/home/gchavez/git/ansible-run/-'
</code></pre></div>
<p dir="auto">Ah, dash. Frequently used to direct a command to use standard input. Here however, the dash means a file named "-" or the dash character.</p>