Add an experimental test container volume create service
This adds a test volume service that can be used to create a basic container volume on the host during step 2. This volume has been added to the scenario002 standalone to exercise thie opt volume configurations that we expose for heat. Related-Bug: #1843734 Change-Id: Ia8fa1750bbd9a9b528050e074e55005af480b4f5
This commit is contained in:
parent
4d802f1cc7
commit
c1f7facac0
@ -24,7 +24,10 @@ resource_registry:
|
||||
# Some infra instances don't pass the ping test but are otherwise working.
|
||||
# Since the OVB jobs also test this functionality we can shut it off here.
|
||||
OS::TripleO::AllNodes::Validation: ../common/all-nodes-validation-disabled.yaml
|
||||
OS::TripleO::Services::Horizon: OS::Heat::None
|
||||
# NOTE(mwhahaha): cheat and use the horizon "service" for our test service
|
||||
# since disable horizon. This allows us to not have to keep some test service
|
||||
# in the defaults just for this case.
|
||||
OS::TripleO::Services::Horizon: ../../deployment/tests/test-container-volume.yaml
|
||||
|
||||
parameter_defaults:
|
||||
StandaloneExtraConfig:
|
||||
@ -49,3 +52,17 @@ parameter_defaults:
|
||||
SwiftCeilometerPipelineEnabled: false
|
||||
BarbicanSimpleCryptoGlobalDefault: true
|
||||
ContainerCli: podman
|
||||
# Test mounting a container volume into the heat api container
|
||||
ContainerTestVolumeName: test_volume
|
||||
CinderVolumeOptVolumes:
|
||||
- test_volume:/testvol
|
||||
GlanceApiOptVolumes:
|
||||
- test_volume:/testvol
|
||||
HeatApiOptVolumes:
|
||||
- test_volume:/testvol
|
||||
HeatEngineApiOptVolumes:
|
||||
- test_volume:/testvol
|
||||
NeutronApiOptVolumes:
|
||||
- test_volume:/testvol
|
||||
NovaComputeOptVolumes:
|
||||
- test_volume:/testvol
|
||||
|
72
deployment/tests/test-container-volume.yaml
Normal file
72
deployment/tests/test-container-volume.yaml
Normal file
@ -0,0 +1,72 @@
|
||||
heat_template_version: rocky
|
||||
|
||||
description: >
|
||||
Configures a test container volume
|
||||
|
||||
parameters:
|
||||
EndpointMap:
|
||||
default: {}
|
||||
description: Mapping of service endpoint -> protocol. Typically set
|
||||
via parameter_defaults in the resource registry.
|
||||
type: json
|
||||
ServiceData:
|
||||
default: {}
|
||||
description: Dictionary packing service data
|
||||
type: json
|
||||
ServiceNetMap:
|
||||
default: {}
|
||||
description: Mapping of service_name -> network name. Typically set
|
||||
via parameter_defaults in the resource registry. This
|
||||
mapping overrides those in ServiceNetMapDefaults.
|
||||
type: json
|
||||
DefaultPasswords:
|
||||
default: {}
|
||||
type: json
|
||||
RoleName:
|
||||
default: ''
|
||||
description: Role name on which the service is applied
|
||||
type: string
|
||||
RoleParameters:
|
||||
default: {}
|
||||
description: Parameters specific to the role
|
||||
type: json
|
||||
ContainerCli:
|
||||
type: string
|
||||
default: 'podman'
|
||||
description: CLI tool used to manage containers.
|
||||
constraints:
|
||||
- allowed_values: ['docker', 'podman']
|
||||
ContainerTestVolumeName:
|
||||
type: string
|
||||
default: 'testvolume'
|
||||
description: Name of the test volume to create
|
||||
|
||||
outputs:
|
||||
role_data:
|
||||
description: Role data for a test container volume
|
||||
value:
|
||||
service_name: test_container_volume
|
||||
config_settings: {}
|
||||
step_config: ''
|
||||
service_config_settings: {}
|
||||
deploy_steps_tasks:
|
||||
- name: Manage test container volume
|
||||
when:
|
||||
- step|int == 2
|
||||
block:
|
||||
- name: Create Test Volume facts
|
||||
set_fact:
|
||||
test_container_cli: {get_param: ContainerCli}
|
||||
test_container_volume_name: {get_param: ContainerTestVolumeName}
|
||||
- name: Check if volume exists
|
||||
become: true
|
||||
shell: |
|
||||
{{ test_container_cli }} volume list -q | grep -q "{{ test_container_volume_name }}"
|
||||
register: test_container_list
|
||||
failed_when: false
|
||||
- name: Create volume
|
||||
become: true
|
||||
when:
|
||||
- test_container_list.rc == 1
|
||||
shell: >
|
||||
{{ test_container_cli }} volume create {{ test_container_volume_name }}
|
Loading…
Reference in New Issue
Block a user