Browse Source

Merge "Add a boolean to allow disk overrides through NodeDataLookup"

changes/50/788350/1
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
b2b29b8013
3 changed files with 50 additions and 20 deletions
  1. +25
    -18
      deployment/swift/swift-ringbuilder-container-puppet.yaml
  2. +23
    -2
      deployment/swift/swift-storage-container-puppet.yaml
  3. +2
    -0
      puppet/extraconfig/pre_deploy/per_node.yaml

+ 25
- 18
deployment/swift/swift-ringbuilder-container-puppet.yaml View File

@ -54,6 +54,10 @@ parameters:
default: true
description: 'Use a local directory for Swift storage services when building rings'
type: boolean
SwiftUseNodeDataLookup:
default: false
description: Use NodeDataLookup for disk devices in order to use persistent naming
type: boolean
SwiftRingGetTempurl:
default: ''
description: A temporary Swift URL to download rings from.
@ -85,24 +89,27 @@ outputs:
value:
service_name: swift_ringbuilder
config_settings:
tripleo::profile::base::swift::ringbuilder::skip_consistency_check: true
tripleo::profile::base::swift::ringbuilder::swift_ring_get_tempurl: {get_param: SwiftRingGetTempurl}
tripleo::profile::base::swift::ringbuilder::swift_ring_put_tempurl: {get_param: SwiftRingPutTempurl}
tripleo::profile::base::swift::ringbuilder::build_ring: {get_param: SwiftRingBuild}
tripleo::profile::base::swift::ringbuilder::replicas: {get_param: SwiftReplicas}
tripleo::profile::base::swift::ringbuilder::part_power: {get_param: SwiftPartPower}
tripleo::profile::base::swift::ringbuilder::min_part_hours: {get_param: SwiftMinPartHours}
tripleo::profile::base::swift::ringbuilder::raw_disk_prefix: 'r1z1-'
tripleo::profile::base::swift::ringbuilder::raw_disks:
yaql:
expression: $.data.raw_disk_lists.flatten()
data:
raw_disk_lists:
- {if: [swift_use_local_dir, [':%PORT%/d1'], []]}
- repeat:
template: ':%PORT%/DEVICE'
for_each:
DEVICE: {get_param: SwiftRawDisks}
map_merge:
- tripleo::profile::base::swift::ringbuilder::skip_consistency_check: true
tripleo::profile::base::swift::ringbuilder::swift_ring_get_tempurl: {get_param: SwiftRingGetTempurl}
tripleo::profile::base::swift::ringbuilder::swift_ring_put_tempurl: {get_param: SwiftRingPutTempurl}
tripleo::profile::base::swift::ringbuilder::build_ring: {get_param: SwiftRingBuild}
tripleo::profile::base::swift::ringbuilder::replicas: {get_param: SwiftReplicas}
tripleo::profile::base::swift::ringbuilder::part_power: {get_param: SwiftPartPower}
tripleo::profile::base::swift::ringbuilder::min_part_hours: {get_param: SwiftMinPartHours}
tripleo::profile::base::swift::ringbuilder::raw_disk_prefix: 'r1z1-'
- if:
- {get_param: SwiftUseNodeDataLookup}
- {}
- tripleo::profile::base::swift::ringbuilder::raw_disks:
list_concat:
- if:
- swift_use_local_dir
- - ':%PORT%/d1'
- repeat:
template: ':%PORT%/DEVICE'
for_each:
DEVICE: {get_param: SwiftRawDisks}
service_config_settings: {}
# BEGIN DOCKER SETTINGS
puppet_config:


+ 23
- 2
deployment/swift/swift-storage-container-puppet.yaml View File

@ -62,6 +62,10 @@ parameters:
default: false
description: Value of mount_check in Swift account/container/object -server.conf
type: boolean
SwiftUseNodeDataLookup:
default: false
description: Use NodeDataLookup for disk devices in order to use persistent naming
type: boolean
SwiftAccountWorkers:
default: 0
description: Number of workers for Swift account service.
@ -118,6 +122,7 @@ conditions:
account_workers_zero: {equals : [{get_param: SwiftAccountWorkers}, '0']}
container_workers_zero: {equals : [{get_param: SwiftContainerWorkers}, '0']}
object_workers_zero: {equals : [{get_param: SwiftObjectWorkers}, '0']}
use_node_data_lookup: {equals : [{get_param: SwiftUseNodeDataLookup}, true]}
resources:
@ -169,8 +174,12 @@ outputs:
- healthcheck
- recon
- account-server
swift::storage::disks::args: {get_param: SwiftRawDisks}
swift::storage::all::storage_local_net_ip:
-
if:
- use_node_data_lookup
- {}
- swift::storage::disks::args: {get_param: SwiftRawDisks}
- swift::storage::all::storage_local_net_ip:
str_replace:
template:
"%{hiera('$NETWORK')}"
@ -619,6 +628,9 @@ outputs:
- name: Set swift_use_local_disks fact
set_fact:
swift_use_local_disks: {get_param: SwiftUseLocalDir}
- name: Set use_node_data_lookup fact
set_fact:
use_node_data_lookup: {get_param: SwiftUseNodeDataLookup}
- name: Create Swift d1 directory if needed
file:
path: "/srv/node/d1"
@ -627,6 +639,15 @@ outputs:
- name: Set fact for SwiftRawDisks
set_fact:
swift_raw_disks: {get_param: SwiftRawDisks}
when: not use_node_data_lookup|bool
- name: Get hiera swift::storage::disks::args
shell: hiera -c /etc/puppet/hiera.yaml swift::storage::disks::args | sed =e 's/=>/:/g'
register: hiera_output
when: use_node_data_lookup|bool
- name: Set fact for swift_raw_disks
set_fact:
swift_raw_disks: "{{ hiera_output.stdout | from_json }}"
when: use_node_data_lookup|bool
- name: Format SwiftRawDisks
filesystem:
fstype: xfs


+ 2
- 0
puppet/extraconfig/pre_deploy/per_node.yaml View File

@ -55,6 +55,7 @@ resources:
cnt = ast.literal_eval(input)
print(json.dumps(cnt.get('${node_id}', {})))
" > /etc/puppet/hieradata/${node_id}.json
echo "- ${node_id}" >> /etc/puppet/hiera.yaml
# handle upper case node id LP#1816652
echo $node_lookup | $(get_python) -c "
import ast
@ -67,6 +68,7 @@ resources:
cnt = ast.literal_eval(input)
print(json.dumps(cnt.get('${node_id_upper}', {})))
" > /etc/puppet/hieradata/${node_id_upper}.json
echo "- ${node_id_upper}" >> /etc/puppet/hiera.yaml
NodeSpecificDeployment:
type: OS::Heat::SoftwareDeployment


Loading…
Cancel
Save