Docker_image : Error loading image Specified path does not exist. (The path being perfectly fine)

47 views
Skip to first unread message

Frédéric Lauzin

unread,
Aug 23, 2023, 11:17:47 AM8/23/23
to Ansible Project
Hi !
Hope everyone is doing well,

I downloaded grafana image from docker hub.

I generated my .tar using : 
sudo docker save -o /path/grafana_image.tar grafana/grafana:latest

I am using a role to define grafana, here is the docker_image part (i tryed relative path using role_path, but for debugging purpose i specified absolute path) :
- name: Load Grafana image
  docker_image:
    name: grafana/grafana:latest
    load_path: /path/grafana_image.tar
    source: load
  become: true


I defined somes specific permissions :
ll /path/grafana_image.tar
-r--r----- 1 user user /path/grafana_image.tar

And now if i launch ansible-playbook :
TASK [grafana : Load Grafana image]
fatal: [monitoring]: FAILED! => {"changed": false, "msg": "Error loading image grafana/grafana. Specified path /path/grafana_image.tar does not exist."}


If i check the path its completely fine :
ll /path/grafana_image.tar
-r--r----- 1 user user /path/grafana_image.tar


So as you can see it doest not make any sense, i tryed with chmod 770, relative/absolute path, regenerating .tar but nothing seems to work,

Do you have any idea about what could be wrong here ?

Felix Fontein

unread,
Aug 23, 2023, 4:28:34 PM8/23/23
to ansible...@googlegroups.com
Hi,

does /path/grafana_image.tar exist on the target where the module is
executed? Or do you only have it on the controller where ansible itself
is running?

The file needs to be on the target for the module to use it. If it
isn't there yet, you need to use the ansible.builtin.copy module to
copy it to the target first.

Cheers,
Felix



On Wed, 23 Aug 2023 08:12:36 -0700 (PDT)
Frédéric Lauzin <lauz...@gmail.com> wrote:

> Hi !
> Hope everyone is doing well,
>
> I downloaded grafana image from docker hub.
>
> I generated my .tar using :
> *sudo docker save -o /path/grafana_image.tar grafana/grafana:latest*
>
> I am using a role to define grafana, here is the docker_image part (i
> tryed relative path using role_path, but for debugging purpose i
> specified absolute path) :
>
>
>
>
>
> *- name: Load Grafana image docker_image: name:
> grafana/grafana:latest load_path: /path/grafana_image.tar
> source: load become: true*
>
> I defined somes specific permissions :
> *ll /path/grafana_image.tar*
> *-r--r----- 1 user user /path/grafana_image.tar*
>
> And now if i launch ansible-playbook :
>
> *TASK [grafana : Load Grafana image] fatal: [monitoring]: FAILED! =>
> {"changed": false, "msg": "Error loading image grafana/grafana.
> Specified path /path/grafana_image.tar does not exist."}*
>
> If i check the path its completely fine :
>
> *ll /path/grafana_image.tar-r--r----- 1 user user
> /path/grafana_image.tar*

Frédéric Lauzin

unread,
Aug 24, 2023, 9:26:23 AM8/24/23
to Ansible Project
Hi Felix Fontain !

Thank you very much that must be that since i just have the .tar locally where i run Ansible,
It's obvious now you say that !

Best regards,
Reply all
Reply to author
Forward
0 new messages