Add role specific information to the service template
[apex-tripleo-heat-templates.git] / puppet / services / neutron-l3.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack Neutron L3 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   Debug:
30     type: string
31     default: ''
32   NeutronL3AgentMode:
33     description: |
34       Agent mode for L3 agent. Must be one of legacy or dvr_snat.
35     default: 'legacy'
36     type: string
37     constraints:
38       - allowed_values:
39         - legacy
40         - dvr_snat
41   MonitoringSubscriptionNeutronL3:
42     default: 'overcloud-neutron-l3-agent'
43     type: string
44   NeutronL3AgentLoggingSource:
45     type: json
46     default:
47       tag: openstack.neutron.agent.l3
48       path: /var/log/neutron/l3-agent.log
49
50   # DEPRECATED: the following options are deprecated and are currently maintained
51   # for backwards compatibility. They will be removed in the Pike cycle.
52   NeutronExternalNetworkBridge:
53     description: Name of bridge used for external network traffic. Usually L2
54                  agent handles port wiring into external bridge, and hence the
55                  parameter should be unset.
56     type: string
57     default: ''
58
59 conditions:
60
61   external_network_bridge_empty: {equals : [{get_param: NeutronExternalNetworkBridge}, "''"]}
62
63 resources:
64
65   NeutronBase:
66     type: ./neutron-base.yaml
67     properties:
68       ServiceNetMap: {get_param: ServiceNetMap}
69       DefaultPasswords: {get_param: DefaultPasswords}
70       EndpointMap: {get_param: EndpointMap}
71       RoleName: {get_param: RoleName}
72       RoleParameters: {get_param: RoleParameters}
73
74 outputs:
75   role_data:
76     description: Role data for the Neutron L3 agent service.
77     value:
78       service_name: neutron_l3
79       monitoring_subscription: {get_param: MonitoringSubscriptionNeutronL3}
80       logging_source: {get_param: NeutronL3AgentLoggingSource}
81       logging_groups:
82         - neutron
83       config_settings:
84         map_merge:
85         - get_attr: [NeutronBase, role_data, config_settings]
86         - neutron::agents::l3::agent_mode: {get_param: NeutronL3AgentMode}
87           tripleo.neutron_l3.firewall_rules:
88             '106 neutron_l3 vrrp':
89               proto: vrrp
90         -
91           if:
92           - external_network_bridge_empty
93           - {}
94           - neutron::agents::l3::external_network_bridge: {get_param: NeutronExternalNetworkBridge}
95       step_config: |
96         include tripleo::profile::base::neutron::l3
97       upgrade_tasks:
98         - name: Check if neutron_l3_agent is deployed
99           command: systemctl is-enabled neutron-l3-agent
100           tags: common
101           ignore_errors: True
102           register: neutron_l3_agent_enabled
103         - name: "PreUpgrade step0,validation: Check service neutron-l3-agent is running"
104           shell: /usr/bin/systemctl show 'neutron-l3-agent' --property ActiveState | grep '\bactive\b'
105           when: neutron_l3_agent_enabled.rc == 0
106           tags: step0,validation
107         - name: Stop neutron_l3 service
108           tags: step1
109           when: neutron_l3_agent_enabled.rc == 0
110           service: name=neutron-l3-agent state=stopped