Change flat network name for nosdn fdio scenario
[apex-tripleo-heat-templates.git] / puppet / services / neutron-metadata.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Neutron Metadata agent configured with Puppet
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   NeutronMetadataProxySharedSecret:
34     description: Shared secret to prevent spoofing
35     type: string
36     hidden: true
37   NeutronWorkers:
38     default: ''
39     description: |
40       Sets the number of worker processes for the neutron metadata agent. The
41       default value results in the configuration being left unset and a
42       system-dependent default will be chosen (usually the number of
43       processors). Please note that this can result in a large number of
44       processes and memory consumption on systems with a large core count. On
45       such systems it is recommended that a non-default value be selected that
46       matches the load requirements.
47     type: string
48   NeutronPassword:
49     description: The password for the neutron service and db account, used by neutron agents.
50     type: string
51     hidden: true
52   MonitoringSubscriptionNeutronMetadata:
53     default: 'overcloud-neutron-metadata'
54     type: string
55   NeutronMetadataAgentLoggingSource:
56     type: json
57     default:
58       tag: openstack.neutron.agent.metadata
59       path: /var/log/neutron/metadata-agent.log
60   EnableInternalTLS:
61     type: boolean
62     default: false
63
64 conditions:
65   neutron_workers_unset: {equals : [{get_param: NeutronWorkers}, '']}
66
67   internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
68
69 resources:
70
71   NeutronBase:
72     type: ./neutron-base.yaml
73     properties:
74       ServiceData: {get_param: ServiceData}
75       ServiceNetMap: {get_param: ServiceNetMap}
76       DefaultPasswords: {get_param: DefaultPasswords}
77       EndpointMap: {get_param: EndpointMap}
78       RoleName: {get_param: RoleName}
79       RoleParameters: {get_param: RoleParameters}
80
81 outputs:
82   role_data:
83     description: Role data for the Neutron Metadata agent service.
84     value:
85       service_name: neutron_metadata
86       monitoring_subscription: {get_param: MonitoringSubscriptionNeutronMetadata}
87       logging_source: {get_param: NeutronMetadataAgentLoggingSource}
88       logging_groups:
89         - neutron
90       config_settings:
91         map_merge:
92           - get_attr: [NeutronBase, role_data, config_settings]
93           - neutron::agents::metadata::shared_secret: {get_param: NeutronMetadataProxySharedSecret}
94             neutron::agents::metadata::auth_password: {get_param: NeutronPassword}
95             neutron::agents::metadata::auth_url: { get_param: [EndpointMap, KeystoneInternal, uri_no_suffix] }
96             neutron::agents::metadata::auth_tenant: 'service'
97             neutron::agents::metadata::metadata_ip: "%{hiera('nova_metadata_vip')}"
98             neutron::agents::metadata::metadata_host:
99               str_replace:
100                 template:
101                   "%{hiera('cloud_name_$NETWORK')}"
102                 params:
103                   $NETWORK: {get_param: [ServiceNetMap, NovaMetadataNetwork]}
104             neutron::agents::metadata::metadata_protocol:
105               if:
106               - internal_tls_enabled
107               - 'https'
108               - 'http'
109           -
110             if:
111             - neutron_workers_unset
112             - {}
113             - neutron::agents::metadata::metadata_workers: {get_param: NeutronWorkers}
114       step_config: |
115         include tripleo::profile::base::neutron::metadata
116       upgrade_tasks:
117         - name: Check if neutron_metadata_agent is deployed
118           command: systemctl is-enabled neutron-metadata-agent
119           tags: common
120           ignore_errors: True
121           register: neutron_metadata_agent_enabled
122         - name: "PreUpgrade step0,validation: Check service neutron-metadata-agent is running"
123           shell: /usr/bin/systemctl show 'neutron-metadata-agent' --property ActiveState | grep '\bactive\b'
124           when: neutron_metadata_agent_enabled.rc == 0
125           tags: step0,validation
126         - name: Stop neutron_metadata service
127           tags: step1
128           when: neutron_metadata_agent_enabled.rc == 0
129           service: name=neutron-metadata-agent state=stopped