Issue 1:
ISSUE TYPE

Bug Report

ANSIBLE VERSION

2.0.2.0

CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

In 2.0.2.0, using get_url with file:// urls fails because it is

looking for an http respond code. This worked correctly in 2.0.1.0.

STEPS TO REPRODUCE

touch /tmp/srcfile and run the following playbook:

- hosts: localhost
gather_facts: false
vars:
url: file:///tmp/srcfile
tasks:

- get_url:
url: "{{url}}"
dest: "./destfile"
force: true

EXPECTED RESULTS

PLAY ***************************************************************************

TASK [get_url] *****************************************************************
ok: [localhost]

PLAY RECAP *********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0

ACTUAL RESULTS

PLAY [localhost] ***************************************************************

TASK [get_url] *****************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "dest": "./destfile", "failed": true, "gid": 1000, "group": "lars", "mode": "0664", "msg": "Request failed", "owner": "lars", "response": "OK (12 bytes)", "size": 12, "state": "file", "status_code": null, "uid": 1000, "url": "file:///tmp/srcfile"}

NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @file_urls.retry

PLAY RECAP *********************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1

Issue 2:
ISSUE TYPE

Feature Idea

COMPONENT NAME

firewalld

ANSIBLE VERSION

ansible 2.4.1.0
config file = <REDACTED>/ansible.cfg
configured module search path = [u'/<REDACTED>/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/Cellar/ansible/2.4.1.0/libexec/lib/python2.7/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.14 (default, Sep 25 2017, 09:53:22) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]

CONFIGURATION

No changed settings

OS / ENVIRONMENT

I'm trying to manage CentOS 7 / RHEL 7 systems with firewalld enabled.

SUMMARY

I use FirewallD to manage my system firewalls for various services. Some services should only be reachable by specific IP subnets. The current firewalld module allows me to specify a source IP range, but I have to choose an existing zone. The problem with this, is that most of these zones have "side effects" of existing rules and it limits the number of unique source ranges to ports I would give access to.

I'd like to be able to do the equivalent of the following using Ansible.

sudo firewall-cmd --new-zone=kafka_consumers --permanent
sudo firewall-cmd --zone=kafka_consumers --add-source=192.0.2.0/24 --permanent
sudo firewall-cmd --zone=kafka_consumers --add-port=9092/tcp --permanent
sudo firewall-cmd --reload

STEPS TO REPRODUCE

I think using the module and only specifying the zone with a state of present makes sense as an atomic change. Then the rules could be applied.

- name: Ensure kafka_consumers zone exists
firewalld:
zone: kafka_consumers
state: present
permanent: yes
immediate: yes
- name: Add TEST-NET-1 to zone
firewalld:
zone: kafka_consumers
source: 192.0.2.0/24
permanent: yes
immediate: yes
state: present
- name: Add kafka port to zone
firewalld:
zone: kafka_consumers
port: 9092/tcp
permanent: yes
immediate: yes
state: present

EXPECTED RESULTS

The zone would be created, then the rules would be applied

ACTUAL RESULTS

The firewalld module execution fails due to zone not existing.