Merge "Exposing the ability to enable/disable the repository"
[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
61 conditions:
62   neutron_workers_unset: {equals : [{get_param: NeutronWorkers}, '']}
63
64 resources:
65
66   NeutronBase:
67     type: ./neutron-base.yaml
68     properties:
69       ServiceData: {get_param: ServiceData}
70       ServiceNetMap: {get_param: ServiceNetMap}
71       DefaultPasswords: {get_param: DefaultPasswords}
72       EndpointMap: {get_param: EndpointMap}
73       RoleName: {get_param: RoleName}
74       RoleParameters: {get_param: RoleParameters}
75
76 outputs:
77   role_data:
78     description: Role data for the Neutron Metadata agent service.
79     value:
80       service_name: neutron_metadata
81       monitoring_subscription: {get_param: MonitoringSubscriptionNeutronMetadata}
82       logging_source: {get_param: NeutronMetadataAgentLoggingSource}
83       logging_groups:
84         - neutron
85       config_settings:
86         map_merge:
87           - get_attr: [NeutronBase, role_data, config_settings]
88           - neutron::agents::metadata::shared_secret: {get_param: NeutronMetadataProxySharedSecret}
89             neutron::agents::metadata::auth_password: {get_param: NeutronPassword}
90             neutron::agents::metadata::auth_url: { get_param: [EndpointMap, KeystoneInternal, uri_no_suffix] }
91             neutron::agents::metadata::auth_tenant: 'service'
92             neutron::agents::metadata::metadata_ip: "%{hiera('nova_metadata_vip')}"
93           -
94             if:
95             - neutron_workers_unset
96             - {}
97             - neutron::agents::metadata::metadata_workers: {get_param: NeutronWorkers}
98       step_config: |
99         include tripleo::profile::base::neutron::metadata
100       upgrade_tasks:
101         - name: Check if neutron_metadata_agent is deployed
102           command: systemctl is-enabled neutron-metadata-agent
103           tags: common
104           ignore_errors: True
105           register: neutron_metadata_agent_enabled
106         - name: "PreUpgrade step0,validation: Check service neutron-metadata-agent is running"
107           shell: /usr/bin/systemctl show 'neutron-metadata-agent' --property ActiveState | grep '\bactive\b'
108           when: neutron_metadata_agent_enabled.rc == 0
109           tags: step0,validation
110         - name: Stop neutron_metadata service
111           tags: step1
112           when: neutron_metadata_agent_enabled.rc == 0
113           service: name=neutron-metadata-agent state=stopped