Merge "Store role_data in an OS::Heat::Value resource"
[apex-tripleo-heat-templates.git] / puppet / services / neutron-l2gw-agent.yaml
1 heat_template_version: pike
2
3 description: >
4   L2 Gateway agent configured with Puppet
5 parameters:
6   ServiceNetMap:
7     default: {}
8     description: Mapping of service_name -> network name. Typically set
9                  via parameter_defaults in the resource registry.  This
10                  mapping overrides those in ServiceNetMapDefaults.
11     type: json
12   DefaultPasswords:
13     default: {}
14     type: json
15   RoleName:
16     default: ''
17     description: Role name on which the service is applied
18     type: string
19   RoleParameters:
20     default: {}
21     description: Parameters specific to the role
22     type: json
23   EndpointMap:
24     default: {}
25     description: Mapping of service endpoint -> protocol. Typically set
26                  via parameter_defaults in the resource registry.
27     type: json
28   L2gwAgentOvsdbHosts:
29     default: ''
30     description: L2 gateway agent OVSDB server list.
31     type: comma_delimited_list
32   L2gwAgentEnableManager:
33     default: false
34     description: Connection can be initiated by the ovsdb server.
35     type: boolean
36   L2gwAgentManagerTableListeningPort:
37     default: 6632
38     description: port number for L2 gateway agent, so that it can listen
39     type: number
40   L2gwAgentPeriodicInterval:
41     default: 20
42     description: The L2 gateway agent checks connection state with the OVSDB
43                  servers. The interval is number of seconds between attempts.
44     type: number
45   L2gwAgentMaxConnectionRetries:
46     default: 10
47     description: The L2 gateway agent retries to connect to the OVSDB server
48     type: number
49   L2gwAgentSocketTimeout:
50     default: 30
51     description: socket timeout
52     type: number
53   MonitoringSubscriptionNeutronL2gwAgent:
54     default: 'overcloud-neutron-l2gw-agent'
55     type: string
56   NeutronL2gwAgentLoggingSource:
57     type: json
58     default:
59       tag: openstack.neutron.agent.l2gw
60       path: /var/log/neutron/l2gw-agent.log
61
62 conditions:
63   internal_manager_enabled: {equals: [{get_param: L2gwAgentEnableManager}, True]}
64
65 outputs:
66   role_data:
67     description: Role data for the L2 Gateway role.
68     value:
69       service_name: neutron_l2gw_agent
70       monitoring_subscription: {get_param: MonitoringSubscriptionNeutronL2gwAgent}
71       logging_source: {get_param: NeutronL2gwAgentLoggingSource}
72       logging_groups:
73         - neutron
74       config_settings:
75         map_merge:
76           - neutron::agents::l2gw::ovsdb_hosts: {get_param: L2gwAgentOvsdbHosts}
77             neutron::agents::l2gw::enable_manager: {get_param: L2gwAgentEnableManager}
78             neutron::agents::l2gw::manager_table_listening_port: {get_param: L2gwAgentManagerTableListeningPort}
79             neutron::agents::l2gw::periodic_interval: {get_param: L2gwAgentPeriodicInterval}
80             neutron::agents::l2gw::max_connection_retries: {get_param: L2gwAgentMaxConnectionRetries}
81             neutron::agents::l2gw::socket_timeout: {get_param: L2gwAgentSocketTimeout}
82           -
83             if:
84               - internal_manager_enabled
85               - tripleo.neutron_l2gw_agent.firewall_rules:
86                   '142 neutron l2gw agent input':
87                     proto: 'tcp'
88                     dport: {get_param: L2gwAgentManagerTableListeningPort}
89               - null
90
91       step_config: |
92         include tripleo::profile::base::neutron::agents::l2gw
93       upgrade_tasks:
94         - name: Check if neutron_l2gw_agent is deployed
95           command: systemctl is-enabled neutron-l2gw-agent
96           tags: common
97           ignore_errors: True
98           register: neutron_l2gw_agent_enabled
99         - name: "PreUpgrade step0,validation: Check service neutron-l2gw-agent is running"
100           shell: /usr/bin/systemctl show 'neutron-l2gw-agent' --property ActiveState | grep '\bactive\b'
101           when: neutron_l2gw_agent_enabled.rc == 0
102           tags: step0,validation
103         - name: Stop neutron_l2gw_agent service
104           tags: step1
105           when: neutron_l2gw_agent_enabled.rc == 0
106           service: name=neutron-l2gw-agent state=stopped