Auto-set SwiftMountCheck and SwiftUseLocalDir settings

This patch automatically sets the options SwiftMountCheck and
SwiftUseLocalDir depending on SwiftRawDisks.

If SwiftRawDisks is set, the usage of a local directory will be
automatically disabled in the ringbuilder and the mount check option
will be enabled.

Change-Id: If58cecc94c25603f50411ffe60ad24c104147c66
This commit is contained in:
Christian Schwede 2016-12-21 10:06:44 +00:00
parent 384c400d47
commit f6511ece5f
2 changed files with 23 additions and 2 deletions

View File

@ -43,6 +43,16 @@ parameters:
description: 'Use a local directory for Swift storage services when building rings' description: 'Use a local directory for Swift storage services when building rings'
type: boolean type: boolean
conditions:
swift_use_local_dir:
and:
- equals:
- get_param: SwiftUseLocalDir
- true
- equals:
- get_param: SwiftRawDisks
- {}
outputs: outputs:
role_data: role_data:
description: Role data for Swift Ringbuilder configuration. description: Role data for Swift Ringbuilder configuration.
@ -59,7 +69,7 @@ outputs:
expression: $.data.raw_disk_lists.flatten() expression: $.data.raw_disk_lists.flatten()
data: data:
raw_disk_lists: raw_disk_lists:
- {if: [{get_param: SwiftUseLocalDir}, [':%PORT%/d1'], []]} - {if: [swift_use_local_dir, [':%PORT%/d1'], []]}
- repeat: - repeat:
template: ':%PORT%/DEVICE' template: ':%PORT%/DEVICE'
for_each: for_each:

View File

@ -56,6 +56,17 @@ resources:
DefaultPasswords: {get_param: DefaultPasswords} DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap} EndpointMap: {get_param: EndpointMap}
conditions:
swift_mount_check:
or:
- equals:
- get_param: SwiftMountCheck
- true
- not:
equals:
- get_param: SwiftRawDisks
- {}
outputs: outputs:
role_data: role_data:
description: Role data for the Swift Proxy role. description: Role data for the Swift Proxy role.
@ -65,7 +76,7 @@ outputs:
config_settings: config_settings:
map_merge: map_merge:
- get_attr: [SwiftBase, role_data, config_settings] - get_attr: [SwiftBase, role_data, config_settings]
- swift::storage::all::mount_check: {get_param: SwiftMountCheck} - swift::storage::all::mount_check: {if: [swift_mount_check, true, false]}
tripleo::profile::base::swift::storage::enable_swift_storage: {get_param: ControllerEnableSwiftStorage} tripleo::profile::base::swift::storage::enable_swift_storage: {get_param: ControllerEnableSwiftStorage}
tripleo.swift_storage.firewall_rules: tripleo.swift_storage.firewall_rules:
'123 swift storage': '123 swift storage':