Merge "Add network_data.yaml to encapsulate list of networks for j2"
[apex-tripleo-heat-templates.git] / puppet / services / swift-ringbuilder.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack Swift Ringbuilder
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   EndpointMap:
17     default: {}
18     description: Mapping of service endpoint -> protocol. Typically set
19                  via parameter_defaults in the resource registry.
20     type: json
21   SwiftMinPartHours:
22     type: number
23     default: 1
24     description: The minimum time (in hours) before a partition in a ring can be moved following a rebalance.
25   SwiftPartPower:
26     default: 10
27     description: Partition Power to use when building Swift rings
28     type: number
29   SwiftRingBuild:
30     default: true
31     description: Whether to manage Swift rings or not
32     type: boolean
33   SwiftReplicas:
34     type: number
35     default: 3
36     description: How many replicas to use in the swift rings.
37   SwiftRawDisks:
38     default: {}
39     description: 'A hash of additional raw devices to use as Swift backend (eg. {sdb: {}})'
40     type: json
41   SwiftUseLocalDir:
42     default: true
43     description: 'Use a local directory for Swift storage services when building rings'
44     type: boolean
45   SwiftRingGetTempurl:
46     default: ''
47     description: A temporary Swift URL to download rings from.
48     type: string
49   SwiftRingPutTempurl:
50     default: ''
51     description: A temporary Swift URL to upload rings to.
52     type: string
53
54 conditions:
55   swift_use_local_dir:
56     and:
57     - equals:
58       - get_param: SwiftUseLocalDir
59       - true
60     - equals:
61       - get_param: SwiftRawDisks
62       - {}
63
64 outputs:
65   role_data:
66     description: Role data for Swift Ringbuilder configuration.
67     value:
68       service_name: swift_ringbuilder
69       config_settings:
70         tripleo::profile::base::swift::ringbuilder::swift_ring_get_tempurl: {get_param: SwiftRingGetTempurl}
71         tripleo::profile::base::swift::ringbuilder::swift_ring_put_tempurl: {get_param: SwiftRingPutTempurl}
72         tripleo::profile::base::swift::ringbuilder::build_ring: {get_param: SwiftRingBuild}
73         tripleo::profile::base::swift::ringbuilder::replicas: {get_param: SwiftReplicas}
74         tripleo::profile::base::swift::ringbuilder::part_power: {get_param: SwiftPartPower}
75         tripleo::profile::base::swift::ringbuilder::min_part_hours: {get_param: SwiftMinPartHours}
76         tripleo::profile::base::swift::ringbuilder::raw_disk_prefix: 'r1z1-'
77         tripleo::profile::base::swift::ringbuilder::raw_disks:
78           yaql:
79             expression: $.data.raw_disk_lists.flatten()
80             data:
81               raw_disk_lists:
82               - {if: [swift_use_local_dir, [':%PORT%/d1'], []]}
83               - repeat:
84                   template: ':%PORT%/DEVICE'
85                   for_each:
86                     DEVICE: {get_param: SwiftRawDisks}
87       step_config: |
88         include ::tripleo::profile::base::swift::ringbuilder