Merge "Open ports 443 and 80 on haproxy's firewall when horizon is standalone"
[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   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   NeutronMetadataProxySharedSecret:
30     description: Shared secret to prevent spoofing
31     type: string
32     hidden: true
33   NeutronWorkers:
34     default: ''
35     description: |
36       Sets the number of worker processes for the neutron metadata agent. The
37       default value results in the configuration being left unset and a
38       system-dependent default will be chosen (usually the number of
39       processors). Please note that this can result in a large number of
40       processes and memory consumption on systems with a large core count. On
41       such systems it is recommended that a non-default value be selected that
42       matches the load requirements.
43     type: string
44   NeutronPassword:
45     description: The password for the neutron service and db account, used by neutron agents.
46     type: string
47     hidden: true
48   MonitoringSubscriptionNeutronMetadata:
49     default: 'overcloud-neutron-metadata'
50     type: string
51   NeutronMetadataAgentLoggingSource:
52     type: json
53     default:
54       tag: openstack.neutron.agent.metadata
55       path: /var/log/neutron/metadata-agent.log
56
57 conditions:
58   neutron_workers_unset: {equals : [{get_param: NeutronWorkers}, '']}
59
60 resources:
61
62   NeutronBase:
63     type: ./neutron-base.yaml
64     properties:
65       ServiceNetMap: {get_param: ServiceNetMap}
66       DefaultPasswords: {get_param: DefaultPasswords}
67       EndpointMap: {get_param: EndpointMap}
68       RoleName: {get_param: RoleName}
69       RoleParameters: {get_param: RoleParameters}
70
71 outputs:
72   role_data:
73     description: Role data for the Neutron Metadata agent service.
74     value:
75       service_name: neutron_metadata
76       monitoring_subscription: {get_param: MonitoringSubscriptionNeutronMetadata}
77       logging_source: {get_param: NeutronMetadataAgentLoggingSource}
78       logging_groups:
79         - neutron
80       config_settings:
81         map_merge:
82           - get_attr: [NeutronBase, role_data, config_settings]
83           - neutron::agents::metadata::shared_secret: {get_param: NeutronMetadataProxySharedSecret}
84             neutron::agents::metadata::auth_password: {get_param: NeutronPassword}
85             neutron::agents::metadata::auth_url: { get_param: [EndpointMap, KeystoneInternal, uri_no_suffix] }
86             neutron::agents::metadata::auth_tenant: 'service'
87             neutron::agents::metadata::metadata_ip: "%{hiera('nova_metadata_vip')}"
88           -
89             if:
90             - neutron_workers_unset
91             - {}
92             - neutron::agents::metadata::metadata_workers: {get_param: NeutronWorkers}
93       step_config: |
94         include tripleo::profile::base::neutron::metadata
95       upgrade_tasks:
96         - name: Check if neutron_metadata_agent is deployed
97           command: systemctl is-enabled neutron-metadata-agent
98           tags: common
99           ignore_errors: True
100           register: neutron_metadata_agent_enabled
101         - name: "PreUpgrade step0,validation: Check service neutron-metadata-agent is running"
102           shell: /usr/bin/systemctl show 'neutron-metadata-agent' --property ActiveState | grep '\bactive\b'
103           when: neutron_metadata_agent_enabled.rc == 0
104           tags: step0,validation
105         - name: Stop neutron_metadata service
106           tags: step1
107           when: neutron_metadata_agent_enabled.rc == 0
108           service: name=neutron-metadata-agent state=stopped