# How can tell my docker\_container module to always pull an Image only sometimes when i specify using extra vars or something

**URL:** <https://forum.ansible.com/t/how-can-tell-my-docker-container-module-to-always-pull-an-image-only-sometimes-when-i-specify-using-extra-vars-or-something/23136>\
**Category:** Ansible Project\
**Created:** [November 30, 2016, 12:30pm UTC](https://forum.ansible.com/t/how-can-tell-my-docker-container-module-to-always-pull-an-image-only-sometimes-when-i-specify-using-extra-vars-or-something/23136 "2016-11-30T12:30:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ishan\_jain](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@ishan\_jain](https://forum.ansible.com/u/ishan_jain)\
**Post date:** [November 30, 2016, 12:30pm UTC](https://forum.ansible.com/t/how-can-tell-my-docker-container-module-to-always-pull-an-image-only-sometimes-when-i-specify-using-extra-vars-or-something/23136/1 "2016-11-30T12:30:01Z")

</div>

I have a number of playbooks each related to starting a container for a microservice using docker\_container module. I supply the variables like image name from the outside using YAML var files. Since we never update a tagged image in our repo, we have deliberately not used “pull: always” in the module as it will pull image if absent anyways and there will never be an update to that image ever. This is the reason that i don’t want to change that for a specific scenario i have encountered.

I am working on experimental images for these microservices and i am using the same playbooks to install them. Now there is a single tag for these experimental images and it keeps on updating in the repo and to handle that, i need to tell the docker\_container module to always pull. I do not wish to change the scripts but i have the flexibility to provide extra vars to the playbook. I cannot even do something like adding the pull: {{var}} to the playbooks with the default value of var as false but changing it to true in my case. The original scripts shall remain untouched.

**How can i tell the docker\_container to always pull with the help of extra vars.**

Maybe i should ask a more generic question. It will be cool if this is possible.

**How can i override/add the values of parameters of a module inside the playbook/role with the help of extra vars ?**

---

<div class="post-metadata">

**Author:** ![ishan\_jain](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@ishan\_jain](https://forum.ansible.com/u/ishan_jain)\
**Post date:** [December 5, 2016, 1:00pm UTC](https://forum.ansible.com/t/how-can-tell-my-docker-container-module-to-always-pull-an-image-only-sometimes-when-i-specify-using-extra-vars-or-something/23136/2 "2016-12-05T13:00:24Z")

</div>

Bump!!  
There is got to be some trick involved but i can’t think of any.
