2 - name: activate ipv4 forwarding
3 sysctl: name=net.ipv4.ip_forward value=1
4 state=present reload=yes
6 - name: deactivate ipv4 rp filter
7 sysctl: name=net.ipv4.conf.all.rp_filter value=0
8 state=present reload=yes
10 - name: deactivate ipv4 default rp filter
11 sysctl: name=net.ipv4.conf.default.rp_filter
12 value=0 state=present reload=yes
14 - name: install neutron network related packages
15 apt: name={{ item }} state=present force=yes
18 - openvswitch-datapath-dkms
23 - name: generate neutron service list
24 shell: echo {{ item }} >> /opt/service
29 - neutron-plugin-openvswitch-agent
30 - neutron-metadata-agent
33 - name: install neutron openvswitch agent
34 apt: name=neutron-plugin-openvswitch-agent
35 state=present force=yes
36 when: "'openvswitch' in {{ NEUTRON_MECHANISM_DRIVERS }}"
38 - name: config neutron
39 template: src=neutron-network.conf
40 dest=/etc/neutron/neutron.conf backup=yes
42 - restart neutron-plugin-openvswitch-agent
43 - restart neutron-l3-agent
45 - restart neutron-dhcp-agent
46 - restart neutron-metadata-agent
48 - name: config l3 agent
49 template: src=l3_agent.ini dest=/etc/neutron/l3_agent.ini
52 - restart neutron-l3-agent
54 - name: config dhcp agent
55 template: src=dhcp_agent.ini dest=/etc/neutron/dhcp_agent.ini
59 - restart neutron-dhcp-agent
61 - name: update dnsmasq-neutron.conf
62 template: src=dnsmasq-neutron.conf
63 dest=/etc/neutron/dnsmasq-neutron.conf
66 - restart neutron-dhcp-agent
68 - name: config metadata agent
69 template: src=metadata_agent.ini
70 dest=/etc/neutron/metadata_agent.ini backup=yes
72 - restart neutron-metadata-agent
74 - name: config ml2 plugin
75 template: src=ml2_conf.ini
76 dest=/etc/neutron/plugins/ml2/ml2_conf.ini
79 - restart neutron-plugin-openvswitch-agent
81 - meta: flush_handlers
84 openvswitch_bridge: bridge=br-int state=present
87 openvswitch_bridge: bridge=br-ex state=present
88 when: "'openvswitch' in {{ NEUTRON_MECHANISM_DRIVERS }}"
90 - name: assign a port to br-ex for physical ext interface
91 openvswitch_port: bridge=br-ex port={{ INTERFACE_NAME }}
93 when: "'openvswitch' in {{ NEUTRON_MECHANISM_DRIVERS }}"
95 - include: igmp-router.yml
96 when: "'vxlan' in {{ NEUTRON_TUNNEL_TYPES }}"
98 - name: assert kernel support for vxlan
99 command: modinfo -F version vxlan
100 when: "'vxlan' in {{ NEUTRON_TUNNEL_TYPES }}"
102 - name: assert iproute2 suppport for vxlan
103 command: ip link add type vxlan help
104 register: iproute_out
105 failed_when: iproute_out.rc == 255
106 when: "'vxlan' in {{ NEUTRON_TUNNEL_TYPES }}"
109 when: "'opendaylight' in {{ NEUTRON_MECHANISM_DRIVERS }}"
111 - name: restart ovs service
112 service: name=openvswitch-switch state=restarted enabled=yes
114 - meta: flush_handlers