tripleo-ansible/tripleo_ansible/playbooks/tripleo_nova_image_cache.yml

58 lines
2.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: TripleO Nova image cache management
hosts: "{{ tripleo_nova_image_cache_plan + '_nova_compute' if tripleo_nova_image_cache_plan|default('') else 'nova_compute'}}"
environment:
# export everything in overcloudrc for openstacksdk
NOVA_VERSION: "{{ lookup('env', 'NOVA_VERSION') }}"
COMPUTE_API_VERSION: "{{ lookup('env', 'COMPUTE_API_VERSION') }}"
OS_USERNAME: "{{ lookup('env', 'OS_USERNAME') }}"
OS_PROJECT_NAME: "{{ lookup('env', 'OS_PROJECT_NAME') }}"
OS_USER_DOMAIN_NAME: "{{ lookup('env', 'OS_USER_DOMAIN_NAME') }}"
OS_PROJECT_DOMAIN_NAME: "{{ lookup('env', 'OS_PROJECT_DOMAIN_NAME') }}"
OS_NO_CACHE: "{{ lookup('env', 'OS_NO_CACHE') }}"
no_proxy: "{{ lookup('env', 'no_proxy') }}"
OS_AUTH_TYPE: "{{ lookup('env', 'OS_AUTH_TYPE') }}"
OS_PASSWORD: "{{ lookup('env', 'OS_PASSWORD') }}"
OS_AUTH_URL: "{{ lookup('env', 'OS_AUTH_URL') }}"
OS_IDENTITY_API_VERSION: "{{ lookup('env', 'OS_IDENTITY_API_VERSION') }}"
OS_IMAGE_API_VERSION: "{{ lookup('env', 'OS_IMAGE_API_VERSION') }}"
OS_VOLUME_API_VERSION: "{{ lookup('env', 'OS_VOLUME_API_VERSION') }}"
OS_REGION_NAME: "{{ lookup('env', 'OS_REGION_NAME') }}"
roles:
- role: tripleo_nova_image_cache
# Standard inventory:
#
# ansible-playbook -i inventory.yml --extra-vars "@test_args1.yml" tripleo_nova_image_cache.yml
# test_args1.yml
# tripleo_nova_image_cache_images:
# - id: d23c6b8f-e166-4a02-afd8-0ae8d6f73f18
# - id: 81bbb16-d589-4730-be70-822a82ab6bb9
#
# Multi-stack inventory:
#
# ansible-playbook -i inventory_multi.yml --extra-vars "@test_args2.yml" tripleo_nova_image_cache.yml
# test_args2.yml:
# tripleo_nova_image_cache_plan: edge0
# tripleo_nova_image_cache_images:
# - id: d23c6b8f-e166-4a02-afd8-0ae8d6f73f18
# - id: 81bbb16-d589-4730-be70-822a82ab6bb9
# tripleo_nova_image_cache_use_proxy: true
# tripleo_nova_image_cache_proxy_hostname: compute-1 # optional, first nova_compute host is used otherwise
#