Change flat network name for nosdn fdio scenario
[apex-tripleo-heat-templates.git] / puppet / services / ceph-rgw.yaml
1 heat_template_version: pike
2
3 description: >
4   Ceph RadosGW service.
5
6 parameters:
7   ServiceData:
8     default: {}
9     description: Dictionary packing service data
10     type: json
11   ServiceNetMap:
12     default: {}
13     description: Mapping of service_name -> network name. Typically set
14                  via parameter_defaults in the resource registry.  This
15                  mapping overrides those in ServiceNetMapDefaults.
16     type: json
17   DefaultPasswords:
18     default: {}
19     type: json
20   RoleName:
21     default: ''
22     description: Role name on which the service is applied
23     type: string
24   RoleParameters:
25     default: {}
26     description: Parameters specific to the role
27     type: json
28   EndpointMap:
29     default: {}
30     description: Mapping of service endpoint -> protocol. Typically set
31                  via parameter_defaults in the resource registry.
32     type: json
33   AdminToken:
34     description: The keystone auth secret and db password.
35     type: string
36     hidden: true
37   CephRgwKey:
38     description: The cephx key for the radosgw client. Can be created
39                  with ceph-authtool --gen-print-key.
40     type: string
41     hidden: true
42   SwiftPassword:
43     description: The password for the swift service account
44     type: string
45     hidden: true
46   KeystoneRegion:
47     type: string
48     default: 'regionOne'
49     description: Keystone region for endpoint
50
51 resources:
52   CephBase:
53     type: ./ceph-base.yaml
54     properties:
55       ServiceData: {get_param: ServiceData}
56       ServiceNetMap: {get_param: ServiceNetMap}
57       DefaultPasswords: {get_param: DefaultPasswords}
58       EndpointMap: {get_param: EndpointMap}
59       RoleName: {get_param: RoleName}
60       RoleParameters: {get_param: RoleParameters}
61
62 outputs:
63   role_data:
64     description: Role data for the Ceph RadosGW service.
65     value:
66       service_name: ceph_rgw
67       config_settings:
68         map_merge:
69           - get_attr: [CephBase, role_data, config_settings]
70           - tripleo::profile::base::ceph::rgw::rgw_key: {get_param: CephRgwKey}
71             tripleo::profile::base::ceph::rgw::keystone_admin_token: {get_param: AdminToken}
72             tripleo::profile::base::ceph::rgw::keystone_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
73             tripleo::profile::base::ceph::rgw::civetweb_bind_ip: {get_param: [ServiceNetMap, CephRgwNetwork]}
74             tripleo::profile::base::ceph::rgw::civetweb_bind_port: {get_param: [EndpointMap, CephRgwInternal, port]}
75             tripleo::profile::base::ceph::rgw::rgw_keystone_version: v3
76             ceph::profile::params::rgw_keystone_admin_domain: default
77             ceph::profile::params::rgw_keystone_admin_project: service
78             ceph::profile::params::rgw_keystone_admin_user: swift
79             ceph::profile::params::rgw_keystone_admin_password: {get_param: SwiftPassword}
80             tripleo.ceph_rgw.firewall_rules:
81               '122 ceph rgw':
82                 dport: {get_param: [EndpointMap, CephRgwInternal, port]}
83       step_config: |
84         include ::tripleo::profile::base::ceph::rgw
85       service_config_settings:
86         keystone:
87           ceph::rgw::keystone::auth::public_url: {get_param: [EndpointMap, CephRgwPublic, uri]}
88           ceph::rgw::keystone::auth::internal_url: {get_param: [EndpointMap, CephRgwInternal, uri]}
89           ceph::rgw::keystone::auth::admin_url: {get_param: [EndpointMap, CephRgwAdmin, uri]}
90           ceph::rgw::keystone::auth::region: {get_param: KeystoneRegion}
91           ceph::rgw::keystone::auth::roles: [ 'admin', 'Member', '_member_' ]
92           ceph::rgw::keystone::auth::tenant: service
93           ceph::rgw::keystone::auth::user: swift
94           ceph::rgw::keystone::auth::password: {get_param: SwiftPassword}
95       upgrade_tasks:
96         - name: Gather RGW instance ID
97           tags: common
98           shell: hiera -c /etc/puppet/hiera.yaml ceph::profile::params::rgw_name radosgw.gateway
99           register: rgw_id
100         - name: Check if ceph_rgw is deployed
101           command: systemctl is-enabled ceph-radosgw@{{rgw_id.stdout}}
102           tags: common
103           ignore_errors: True
104           register: ceph_rgw_enabled
105         - name: Check status
106           shell: /usr/bin/systemctl show ceph-radosgw@{{rgw_id.stdout}} --property ActiveState | grep '\bactive\b'
107           when: ceph_rgw_enabled.rc == 0
108           tags: step0,validation
109         - name: Stop RGW instance
110           tags: step1
111           when: ceph_rgw_enabled.rc == 0
112           service:
113             name: ceph-radosgw@{{rgw_id.stdout}}
114             state: stopped