Merge "Add support for virtual port types"

This commit is contained in:
Jenkins 2017-06-06 14:57:17 +00:00 committed by Gerrit Code Review
commit 5b5f9d6e65
8 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,7 @@
---
features:
- |
Support for virtualport types, such as openvswitch, added.
upgrade:
- |
Ansible >= 2.2 required for openvswitch virtualport customisation.

View File

@ -1,3 +1,21 @@
# If virtualport_type is defined for any networks, include OVS dependencies
- when: "{{ networks|selectattr('virtualport_type', 'defined')|map(attribute='name')|list|length is greaterthan 0}}"
block:
# Install OVS dependencies
- name: Install OVS dependencies
include_role:
name: 'parts/ovs'
# Create any OVS Bridges that have been defined
- name: Create OVS Bridges
openvswitch_bridge:
bridge: "{{ item.bridge }}"
state: present
when: item.virtualport_type is defined and item.virtualport_type == "openvswitch"
with_items: "{{ networks }}"
become: true
# Create the global, root-managed libvirt networks to which we will
# attach the undercoud and overcloud virtual machines.
- name: Create libvirt networks

View File

@ -14,6 +14,9 @@
{% endif %}
</forward>
{% endif %}
{% if item.virtualport_type is defined %}
<virtualport type='{{ item.virtualport_type }}'/>
{% endif %}
{% if item.address is defined %}
<ip address='{{ item.address }}' netmask='{{ netmask }}'>
{% if item.dhcp_range is defined %}

View File

@ -55,3 +55,10 @@
file: dest=/var/log/extra/dstat-csv.log state=absent
become: true
- name: Delete OVS Bridges
openvswitch_bridge:
bridge: "{{ item.bridge }}"
state: absent
when: item.virtualport_type is defined and item.virtualport_type == "openvswitch"
with_items: "{{ networks }}"
become: true

View File

@ -31,6 +31,9 @@
<mac address='{{ node_mac_map.get(item.name).get(network.name) }}'/>
<source bridge='{{ network.bridge }}'/>
<model type='virtio'/>
{% if network.virtualport_type is defined %}
<virtualport type='{{ network.virtualport_type }}'/>
{% endif %}
</interface>
{% endfor %}
<serial type='pty'/>

View File

@ -41,6 +41,9 @@
<mac address='{{ undercloud_mac_map.get(undercloud_node.name).get(network.name) }}'/>
<source bridge='{{ network.bridge }}'/>
<model type='virtio'/>
{% if network.virtualport_type is defined %}
<virtualport type='{{ network.virtualport_type }}'/>
{% endif %}
</interface>
{% endfor %}
<serial type='pty'/>

View File

@ -0,0 +1,5 @@
# The package name for openvswitch
ovs_package: openvswitch
# The name of the openvswitch service.
ovs_service: openvswitch

View File

@ -0,0 +1,12 @@
- name: Install Openvswitch package
package:
name: "{{ ovs_package }}"
state: present
become: true
- name: Start Openvswitch
service:
name: "{{ ovs_service }}"
state: running
enabled: true
become: true