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