aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/roles/infra_deploy_openstack/tasks/configure_openstack.yml
blob: 3963cb64c055ad47d4c67f96327f1b3109a4088d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Copyright (c) 2018 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- name: Create folders
  file:
    path: "{{ item }}"
    state: directory
  with_items:
    - /etc/kolla/config/nova
    - /etc/kolla/config/neutron

- set_fact:
    filter_ops: RetryFilter,AvailabilityZoneFilter,RamFilter,DiskFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,SameHostFilter

- name: Configure OpenStack Nova
  copy:
    content: |
      [filter_scheduler]
      enabled_filters = {{ filter_ops }}
      [libvirt]
      cpu_mode = host-passthrough
    dest: /etc/kolla/config/nova.conf

- name: Configure OpenStack Neutron
  copy:
    content: |
      [DEFAULT]
      service_plugins=neutron.services.l3_router.l3_router_plugin.L3RouterPlugin
      [securitygroup]
      firewall_driver = neutron.agent.firewall.NoopFirewallDriver
      [ml2]
      extension_drivers=port_security
      [agent]
      extensions=port_security
    dest: /etc/kolla/config/neutron.conf

- name: Configure OpenStack ml2_plugin.ini
  copy:
    content: |
      [ml2]
      tenant_network_types = vxlan
      extension_drivers = port_security
      type_drivers = vlan,flat,local,vxlan
      mechanism_drivers = openvswitch
      [ml2_type_flat]
      flat_networks = physnet1
      [ml2_type_vlan]
      network_vlan_ranges = physnet1
      [securitygroup]
      firewall_driver = iptables_hybrid
      [ovs]
      datapath_type = system
      bridge_mappings = physnet1:br-ex
      tunnel_bridge = br-tun
      local_ip = {{ deployvm_ip }}
    dest: /etc/kolla/config/neutron/ml2_plugin.ini