Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit bd64494b authored by Youssef BOUFNICHEL's avatar Youssef BOUFNICHEL
Browse files

:bug: fix list of unsued images in clean_docker_images role

parent 9cbcdf8f
No related branches found
Tags v0.53.3
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- name: "Fetch unused Docker Image from Netbox " - name: "Fetch unused Docker Image from Netbox "
ansible.builtin.set_fact: ansible.builtin.set_fact:
unused_images_ids: | unused_images_id: |
{{ {{
[ [
lookup( lookup(
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
api_filter='containers=null name=' + rps_images_prefix, api_filter='containers=null name=' + rps_images_prefix,
) )
] | flatten ] | flatten
| community.general.json_query('[*].value.id') | community.general.json_query('[].value.{id: id}')
| list | list
}} }}
...@@ -27,8 +27,7 @@ ...@@ -27,8 +27,7 @@
Authorization: "Token {{ netbox_token }}" Authorization: "Token {{ netbox_token }}"
Content-Type: "application/json" Content-Type: "application/json"
validate_certs: false validate_certs: false
body: body: "{{ unused_images_id }}"
ids: "{{ unused_images_ids }}"
body_format: json body_format: json
return_content: true return_content: true
status_code: 204 status_code: 204
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment