0e8eacf1bfdceeb89de337d885e990c602146606
[apex-tripleo-heat-templates.git] / puppet / services / ironic-api.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Ironic API configured with Puppet
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   RoleName:
17     default: ''
18     description: Role name on which the service is applied
19     type: string
20   RoleParameters:
21     default: {}
22     description: Parameters specific to the role
23     type: json
24   EndpointMap:
25     default: {}
26     description: Mapping of service endpoint -> protocol. Typically set
27                  via parameter_defaults in the resource registry.
28     type: json
29   IronicPassword:
30     description: The password for the Ironic service and db account, used by the Ironic services
31     type: string
32     hidden: true
33   MonitoringSubscriptionIronicApi:
34     default: 'overcloud-ironic-api'
35     type: string
36   KeystoneRegion:
37     type: string
38     default: 'regionOne'
39     description: Keystone region for endpoint
40   IronicApiPolicies:
41     description: |
42       A hash of policies to configure for Ironic API.
43       e.g. { ironic-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
44     default: {}
45     type: json
46   EnableInternalTLS:
47     type: boolean
48     default: false
49
50 resources:
51   ApacheServiceBase:
52     type: ./apache.yaml
53     properties:
54       ServiceNetMap: {get_param: ServiceNetMap}
55       DefaultPasswords: {get_param: DefaultPasswords}
56       EndpointMap: {get_param: EndpointMap}
57       RoleName: {get_param: RoleName}
58       RoleParameters: {get_param: RoleParameters}
59       EnableInternalTLS: {get_param: EnableInternalTLS}
60
61   IronicBase:
62     type: ./ironic-base.yaml
63     properties:
64       ServiceNetMap: {get_param: ServiceNetMap}
65       DefaultPasswords: {get_param: DefaultPasswords}
66       EndpointMap: {get_param: EndpointMap}
67       RoleName: {get_param: RoleName}
68       RoleParameters: {get_param: RoleParameters}
69
70 outputs:
71   role_data:
72     description: Role data for the Ironic API role.
73     value:
74       service_name: ironic_api
75       monitoring_subscription: {get_param: MonitoringSubscriptionIronicApi}
76       config_settings:
77         map_merge:
78           - get_attr: [IronicBase, role_data, config_settings]
79           - get_attr: [ApacheServiceBase, role_data, config_settings]
80           - ironic::api::authtoken::password: {get_param: IronicPassword}
81             ironic::api::authtoken::project_name: 'service'
82             ironic::api::authtoken::user_domain_name: 'Default'
83             ironic::api::authtoken::project_domain_name: 'Default'
84             ironic::api::authtoken::username: 'ironic'
85             ironic::api::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix] }
86             ironic::api::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
87             # NOTE: bind IP is found in Heat replacing the network name with the
88             # local node IP for the given network; replacement examples
89             # (eg. for internal_api):
90             # internal_api -> IP
91             # internal_api_uri -> [IP]
92             # internal_api_subnet - > IP/CIDR
93             ironic::api::host_ip: {get_param: [ServiceNetMap, IronicApiNetwork]}
94             ironic::api::port: {get_param: [EndpointMap, IronicInternal, port]}
95             # This is used to build links in responses
96             ironic::api::public_endpoint: {get_param: [EndpointMap, IronicPublic, uri_no_suffix]}
97             ironic::api::service_name: 'httpd'
98             ironic::policy::policies: {get_param: IronicApiPolicies}
99             ironic::wsgi::apache::bind_host: {get_param: [ServiceNetMap, IronicApiNetwork]}
100             ironic::wsgi::apache::port: {get_param: [EndpointMap, IronicInternal, port]}
101             ironic::wsgi::apache::servername:
102               str_replace:
103                 template:
104                   "%{hiera('fqdn_$NETWORK')}"
105                 params:
106                   $NETWORK: {get_param: [ServiceNetMap, IronicApiNetwork]}
107             ironic::wsgi::apache::ssl: {get_param: EnableInternalTLS}
108             tripleo.ironic_api.firewall_rules:
109               '133 ironic api':
110                 dport:
111                   - 6385
112                   - 13385
113       step_config: |
114         include ::tripleo::profile::base::ironic::api
115       service_config_settings:
116         keystone:
117           ironic::keystone::auth::admin_url: {get_param: [EndpointMap, IronicAdmin, uri_no_suffix]}
118           ironic::keystone::auth::internal_url: {get_param: [EndpointMap, IronicInternal, uri_no_suffix]}
119           ironic::keystone::auth::public_url: {get_param: [EndpointMap, IronicPublic, uri_no_suffix]}
120           ironic::keystone::auth::auth_name: 'ironic'
121           ironic::keystone::auth::password: {get_param: IronicPassword }
122           ironic::keystone::auth::tenant: 'service'
123           ironic::keystone::auth::region: {get_param: KeystoneRegion}
124         mysql:
125           ironic::db::mysql::password: {get_param: IronicPassword}
126           ironic::db::mysql::user: ironic
127           ironic::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
128           ironic::db::mysql::dbname: ironic
129           ironic::db::mysql::allowed_hosts:
130             - '%'
131             - "%{hiera('mysql_bind_host')}"
132       upgrade_tasks:
133         - name: Stop ironic_api service (before httpd support)
134           tags: step1
135           service: name=openstack-ironic-api state=stopped enabled=no
136         - name: Stop ironic_api service (running under httpd)
137           tags: step1
138           service: name=httpd state=stopped