tripleo-ansible/tripleo_ansible/roles/tripleo_nova_image_cache/tasks/cache.yml

41 lines
1.5 KiB
YAML

---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# 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.
- name: Show proxy host
debug:
msg: "Proxy host is {{ tripleo_nova_image_cache_proxy_hostname }}"
run_once: true
when:
- tripleo_nova_image_cache_use_proxy | bool
- name: "Cache image {{ image.id }}"
become: true
tripleo_nova_image_cache:
id: "{{ image.id }}"
any_errors_fatal: "{{ true if tripleo_nova_image_cache_use_proxy and tripleo_nova_image_cache_is_proxy_host else false }}"
when:
- not (tripleo_nova_image_cache_use_proxy | bool) or (tripleo_nova_image_cache_is_proxy_host | bool)
- name: "Cache image (via proxy) {{ image.id }}"
become: true
tripleo_nova_image_cache:
id: "{{ image.id }}"
scp_source: "{{ tripleo_nova_image_cache_proxy_source_ip }}"
scp_continue_on_error: "{{ tripleo_nova_image_cache_ignore_proxy_error }}"
when:
- tripleo_nova_image_cache_use_proxy | bool
- not (tripleo_nova_image_cache_is_proxy_host | bool)