# docker\_image  state: absent leaves images as untagged ??

**URL:** <https://forum.ansible.com/t/docker-image-state-absent-leaves-images-as-untagged/28134>\
**Category:** Ansible Project\
**Created:** [July 24, 2018, 11:53am UTC](https://forum.ansible.com/t/docker-image-state-absent-leaves-images-as-untagged/28134 "2018-07-24T11:53:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Albert\_Shamsiyan](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Albert\_Shamsiyan](https://forum.ansible.com/u/Albert_Shamsiyan)\
**Post date:** [July 24, 2018, 11:53am UTC](https://forum.ansible.com/t/docker-image-state-absent-leaves-images-as-untagged/28134/1 "2018-07-24T11:53:12Z")

</div>

Hi,

After successful execution of the following code, I can see that the images are left in untagged state. What am I doing wrong??

- name: Remove image  
docker\_image:  
state: absent  
name: [docker.mycomp.com/myapp/myapp\_fe](http://docker.mycomp.com/myapp/myapp_fe)  
tag: “{{ item }}”  
with\_sequence:  
start=0 end=150 stride=1

THX - Albert

---

<div class="post-metadata">

**Author:** ![Albert\_Shamsiyan](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Albert\_Shamsiyan](https://forum.ansible.com/u/Albert_Shamsiyan)\
**Post date:** [July 24, 2018, 11:56am UTC](https://forum.ansible.com/t/docker-image-state-absent-leaves-images-as-untagged/28134/2 "2018-07-24T11:56:30Z")

</div>

I’m using ansible 2.5.0

---

<div class="post-metadata">

**Author:** ![Albert\_Shamsiyan](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Albert\_Shamsiyan](https://forum.ansible.com/u/Albert_Shamsiyan)\
**Post date:** [July 24, 2018, 3:35pm UTC](https://forum.ansible.com/t/docker-image-state-absent-leaves-images-as-untagged/28134/3 "2018-07-24T15:35:20Z")

</div>

Adding force: yes have solved the issue which persoanly, i dont see any reason for this behaviour. Why should I leave untagged image on my machine? anyway …

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [July 24, 2018, 4:27pm UTC](https://forum.ansible.com/t/docker-image-state-absent-leaves-images-as-untagged/28134/4 "2018-07-24T16:27:10Z")

</div>

Hi,

> Adding force: yes have solved the issue which persoanly, i dont see  
> any reason for this behaviour. Why should I leave untagged image on  
> my machine? anyway ..

I think you should create an issue on github for this  
([https://github.com/ansible/ansible/issues/new/choose](https://github.com/ansible/ansible/issues/new/choose)).

The behavior will probably not change (as there's aready the  
distinction between force=no and force=yes), but the documentation  
could be improved. To me, it was not clear from reading it that with  
force=no, the image is simply untagged (the documentation mentions  
"removed").

Cheers,  
Felix
