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: Mapping of service endpoint -> protocol. Typically set
19 via parameter_defaults in the resource registry.
23 description: Number of workers for EC2-API service.
26 description: The password for the nova service and db account, used by nova-api.
32 description: Keystone region for endpoint
33 Ec2ApiExternalNetwork:
36 description: Name of the external network, which is used to connect VPCs to
37 Internet and to allocate Elastic IPs
38 NovaDefaultFloatingPool:
40 description: Default pool for floating IP addresses
42 MonitoringSubscriptionEc2Api:
43 default: 'overcloud-ec2-api'
48 tag: openstack.ec2.api
49 path: /var/log/ec2api/ec2api.log
52 description: Set to true to enable package installation via Puppet
56 A hash of policies to configure for EC2-API.
57 e.g. { ec2api-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
63 nova_workers_zero: {equals : [{get_param: Ec2ApiWorkers}, 0]}
64 external_network_unset: {equals : [{get_param: Ec2ApiExternalNetwork}, '']}
68 description: Role data for the EC2-API service.
71 monitoring_subscription: {get_param: MonitoringSubscriptionEc2Api}
72 logging_source: {get_param: Ec2ApiLoggingSource}
77 - tripleo.ec2_api.firewall_rules:
82 ec2api::keystone::authtoken::project_name: 'service'
83 ec2api::keystone::authtoken::password: {get_param: Ec2ApiPassword}
84 ec2api::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri] }
85 ec2api::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
86 ec2api::policy::policies: {get_param: Ec2ApiPolicies}
87 ec2api::api::enabled: true
88 ec2api::package_manage: {get_param: EnablePackageInstall}
89 ec2api::api::ec2api_listen:
92 "%{hiera('fqdn_$NETWORK')}"
94 $NETWORK: {get_param: [ServiceNetMap, Ec2ApiNetwork]}
95 ec2api::metadata::metadata_listen:
98 "%{hiera('fqdn_$NETWORK')}"
100 $NETWORK: {get_param: [ServiceNetMap, Ec2ApiMetadataNetwork]}
101 ec2api::db::database_connection:
103 scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
105 password: {get_param: Ec2ApiPassword}
106 host: {get_param: [EndpointMap, MysqlInternal, host]}
109 read_default_file: /etc/my.cnf.d/tripleo.cnf
110 read_default_group: tripleo
111 ec2api::api::keystone_ec2_tokens_url:
114 - - {get_param: [EndpointMap, KeystoneV3Internal, uri]}
120 - ec2api::api::ec2api_workers: {get_param: Ec2ApiWorkers}
121 ec2api::metadata::metadata_workers: {get_param: Ec2ApiWorkers}
124 - external_network_unset
125 - ec2api::api::external_network: {get_param: NovaDefaultFloatingPool}
126 - ec2api::api::external_network: {get_param: Ec2ApiExternalNetwork}
128 include tripleo::profile::base::nova::ec2api
129 service_config_settings:
131 ec2api::keystone::auth::tenant: 'service'
132 ec2api::keystone::auth::public_url: {get_param: [EndpointMap, Ec2ApiPublic, uri]}
133 ec2api::keystone::auth::internal_url: {get_param: [EndpointMap, Ec2ApiInternal, uri]}
134 ec2api::keystone::auth::admin_url: {get_param: [EndpointMap, Ec2ApiAdmin, uri]}
135 ec2api::keystone::auth::password: {get_param: Ec2ApiPassword}
136 ec2api::keystone::auth::region: {get_param: KeystoneRegion}
138 ec2api::db::mysql::password: {get_param: Ec2ApiPassword}
139 ec2api::db::mysql::user: ec2_api
140 ec2api::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
141 ec2api::db::mysql::dbname: ec2_api
142 ec2api::db::mysql::allowed_hosts:
144 - "%{hiera('mysql_bind_host')}"
146 - name: Check if ec2-api is deployed
147 command: systemctl is-enabled openstack-ec2-api
150 register: ec2_api_enabled
151 - name: "PreUpgrade step0,validation: Check if openstack-ec2-api is running"
153 /usr/bin/systemctl show 'openstack-ec2-api' --property ActiveState |
155 when: ec2_api_enabled.rc == 0
156 tags: step0,validation
157 - name: Stop openstack-ec2-api service
159 when: ec2_api_enabled.rc == 0
160 service: name=openstack-ec2-api state=stopped
161 - name: Install openstack-ec2-api package if it was disabled
163 yum: name=openstack-ec2-api state=latest
164 when: ec2_api_enabled.rc != 0