Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

docker_image

ANSIBLE VERSION

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

CONFIGURATION

None

OS / ENVIRONMENT

N/A

SUMMARY

Pulling a docker image without force=yes always returns unchanged even if the image have newest version on DockerHub.

But if I use force=yes workaround - it always returns changed, even if I already have latest image version.

So, I think it must be another flag, something like pull=always or same, to always pull latest image, but stay unchanged, if nothing to do.

STEPS TO REPRODUCE

The following task always return changed even when the image is in its latest version.

tasks:
- name: Download busybox image
docker_image: name=busybox state=present force=yes

But running docker pull from shell you could tell if the image was updated or not

# docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox

56bec22e3559: Pull complete
Digest: sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912
Status: Downloaded newer image for busybox:latest

# docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox

Digest: sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912
Status: Image is up to date for busybox:latest

EXPECTED RESULTS

It should return unchanged if the image was not updated.

ACTUAL RESULTS

TASK [Download Download busybox image] *********************************
Thursday 03 November 2016 11:03:34 -0500 (0:00:00.567) 0:00:00.580 *****
changed: [example.com] => {"actions": ["Pulled image busybox:latest"], "changed": true, "image": {"Architecture": "amd64", "Author": "", "Comment": "", "Config": {"AttachStderr": false, "AttachStdin": false, "AttachStdout": false, "Cmd": ["sh"], "Domainname": "", "Entrypoint": null, "Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"], "Hostname": "4a74292706a0", "Image": "sha256:1679bae2167496818312013654f5c66a16e185d0a0f6b762b53c8558014457c6", "Labels": {}, "OnBuild": null, "OpenStdin": false, "StdinOnce": false, "Tty": false, "User": "", "Volumes": null, "WorkingDir": ""}, "Container": "8bb318a3b4672c53a1747991c95fff3306eea13ec308740ebe0c81b56ece530f", "ContainerConfig": {"AttachStderr": false, "AttachStdin": false, "AttachStdout": false, "Cmd": ["/bin/sh", "-c", "#(nop) ", "CMD [\"sh\"]"], "Domainname": "", "Entrypoint": null, "Env": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"], "Hostname": "4a74292706a0", "Image": "sha256:1679bae2167496818312013654f5c66a16e185d0a0f6b762b53c8558014457c6", "Labels": {}, "OnBuild": null, "OpenStdin": false, "StdinOnce": false, "Tty": false, "User": "", "Volumes": null, "WorkingDir": ""}, "Created": "2016-10-07T21:03:58.469866982Z", "DockerVersion": "1.12.1", "GraphDriver": {"Data": null, "Name": "aufs"}, "Id": "sha256:e02e811dd08fd49e7f6032625495118e63f597eb150403d02e3238af1df240ba", "Os": "linux", "Parent": "", "RepoDigests": ["busybox@sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912"], "RepoTags": ["busybox:latest"], "RootFS": {"Layers": ["sha256:e88b3f82283bc59d5e0df427c824e9f95557e661fcb0ea15fb0fb6f97760f9d9"], "Type": "layers"}, "Size": 1093484, "VirtualSize": 1093484}}

Related issues

It is maybe duplicate of ansible/ansible-modules-core#5489 , but is seems, that repo is locked, so I want to remind about it.

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

shell module and check mode

ANSIBLE VERSION

[root@localhost ~]# ansible --version
ansible 1.9.4

CONFIGURATION

Tested with default ansible.cfg.

OS / ENVIRONMENT

CentOS release 6.7 (Final) up-to-date.

SUMMARY

Looks like we get two task statuses when running the shell module with --check.

STEPS TO REPRODUCE

Use the following inventory file:

[local]
127.0.0.1 ansible_connection=local ansible_python_interpreter='/usr/bin/env python'

On the following playbook:

[root@localhost ~]# cat check.yml

---

- hosts: all
tasks:
- name: 'Fail if not run with --check'
shell: 'exit 1'

Invoke with the following and get...:

[root@localhost ~]# ansible-playbook -i inventory check.yml --check

PLAY [all] ********************************************************************

GATHERING FACTS ***************************************************************
ok: [127.0.0.1]

TASK: [Fail if not run with --check] ******************************************
skipping: [127.0.0.1]
ok: [127.0.0.1]

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

EXPECTED RESULTS

For our task to be "skipped" (this is what happens under ans-v2 at least).

ACTUAL RESULTS

Task reported as both 'ok' and 'skipped.'