Merge "Container-specific variants of scenarios 001-004"
[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   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   NeutronEnableMetadataNetwork:
30     default: false
31     description: If True, DHCP provide metadata network. Requires either
32                  IsolatedMetadata or ForceMetadata parameters to also be True.
33     type: boolean
34   NeutronEnableIsolatedMetadata:
35     default: false
36     description: If True, DHCP provide metadata route to VM.
37     type: boolean
38   NeutronEnableForceMetadata:
39     default: false
40     description: If True, DHCP always provides metadata route to VM.
41     type: boolean
42   MonitoringSubscriptionNeutronDhcp:
43     default: 'overcloud-neutron-dhcp'
44     type: string
45   NeutronDhcpAgentLoggingSource:
46     type: json
47     default:
48       tag: openstack.neutron.agent.dhcp
49       path: /var/log/neutron/dhcp-agent.log
50   NeutronDhcpAgentDnsmasqDnsServers:
51     default: []
52     description: List of servers to use as dnsmasq forwarders
53     type: comma_delimited_list
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       RoleName: {get_param: RoleName}
64       RoleParameters: {get_param: RoleParameters}
65
66 outputs:
67   role_data:
68     description: Role data for the Neutron DHCP agent service.
69     value:
70       service_name: neutron_dhcp
71       monitoring_subscription: {get_param: MonitoringSubscriptionNeutronDhcp}
72       logging_source: {get_param: NeutronDhcpAgentLoggingSource}
73       logging_groups:
74         - neutron
75       config_settings:
76         map_merge:
77           - get_attr: [NeutronBase, role_data, config_settings]
78           - neutron::agents::dhcp::enable_isolated_metadata: {get_param: NeutronEnableIsolatedMetadata}
79             neutron::agents::dhcp::enable_force_metadata: {get_param: NeutronEnableForceMetadata}
80             neutron::agents::dhcp::enable_metadata_network: {get_param: NeutronEnableMetadataNetwork}
81             neutron::agents::dhcp::dnsmasq_dns_servers: {get_param: NeutronDhcpAgentDnsmasqDnsServers}
82             tripleo.neutron_dhcp.firewall_rules:
83               '115 neutron dhcp input':
84                 proto: 'udp'
85                 dport: 67
86               '116 neutron dhcp output':
87                 proto: 'udp'
88                 chain: 'OUTPUT'
89                 dport: 68
90       step_config: |
91         include tripleo::profile::base::neutron::dhcp
92       upgrade_tasks:
93         - name: Check if neutron_dhcp_agent is deployed
94           command: systemctl is-enabled neutron-dhcp-agent
95           tags: common
96           ignore_errors: True
97           register: neutron_dhcp_agent_enabled
98         - name: "PreUpgrade step0,validation: Check service neutron-dhcp-agent is running"
99           shell: /usr/bin/systemctl show 'neutron-dhcp-agent' --property ActiveState | grep '\bactive\b'
100           when: neutron_dhcp_agent_enabled.rc == 0
101           tags: step0,validation
102         - name: Stop neutron_dhcp service
103           tags: step1
104           when: neutron_dhcp_agent_enabled.rc == 0
105           service: name=neutron-dhcp-agent state=stopped