Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

redhat_subscription

ANSIBLE VERSION

ansible 2.2.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides

CONFIGURATION

OS / ENVIRONMENT

RHEL 7.3

SUMMARY

redhat_subscription manager is overloading the value type of the original subscription manager. This causes confusion and over-consumption of entitlements.

The official Red Hat Subscription Manager allows attaching subscriptions by Pool ID, NOT by Pool Name.

[root@rhel7 ~]# subscription-manager attach --help
Usage: subscription-manager attach [OPTIONS]

Attach a specified subscription to the registered system

Options:
-h, --help show this help message and exit
--proxy=PROXY_URL proxy URL in the form of proxy_hostname:proxy_port
--proxyuser=PROXY_USER
user for HTTP proxy with basic authentication
--proxypassword=PROXY_PASSWORD
password for HTTP proxy with basic authentication
--pool=POOL the ID of the pool to attach (can be specified more
than once)
--quantity=QUANTITY number of subscriptions to attach
--auto Automatically attach compatible subscriptions to this
system. This is the default action.
--servicelevel=SERVICE_LEVEL
service level to apply to this system
--file=FILE A file from which to read pool IDs. If a hyphen is
provided, pool IDs will be read from stdin.
[root@rhel7 ~]#

Because this module is allowing a user to specify a name and trying to do its own logic and parsing of available Pool IDs, it is incorrectly attempting to extend the capabilities of the official subscription manager. It also does it poorly, allowing multiple subscriptions to be consumed when they were not desired.

Large customers will have many duplicate subscriptions of the same name due to growth and purchases made at different times. This could have a very large impact to large customers.

The feature to enable using the Pool ID is a good start, but we also must remove the capability of adding by Name. This Ansible module should not attempt to do more than the original tool allows.

ansible/ansible-modules-core#4603

STEPS TO REPRODUCE

- redhat_subscription:
state: present
username: "{{ rhn_username }}"
password: "{{ rhn_password }}"
pool: '^Employee SKU$'
# pool: "{{ POOL_ID }}"
when: ansible_distribution == 'RedHat'

EXPECTED RESULTS

Only a single Pool ID attached, presumably the first one matched. But certainly not ALL matches.

ACTUAL RESULTS

I have altered the values below to protect our actual Pool IDs (XXX, YYY, ZZZ). I can provide actual examples privately.

<util7vm> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt util7vm '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-pyeuamdvwtzvyzuxvbczhjotjfyacqxn; /usr/bin/python /root/.ansible/tmp/ansible-tmp-1481978149.12-197063747409681/redhat_subscription.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1481978149.12-197063747409681/" > /dev/null 2>&1'"'"'"'"'"'"'"'"' && sleep 0'"'"''
changed: [util7vm] => {
"changed": true,
"invocation": {
"module_args": {
"activationkey": null,
"autosubscribe": false,
"consumer_id": null,
"consumer_name": null,
"consumer_type": null,
"environment": null,
"force_register": false,
"org_id": null,
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"pool": "^Employee SKU$",
"rhsm_baseurl": "https://cdn.redhat.com",
"server_hostname": "subscription.rhn.redhat.com",
"server_insecure": "0",
"state": "present",
"username": "my-rhn-support-username"
},
"module_name": "redhat_subscription"
},
"subscribed_pool_ids": [
"XXXXXXXXXXXXXXXXXXXXXXXXXXX",
"YYYYYYYYYYYYYYYYYYYYYYYY",
"ZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
],
"unsubscribed_serials": []
}

PLAY RECAP *********************************************************************
util7vm : ok=2 changed=1 unreachable=0 failed=0

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

Module docker_network

ANSIBLE VERSION

ansible --version
ansible 2.3.0.0
config file = /Users/me/code/test_master/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.13 (default, Dec 18 2016, 07:03:39) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]

CONFIGURATION

[defaults]
force_color = 1
; force_handlers = True
host_key_checking = false
inventory = inventory
retry_files_enabled = false
any_errors_fatal = true
#roles_path = roles

OS / ENVIRONMENT

Mac OS Sierra 10.1.2.4

SUMMARY

Using the overlay network driver with the docker module fails, however the bridge driver works successfully. Hence I have made a determination that the error is overlay driver specific.

STEPS TO REPRODUCE

- name: Managing Docker Swarm Networks
docker_network:
name: test_net_overlay
driver: overlay
state: present

Causes error below

ok: [10.131.92.197] => (item={u'state': u'present', u'driver': u'bridge', u'name': u'test_net_bridge'}) => {"ansible_facts": {}, "changed": false, "item": {"driver": "bridge", "name": "test_net_bridge", "state": "present"}}

failed: [10.131.92.197] (item={u'state': u'present', u'driver': u'overlay', u'name': u'test_net_overlay'}) => {"failed": true, "item": {"driver": "overlay", "name": "test_net_overlay", "state": "present"}, "module_stderr": "Shared connection to 10.131.92.197 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible_N_OU9h/ansible_module_docker_network.py\", line 393, in <module>\r\n main()\r\n File \"/tmp/ansible_N_OU9h/ansible_module_docker_network.py\", line 386, in main\r\n cm = DockerNetworkManager(client)\r\n File \"/tmp/ansible_N_OU9h/ansible_module_docker_network.py\", line 215, in __init__\r\n self.parameters.connected = container_names_in_network(self.existing_network)\r\n File \"/tmp/ansible_N_OU9h/ansible_module_docker_network.py\", line 197, in container_names_in_network\r\n return [c['Name'] for c in network['Containers'].values()]\r\nAttributeError: 'NoneType' object has no attribute 'values'\r\n", "msg": "MODULE FAILURE", "rc": 0}

Note: The bridge driver works correctly, but the overlay driver fails.

EXPECTED RESULTS

Module should not return an error

ACTUAL RESULTS

Module returned error

failed: [10.131.92.197] (item={u'state': u'present', u'driver': u'overlay', u'name': u'test_net_overlay'}) => {"failed": true, "item": {"driver": "overlay", "name": "test_net_overlay", "state": "present"}, "module_stderr": "Shared connection to 10.131.92.197 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible_N_OU9h/ansible_module_docker_network.py\", line 393, in <module>\r\n main()\r\n File \"/tmp/ansible_N_OU9h/ansible_module_docker_network.py\", line 386, in main\r\n cm = DockerNetworkManager(client)\r\n File \"/tmp/ansible_N_OU9h/ansible_module_docker_network.py\", line 215, in __init__\r\n self.parameters.connected = container_names_in_network(self.existing_network)\r\n File \"/tmp/ansible_N_OU9h/ansible_module_docker_network.py\", line 197, in container_names_in_network\r\n return [c['Name'] for c in network['Containers'].values()]\r\nAttributeError: 'NoneType' object has no attribute 'values'\r\n", "msg": "MODULE FAILURE", "rc": 0}