openstack-ansible-os_ironic/tasks/ironic_deploy_image.yml
Dmitriy Rabotyagov 9ad3fd7681 Auto-fix usage of modules via FQCN
Since ansible-core 2.10 it is recommended to use modules via FQCN
In order to align with recommendation, we perform migration
by applying suggestions made by `ansible-lint --fix=fqcn`

Change-Id: Ib3dafb476992c0c75ae1b3cc84024463641a0775
2025-02-12 12:45:21 +01:00

53 lines
1.9 KiB
YAML

---
# Copyright 2022, BBC R&D
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# We set the python interpreter to the ansible runtime venv if
# the delegation is to localhost so that we get access to the
# appropriate python libraries in that venv. If the delegation
# is to another host, we assume that it is accessible by the
# system python instead.
- name: Setup the deploy image
delegate_to: "{{ ironic_service_setup_host }}"
vars:
ansible_python_interpreter: "{{ ironic_service_setup_host_python_interpreter }}"
block:
- name: Create image download directory
ansible.builtin.file:
path: "{{ ironic_deploy_image_path }}"
state: directory
mode: "0750"
owner: "{{ ironic_deploy_image_path_owner }}"
- name: Download image from artefact server
ansible.builtin.get_url:
url: "{{ item['url'] }}"
dest: "{{ ironic_deploy_image_path }}"
checksum: "sha256:{{ item['sha_url'] }}"
mode: "0644"
retries: 10
delay: 10
register: ironic_download_results
with_items: "{{ ironic_deploy_image_list + ironic_extra_deploy_image_list }}"
- name: Upload images
openstack.cloud.image:
cloud: default
endpoint_type: admin
name: "{{ item.item.name }}"
container_format: "{{ item.item.container_format }}"
disk_format: "{{ item.item.disk_format }}"
filename: "{{ item.dest }}"
with_items: "{{ ironic_download_results.results }}"