Merge "Add network_data.yaml to encapsulate list of networks for j2"
[apex-tripleo-heat-templates.git] / puppet / services / ceph-rgw.yaml
1 heat_template_version: ocata
2
3 description: >
4   Ceph RadosGW service.
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   AdminToken:
22     description: The keystone auth secret and db password.
23     type: string
24     hidden: true
25   CephRgwKey:
26     description: The cephx key for the radosgw client. Can be created
27                  with ceph-authtool --gen-print-key.
28     type: string
29     hidden: true
30   SwiftPassword:
31     description: The password for the swift service account, used by the Ceph RGW services.
32     type: string
33     hidden: true
34   KeystoneRegion:
35     type: string
36     default: 'regionOne'
37     description: Keystone region for endpoint
38
39 resources:
40   CephBase:
41     type: ./ceph-base.yaml
42     properties:
43       ServiceNetMap: {get_param: ServiceNetMap}
44       DefaultPasswords: {get_param: DefaultPasswords}
45       EndpointMap: {get_param: EndpointMap}
46
47 outputs:
48   role_data:
49     description: Role data for the Ceph RadosGW service.
50     value:
51       service_name: ceph_rgw
52       config_settings:
53         map_merge:
54           - get_attr: [CephBase, role_data, config_settings]
55           - tripleo::profile::base::ceph::rgw::rgw_key: {get_param: CephRgwKey}
56             tripleo::profile::base::ceph::rgw::keystone_admin_token: {get_param: AdminToken}
57             tripleo::profile::base::ceph::rgw::keystone_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
58             tripleo::profile::base::ceph::rgw::civetweb_bind_ip: {get_param: [ServiceNetMap, CephRgwNetwork]}
59             tripleo::profile::base::ceph::rgw::civetweb_bind_port: {get_param: [EndpointMap, CephRgwInternal, port]}
60             tripleo::profile::base::ceph::rgw::rgw_keystone_version: v3
61             ceph::profile::params::rgw_keystone_admin_domain: default
62             ceph::profile::params::rgw_keystone_admin_project: service
63             ceph::profile::params::rgw_keystone_admin_user: swift
64             ceph::profile::params::rgw_keystone_admin_password: {get_param: SwiftPassword}
65             tripleo.ceph_rgw.firewall_rules:
66               '122 ceph rgw':
67                 dport: {get_param: [EndpointMap, CephRgwInternal, port]}
68       step_config: |
69         include ::tripleo::profile::base::ceph::rgw
70       service_config_settings:
71         keystone:
72           ceph::rgw::keystone::auth::public_url: {get_param: [EndpointMap, CephRgwPublic, uri]}
73           ceph::rgw::keystone::auth::internal_url: {get_param: [EndpointMap, CephRgwInternal, uri]}
74           ceph::rgw::keystone::auth::admin_url: {get_param: [EndpointMap, CephRgwAdmin, uri]}
75           ceph::rgw::keystone::auth::region: {get_param: KeystoneRegion}
76           ceph::rgw::keystone::auth::roles: [ 'admin', 'Member', '_member_' ]
77           ceph::rgw::keystone::auth::tenant: service
78           ceph::rgw::keystone::auth::user: swift
79           ceph::rgw::keystone::auth::password: {get_param: SwiftPassword}
80       upgrade_tasks:
81         - name: Gather RGW instance ID
82           tags: common
83           shell: hiera -c /etc/puppet/hiera.yaml ceph::profile::params::rgw_name radosgw.gateway
84           register: rgw_id
85         - name: Check if ceph_rgw is deployed
86           command: systemctl is-enabled ceph-radosgw@{{rgw_id.stdout}}
87           tags: common
88           ignore_errors: True
89           register: ceph_rgw_enabled
90         - name: Check status
91           shell: /usr/bin/systemctl show ceph-radosgw@{{rgw_id.stdout}} --property ActiveState | grep '\bactive\b'
92           when: ceph_rgw_enabled.rc == 0
93           tags: step0,validation
94         - name: Stop RGW instance
95           tags: step1
96           when: ceph_rgw_enabled.rc == 0
97           service:
98             name: ceph-radosgw@{{rgw_id.stdout}}
99             state: stopped