Would anyone be kind enough to help me?
I'm continuing to have issues with this after an update. I'm running an ansible playbook with each service defined as a role and individual tasks bringing up the containers.
Experiencing error this error: 'container.image_config['ContainerConfig'].get('Volumes') or {}' and it is recreating my containers with hashed names e.g. 419bbc4d6207_grafana
I have the below task in defined under my role.
- name: Run docker compose for Grafana
docker_compose:
Here is a full traceback.
File "/tmp/ansible_docker_compose_payload_on1b18vl/ansible_docker_compose_payload.zip/ansible_collections/community/docker/plugins/modules/docker_compose.py", line 865, in cmd_up
File "/usr/local/lib/python3.10/dist-packages/compose/project.py", line 697, in up
results, errors = parallel.parallel_execute(
File "/usr/local/lib/python3.10/dist-packages/compose/parallel.py", line 108, in parallel_execute
raise error_to_reraise
File "/usr/local/lib/python3.10/dist-packages/compose/parallel.py", line 206, in producer
result = func(obj)
File "/usr/local/lib/python3.10/dist-packages/compose/project.py", line 679, in do
return service.execute_convergence_plan(
File "/usr/local/lib/python3.10/dist-packages/compose/service.py", line 579, in execute_convergence_plan
return self._execute_convergence_recreate(
File "/usr/local/lib/python3.10/dist-packages/compose/service.py", line 499, in _execute_convergence_recreate
containers, errors = parallel_execute(
File "/usr/local/lib/python3.10/dist-packages/compose/parallel.py", line 108, in parallel_execute
raise error_to_reraise
File "/usr/local/lib/python3.10/dist-packages/compose/parallel.py", line 206, in producer
result = func(obj)
File "/usr/local/lib/python3.10/dist-packages/compose/service.py", line 494, in recreate
return self.recreate_container(
File "/usr/local/lib/python3.10/dist-packages/compose/service.py", line 612, in recreate_container
new_container = self.create_container(
File "/usr/local/lib/python3.10/dist-packages/compose/service.py", line 330, in create_container
container_options = self._get_container_create_options(
File "/usr/local/lib/python3.10/dist-packages/compose/service.py", line 921, in _get_container_create_options
container_options, override_options = self._build_container_volume_options(
File "/usr/local/lib/python3.10/dist-packages/compose/service.py", line 960, in _build_container_volume_options
binds, affinity = merge_volume_bindings(
File "/usr/local/lib/python3.10/dist-packages/compose/service.py", line 1548, in merge_volume_bindings
old_volumes, old_mounts = get_container_data_volumes(
File "/usr/local/lib/python3.10/dist-packages/compose/service.py", line 1579, in get_container_data_volumes
container.image_config['ContainerConfig'].get('Volumes') or {}
fatal: [localhost]: FAILED! => {
"changed": false,
"errors": [],
"invocation": {
"module_args": {
"api_version": "auto",
"build": false,
"ca_path": null,
"client_cert": null,
"client_key": null,
"debug": false,
"definition": null,
"dependencies": true,
"docker_host": "unix:///var/run/docker.sock",
"env_file": null,
"files": null,
"hostname_check": false,
"nocache": false,
"profiles": null,
"project_name": null,
"project_src": "/home/x/github/ans_play/roles/grafana/",
"pull": false,
"recreate": "smart",
"remove_images": null,
"remove_orphans": false,
"remove_volumes": false,
"restarted": false,
"scale": null,
"services": null,
"ssl_version": null,
"state": "present",
"stopped": false,
"timeout": null,
"tls": false,
"tls_hostname": null,
"use_ssh_client": false,
"validate_certs": false
}
},
"module_stderr": "Recreating 419bbc4d6207_grafana ... \n",
"module_stdout": "",
"msg": "Error starting project 'ContainerConfig'"
}