1 heat_template_version: pike
4 OpenStack EC2-API service configured with Puppet
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.
18 description: Role name on which the service is applied
22 description: Parameters specific to the role
26 description: Mapping of service endpoint -> protocol. Typically set
27 via parameter_defaults in the resource registry.
31 description: Number of workers for EC2-API service.
34 description: The password for the nova service and db account, used by nova-api.
40 description: Keystone region for endpoint
41 Ec2ApiExternalNetwork:
44 description: Name of the external network, which is used to connect VPCs to
45 Internet and to allocate Elastic IPs
46 NovaDefaultFloatingPool:
48 description: Default pool for floating IP addresses
50 MonitoringSubscriptionEc2Api:
51 default: 'overcloud-ec2-api'
56 tag: openstack.ec2.api
57 path: /var/log/ec2api/ec2api.log
60 description: Set to true to enable package installation via Puppet
64 A hash of policies to configure for EC2-API.
65 e.g. { ec2api-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
71 nova_workers_zero: {equals : [{get_param: Ec2ApiWorkers}, 0]}
72 external_network_unset: {equals : [{get_param: Ec2ApiExternalNetwork}, '']}
76 description: Role data for the EC2-API service.
79 monitoring_subscription: {get_param: MonitoringSubscriptionEc2Api}
80 logging_source: {get_param: Ec2ApiLoggingSource}
85 - tripleo.ec2_api.firewall_rules:
90 ec2api::keystone::authtoken::project_name: 'service'
91 ec2api::keystone::authtoken::password: {get_param: Ec2ApiPassword}
92 ec2api::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri] }
93 ec2api::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
94 ec2api::policy::policies: {get_param: Ec2ApiPolicies}
95 ec2api::api::enabled: true
96 ec2api::package_manage: {get_param: EnablePackageInstall}
97 ec2api::api::ec2api_listen:
100 "%{hiera('fqdn_$NETWORK')}"
102 $NETWORK: {get_param: [ServiceNetMap, Ec2ApiNetwork]}
103 ec2api::metadata::metadata_listen:
106 "%{hiera('fqdn_$NETWORK')}"
108 $NETWORK: {get_param: [ServiceNetMap, Ec2ApiMetadataNetwork]}
109 ec2api::db::database_connection:
111 scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
113 password: {get_param: Ec2ApiPassword}
114 host: {get_param: [EndpointMap, MysqlInternal, host]}
117 read_default_file: /etc/my.cnf.d/tripleo.cnf
118 read_default_group: tripleo
119 ec2api::api::keystone_ec2_tokens_url:
122 - - {get_param: [EndpointMap, KeystoneV3Internal, uri]}
128 - ec2api::api::ec2api_workers: {get_param: Ec2ApiWorkers}
129 ec2api::metadata::metadata_workers: {get_param: Ec2ApiWorkers}
132 - external_network_unset
133 - ec2api::api::external_network: {get_param: NovaDefaultFloatingPool}
134 - ec2api::api::external_network: {get_param: Ec2ApiExternalNetwork}
136 include tripleo::profile::base::nova::ec2api
137 service_config_settings:
139 ec2api::keystone::auth::tenant: 'service'
140 ec2api::keystone::auth::public_url: {get_param: [EndpointMap, Ec2ApiPublic, uri]}
141 ec2api::keystone::auth::internal_url: {get_param: [EndpointMap, Ec2ApiInternal, uri]}
142 ec2api::keystone::auth::admin_url: {get_param: [EndpointMap, Ec2ApiAdmin, uri]}
143 ec2api::keystone::auth::password: {get_param: Ec2ApiPassword}
144 ec2api::keystone::auth::region: {get_param: KeystoneRegion}
146 ec2api::db::mysql::password: {get_param: Ec2ApiPassword}
147 ec2api::db::mysql::user: ec2_api
148 ec2api::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
149 ec2api::db::mysql::dbname: ec2_api
150 ec2api::db::mysql::allowed_hosts:
152 - "%{hiera('mysql_bind_host')}"
154 - name: Check if ec2-api is deployed
155 command: systemctl is-enabled openstack-ec2-api
158 register: ec2_api_enabled
159 - name: "PreUpgrade step0,validation: Check if openstack-ec2-api is running"
161 /usr/bin/systemctl show 'openstack-ec2-api' --property ActiveState |
163 when: ec2_api_enabled.rc == 0
164 tags: step0,validation
165 - name: Stop openstack-ec2-api service
167 when: ec2_api_enabled.rc == 0
168 service: name=openstack-ec2-api state=stopped
169 - name: Install openstack-ec2-api package if it was disabled
171 yum: name=openstack-ec2-api state=latest
172 when: ec2_api_enabled.rc != 0