Issue 1:
ISSUE TYPE

Feature Idea

COMPONENT NAME

module: win_firewall_rule

ANSIBLE VERSION

ansible 2.3.0.0

config file = /Users/derek/.ansible.cfg

configured module search path = Default w/o overrides

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)]

CONFIGURATION

[defaults]

roles_path=~/development/OCC/ansible-roles/

OS / ENVIRONMENT

Not platform specific, but am running on MacOS Sierra using virtualenv - python 2.7.10

SUMMARY

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"

It would be nice to take the existing RemoteIP of the Rule and append ",{{item}}" to the String.

"site.yml"

---
- 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 }}"

---
ip_addresses:
- 127.0.0.1
- 192.168.1.1
- 192.168.100.1

STEPS TO REPRODUCE

Just run the above playbook

EXPECTED RESULTS

In Windows server:

PS C:\Users\Administrator\Desktop> @(netsh advfirewall firewall show rule name="SFTP 22 TCP - test" verbose)

After first IP Address:

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.

After second IP address:

PS C:\Users\Administrator\Desktop> @(netsh advfirewall firewall show rule name="SFTP 22 TCP - test" verbose)

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.

And so on...

ACTUAL RESULTS

failed: [server01] (item=192.168.1.1) => {"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"]}

Setting force=True just overwrites the value with the new IP Address.

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

ansible-vault, single vaulted variable

ANSIBLE VERSION

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)]

CONFIGURATION

ANSIBLE_VAULT_PASSWORD_FILE=

ansible.cfg

[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

OS / ENVIRONMENT

control box

Amazon Linux AMI release 2014.03

SUMMARY

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: http://docs.ansible.com/ansible/playbooks_vault.html#single-encrypted-variable

STEPS TO REPRODUCE

echo flibbityFloo | ansible-vault encrypt

EXPECTED RESULTS

$ANSIBLE_VAULT;1.1;AES256
soOnsoON....

to stdout.

ACTUAL RESULTS

ERROR! [Errno 2] No such file or directory: '/home/gchavez/git/ansible-run/-'

Ah, dash. Frequently used to direct a command to use standard input. Here however, the dash means a file named "-" or the dash character.