Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

docker_service

ANSIBLE VERSION

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

CONFIGURATION

none

OS / ENVIRONMENT

linux

SUMMARY

When using a private registry, the docker_service task fails to pull images.

STEPS TO REPRODUCE

Run the task using a private registry

playbook task:
- docker_service:
project_src: .
files:
- docker-compose.yml
pull: yes
state: present

docker-compose file:
version: '2'
services:
my_service:
image: my.private.registry.com/my_service

EXPECTED RESULTS

It should not fail to pull images

ACTUAL RESULTS

It fails

TASK [docker_service] **********************************************************
task path: /home/user/src/2016/acr/novum-sandpit/dev/deploy/deploy.yml:9
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/core/cloud/docker/docker_service.py
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: user
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593 `" && echo ansible-tmp-1481302953.19-26010212998593="` echo $HOME/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593 `" ) && sleep 0'
<localhost> PUT /tmp/tmpd5CKV6 TO /home/user/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593/docker_service.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/user/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593/ /home/user/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593/docker_service.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /home/user/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593/docker_service.py; rm -rf "/home/user/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593/" > /dev/null 2>&1 && sleep 0'
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_no8CvM/ansible_module_docker_service.py", line 929, in <module>
main()
File "/tmp/ansible_no8CvM/ansible_module_docker_service.py", line 924, in main
result = ContainerManager(client).exec_module()
File "/tmp/ansible_no8CvM/ansible_module_docker_service.py", line 575, in exec_module
result = self.cmd_up()
File "/tmp/ansible_no8CvM/ansible_module_docker_service.py", line 627, in cmd_up
result.update(self.cmd_pull())
File "/tmp/ansible_no8CvM/ansible_module_docker_service.py", line 739, in cmd_pull
image = service.image()
File "/usr/local/lib/python2.7/dist-packages/compose/service.py", line 320, in image
raise NoSuchImageError("Image '{}' not found".format(self.image_name))
compose.service.NoSuchImageError: Image 'my.private.registry.com/my_service' not found

fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_name": "docker_service"
},
"module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_no8CvM/ansible_module_docker_service.py\", line 929, in <module>\n main()\n File \"/tmp/ansible_no8CvM/ansible_module_docker_service.py\", line 924, in main\n result = ContainerManager(client).exec_module()\n File \"/tmp/ansible_no8CvM/ansible_module_docker_service.py\", line 575, in exec_module\n result = self.cmd_up()\n File \"/tmp/ansible_no8CvM/ansible_module_docker_service.py\", line 627, in cmd_up\n result.update(self.cmd_pull())\n File \"/tmp/ansible_no8CvM/ansible_module_docker_service.py\", line 739, in cmd_pull\n image = service.image()\n File \"/usr/local/lib/python2.7/dist-packages/compose/service.py\", line 320, in image\n raise NoSuchImageError(\"Image '{}' not found\".format(self.image_name))\ncompose.service.NoSuchImageError: Image 'my.private.registry.com/my_service' not found\n",
"module_stdout": "",
"msg": "MODULE FAILURE"
}

Issue 2:
Issue type:

Bug report

Component Name:

ec2_group module

Ansible version:

1.8.4

boto 2.36

Environment:

OS X 10.8.2,

Ubuntu 12.04.05

python 2.7

Summary

I came across an issue when managing SG group entires via boto/ansible.

Got this error on one of my environments:

File "/Users/zytek/.ansible/tmp/ansible-tmp-1425034576.71-249532590752251/ec2_group", line 2181, in <module>
main()
File "/Users/zytek/.ansible/tmp/ansible-tmp-1425034576.71-249532590752251/ec2_group", line 302, in main
group.authorize(rule['proto'], rule['from_port'], rule['to_port'], ip, grantGroup)
File "/Library/Python/2.7/site-packages/boto/ec2/securitygroup.py", line 203, in authorize
dry_run=dry_run)
File "/Library/Python/2.7/site-packages/boto/ec2/connection.py", line 3191, in authorize_security_group
params, verb='POST')
File "/Library/Python/2.7/site-packages/boto/connection.py", line 1226, in get_status
raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidPermission.Duplicate</Code><Message>The permission '5495791-1-8080-8080' has already been authorized on the specified group</Message></Error></Errors><RequestID>eff6ddd3-5752-45d0-a4d7-b0e6fc3e1820</RequestID></Response>

Both AWS SG config and ansible playbook were in sync when it comes to entries.

Adding new SG and populating it worker fine, just the second run was not working, as AWS API complains about duplicated entries.

The workaround here was to change 'group_name: some-name' to 'group_id: sg-xxxx'

Steps to reproduce:

Expected result:

No changes to SG entries

Actual result:

Error about duplicate entries