Change flat network name for nosdn fdio scenario
[apex-tripleo-heat-templates.git] / puppet / services / neutron-dhcp.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Neutron DHCP 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   NeutronEnableMetadataNetwork:
34     default: false
35     description: If True, DHCP provide metadata network. Requires either
36                  IsolatedMetadata or ForceMetadata parameters to also be True.
37     type: boolean
38   NeutronEnableIsolatedMetadata:
39     default: false
40     description: If True, DHCP provide metadata route to VM.
41     type: boolean
42   NeutronEnableForceMetadata:
43     default: false
44     description: If True, DHCP always provides metadata route to VM.
45     type: boolean
46   MonitoringSubscriptionNeutronDhcp:
47     default: 'overcloud-neutron-dhcp'
48     type: string
49   NeutronDhcpAgentLoggingSource:
50     type: json
51     default:
52       tag: openstack.neutron.agent.dhcp
53       path: /var/log/neutron/dhcp-agent.log
54   NeutronDhcpAgentDnsmasqDnsServers:
55     default: []
56     description: List of servers to use as dnsmasq forwarders
57     type: comma_delimited_list
58
59 resources:
60
61   NeutronBase:
62     type: ./neutron-base.yaml
63     properties:
64       ServiceData: {get_param: ServiceData}
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 DHCP agent service.
74     value:
75       service_name: neutron_dhcp
76       monitoring_subscription: {get_param: MonitoringSubscriptionNeutronDhcp}
77       logging_source: {get_param: NeutronDhcpAgentLoggingSource}
78       logging_groups:
79         - neutron
80       config_settings:
81         map_merge:
82           - get_attr: [NeutronBase, role_data, config_settings]
83           - neutron::agents::dhcp::enable_isolated_metadata: {get_param: NeutronEnableIsolatedMetadata}
84             neutron::agents::dhcp::enable_force_metadata: {get_param: NeutronEnableForceMetadata}
85             neutron::agents::dhcp::enable_metadata_network: {get_param: NeutronEnableMetadataNetwork}
86             neutron::agents::dhcp::dnsmasq_dns_servers: {get_param: NeutronDhcpAgentDnsmasqDnsServers}
87             tripleo.neutron_dhcp.firewall_rules:
88               '115 neutron dhcp input':
89                 proto: 'udp'
90                 dport: 67
91               '116 neutron dhcp output':
92                 proto: 'udp'
93                 chain: 'OUTPUT'
94                 dport: 68
95       step_config: |
96         include tripleo::profile::base::neutron::dhcp
97       upgrade_tasks:
98         - name: Check if neutron_dhcp_agent is deployed
99           command: systemctl is-enabled neutron-dhcp-agent
100           tags: common
101           ignore_errors: True
102           register: neutron_dhcp_agent_enabled
103         - name: "PreUpgrade step0,validation: Check service neutron-dhcp-agent is running"
104           shell: /usr/bin/systemctl show 'neutron-dhcp-agent' --property ActiveState | grep '\bactive\b'
105           when: neutron_dhcp_agent_enabled.rc == 0
106           tags: step0,validation
107         - name: Stop neutron_dhcp service
108           tags: step1
109           when: neutron_dhcp_agent_enabled.rc == 0
110           service: name=neutron-dhcp-agent state=stopped