<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">docker_service</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0.0
  config file = 
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.2.0.0
  config file = 
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">none</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">linux</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">When using a private registry, the <code class="notranslate">docker_service</code> task fails to pull images.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Run the task using a private registry</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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"><pre class="notranslate"><code class="notranslate">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
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">It should not fail to pull images</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">It fails</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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
&lt;localhost&gt; ESTABLISH LOCAL CONNECTION FOR USER: user
&lt;localhost&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593 `&quot; &amp;&amp; echo ansible-tmp-1481302953.19-26010212998593=&quot;` echo $HOME/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593 `&quot; ) &amp;&amp; sleep 0'
&lt;localhost&gt; PUT /tmp/tmpd5CKV6 TO /home/user/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593/docker_service.py
&lt;localhost&gt; 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 &amp;&amp; sleep 0'
&lt;localhost&gt; EXEC /bin/sh -c '/usr/bin/python /home/user/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593/docker_service.py; rm -rf &quot;/home/user/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593/&quot; &gt; /dev/null 2&gt;&amp;1 &amp;&amp; sleep 0'
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File &quot;/tmp/ansible_no8CvM/ansible_module_docker_service.py&quot;, line 929, in &lt;module&gt;
    main()
  File &quot;/tmp/ansible_no8CvM/ansible_module_docker_service.py&quot;, line 924, in main
    result = ContainerManager(client).exec_module()
  File &quot;/tmp/ansible_no8CvM/ansible_module_docker_service.py&quot;, line 575, in exec_module
    result = self.cmd_up()
  File &quot;/tmp/ansible_no8CvM/ansible_module_docker_service.py&quot;, line 627, in cmd_up
    result.update(self.cmd_pull())
  File &quot;/tmp/ansible_no8CvM/ansible_module_docker_service.py&quot;, line 739, in cmd_pull
    image = service.image()
  File &quot;/usr/local/lib/python2.7/dist-packages/compose/service.py&quot;, line 320, in image
    raise NoSuchImageError(&quot;Image '{}' not found&quot;.format(self.image_name))
compose.service.NoSuchImageError: Image 'my.private.registry.com/my_service' not found

fatal: [localhost]: FAILED! =&gt; {
    &quot;changed&quot;: false, 
    &quot;failed&quot;: true, 
    &quot;invocation&quot;: {
        &quot;module_name&quot;: &quot;docker_service&quot;
    }, 
    &quot;module_stderr&quot;: &quot;Traceback (most recent call last):\n  File \&quot;/tmp/ansible_no8CvM/ansible_module_docker_service.py\&quot;, line 929, in &lt;module&gt;\n    main()\n  File \&quot;/tmp/ansible_no8CvM/ansible_module_docker_service.py\&quot;, line 924, in main\n    result = ContainerManager(client).exec_module()\n  File \&quot;/tmp/ansible_no8CvM/ansible_module_docker_service.py\&quot;, line 575, in exec_module\n    result = self.cmd_up()\n  File \&quot;/tmp/ansible_no8CvM/ansible_module_docker_service.py\&quot;, line 627, in cmd_up\n    result.update(self.cmd_pull())\n  File \&quot;/tmp/ansible_no8CvM/ansible_module_docker_service.py\&quot;, line 739, in cmd_pull\n    image = service.image()\n  File \&quot;/usr/local/lib/python2.7/dist-packages/compose/service.py\&quot;, line 320, in image\n    raise NoSuchImageError(\&quot;Image '{}' not found\&quot;.format(self.image_name))\ncompose.service.NoSuchImageError: Image 'my.private.registry.com/my_service' not found\n&quot;, 
    &quot;module_stdout&quot;: &quot;&quot;, 
    &quot;msg&quot;: &quot;MODULE FAILURE&quot;
}"><pre class="notranslate"><code class="notranslate">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
&lt;localhost&gt; ESTABLISH LOCAL CONNECTION FOR USER: user
&lt;localhost&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593 `" &amp;&amp; echo ansible-tmp-1481302953.19-26010212998593="` echo $HOME/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593 `" ) &amp;&amp; sleep 0'
&lt;localhost&gt; PUT /tmp/tmpd5CKV6 TO /home/user/.ansible/tmp/ansible-tmp-1481302953.19-26010212998593/docker_service.py
&lt;localhost&gt; 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 &amp;&amp; sleep 0'
&lt;localhost&gt; 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/" &gt; /dev/null 2&gt;&amp;1 &amp;&amp; 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 &lt;module&gt;
    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! =&gt; {
    "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 &lt;module&gt;\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"
}
</code></pre></div>
<h5 dir="auto">Issue type:</h5>
<p dir="auto">Bug report</p>
<h5 dir="auto">Component Name:</h5>
<p dir="auto">ec2_group module</p>
<h5 dir="auto">Ansible version:</h5>
<p dir="auto">1.8.4<br>
boto 2.36</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">OS X 10.8.2,<br>
Ubuntu 12.04.05<br>
python 2.7</p>
<h5 dir="auto">Summary</h5>
<p dir="auto">I came across an issue when managing SG group entires via boto/ansible.</p>
<p dir="auto">Got this error on one of my environments:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  File &quot;/Users/zytek/.ansible/tmp/ansible-tmp-1425034576.71-249532590752251/ec2_group&quot;, line 2181, in &lt;module&gt;
    main()
  File &quot;/Users/zytek/.ansible/tmp/ansible-tmp-1425034576.71-249532590752251/ec2_group&quot;, line 302, in main
    group.authorize(rule['proto'], rule['from_port'], rule['to_port'], ip, grantGroup)
  File &quot;/Library/Python/2.7/site-packages/boto/ec2/securitygroup.py&quot;, line 203, in authorize
    dry_run=dry_run)
  File &quot;/Library/Python/2.7/site-packages/boto/ec2/connection.py&quot;, line 3191, in authorize_security_group
    params, verb='POST')
  File &quot;/Library/Python/2.7/site-packages/boto/connection.py&quot;, line 1226, in get_status
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;Response&gt;&lt;Errors&gt;&lt;Error&gt;&lt;Code&gt;InvalidPermission.Duplicate&lt;/Code&gt;&lt;Message&gt;The permission '5495791-1-8080-8080' has already been authorized on the specified group&lt;/Message&gt;&lt;/Error&gt;&lt;/Errors&gt;&lt;RequestID&gt;eff6ddd3-5752-45d0-a4d7-b0e6fc3e1820&lt;/RequestID&gt;&lt;/Response&gt;"><pre class="notranslate"><code class="notranslate">  File "/Users/zytek/.ansible/tmp/ansible-tmp-1425034576.71-249532590752251/ec2_group", line 2181, in &lt;module&gt;
    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
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Response&gt;&lt;Errors&gt;&lt;Error&gt;&lt;Code&gt;InvalidPermission.Duplicate&lt;/Code&gt;&lt;Message&gt;The permission '5495791-1-8080-8080' has already been authorized on the specified group&lt;/Message&gt;&lt;/Error&gt;&lt;/Errors&gt;&lt;RequestID&gt;eff6ddd3-5752-45d0-a4d7-b0e6fc3e1820&lt;/RequestID&gt;&lt;/Response&gt;
</code></pre></div>
<p dir="auto">Both AWS SG config and ansible playbook were in sync when it comes to entries.<br>
Adding new SG and populating it worker fine, just the second run was not working, as AWS API complains about duplicated entries.</p>
<p dir="auto">The workaround here was to change 'group_name: some-name' to 'group_id: sg-xxxx'</p>
<p dir="auto">Steps to reproduce:</p>
<p dir="auto">Expected result:<br>
No changes to SG entries</p>
<p dir="auto">Actual result:<br>
Error about duplicate entries</p>