Skip to content

Commit

Permalink
Changes to integrate with ACI 4.1 and new packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmnelemane committed Sep 2, 2019
1 parent eeae4cf commit 220ca18
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 10 deletions.
9 changes: 5 additions & 4 deletions chef/cookbooks/neutron/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
default[:neutron][:nsx_config_file] = "/etc/neutron/neutron.conf.d/110-nsx.conf"
default[:neutron][:ml2_cisco_config_file] = "/etc/neutron/neutron.conf.d/115-ml2_cisco.conf"
default[:neutron][:ml2_cisco_apic_config_file] = "/etc/neutron/neutron.conf.d/115-ml2_cisco_apic.conf"
default[:neutron][:opflex_config_file] = "/etc/opflex-agent-ovs/conf.d/10-opflex-agent-ovs.conf"
default[:neutron][:rpc_workers] = 1

default[:neutron][:db][:database] = "neutron"
Expand Down Expand Up @@ -128,8 +129,8 @@
cisco_apic_pkgs: ["python-apicapi",
"python-neutron-ml2-driver-apic"],
cisco_apic_gbp_pkgs: ["openstack-neutron-gbp",
"python-gbpclient"],
cisco_opflex_pkgs: ["agent-ovs",
"python-group-based-policy-client"],
cisco_opflex_pkgs: ["opflex-agent",
"lldpd",
"openstack-neutron-opflex-agent"],
infoblox_pkgs: ["python-infoblox-client",
Expand Down Expand Up @@ -174,8 +175,8 @@
cisco_apic_pkgs: ["python-apicapi",
"python-neutron-ml2-driver-apic"],
cisco_apic_gbp_pkgs: ["openstack-neutron-gbp",
"python-gbpclient"],
cisco_opflex_pkgs: ["agent-ovs",
"python-group-based-policy-client"],
cisco_opflex_pkgs: ["opflex-agent",
"lldpd",
"neutron-opflex-agent"],
infoblox_pkgs: [],
Expand Down
7 changes: 4 additions & 3 deletions chef/cookbooks/neutron/recipes/cisco_apic_agents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,14 @@
end

# Update config file from template
opflex_agent_conf = "/etc/opflex-agent-ovs/conf.d/10-opflex-agent-ovs.conf"
apic = neutron[:neutron][:apic]
opflex_list = apic[:opflex].select { |i| i[:nodes].include? node[:hostname] }
opflex_list.any? || raise("Opflex instance not found for node '#{node[:hostname]}'")
opflex_list.one? || raise("Multiple opflex instances found for node '#{node[:hostname]}'")
opflex = opflex_list.first
template opflex_agent_conf do
template node[:neutron][:opflex_config_file] do
cookbook "neutron"
source "10-opflex-agent-ovs.conf.erb"
source "opflex-agent-ovs.conf.erb"
mode "0755"
owner "root"
group neutron[:neutron][:platform][:group]
Expand All @@ -109,6 +108,8 @@
socketgroup: neutron[:neutron][:platform][:group],
opflex_peer_ip: opflex[:peer_ip],
opflex_peer_port: opflex[:peer_port],
opflex_int_bridge: opflex[:integration_bridge],
opflex_access_bridge: opflex[:access_bridge],
opflex_vxlan_encap_iface: opflex[:vxlan][:encap_iface],
opflex_vxlan_uplink_iface: opflex[:vxlan][:uplink_iface],
opflex_vxlan_uplink_vlan: opflex[:vxlan][:uplink_vlan],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@

"renderers": {
"stitched-mode": {
"ovs-bridge-name": "br-int",
"int-bridge-name": "<%= @opflex_int_bridge %>",
"access-bridge-name": "<%= @opflex_access_bridge %>",
"encap": {
"vxlan" : {
"encap-iface": "<%= @opflex_vxlan_encap_iface %>",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
def upgrade(tattr, tdep, attr, dep)
unless attr["apic"]["opflex"].key?("integration_bridge")
attr["apic"]["opflex"]["integration_bridge"] = tattr["apic"]["opflex"]["integration_bridge"]
end
unless attr["apic"]["opflex"].key?("access_bridge")
attr["apic"]["opflex"]["access_bridge"] = tattr["apic"]["opflex"]["access_bridge"]
end

return attr, dep
end

def downgrade(tattr, tdep, attr, dep)
unless tattr["apic"]["opflex"].key?("integration_bridge")
attr["apic"]["opflex"].delete("integration_bridge") if attr.key?("integration_bridge")
end
unless tattr["apic"]["opflex"].key?("access_bridge")
attr["apic"]["opflex"].delete("access_bridge") if attr.key?("access_bridge")
end

return attr, dep
end
6 changes: 4 additions & 2 deletions chef/data_bags/crowbar/template-neutron.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@
"peer_ip": "",
"peer_port": 8009,
"encap": "vxlan",
"integration_bridge": "br-int",
"access_bridge": "br-fabric",
"vxlan": {
"encap_iface": "br-int_vxlan0",
"encap_iface": "br-fab_vxlan0",
"uplink_iface": "vlan.4093",
"uplink_vlan": 4093,
"remote_ip": "",
Expand Down Expand Up @@ -193,7 +195,7 @@
"neutron": {
"crowbar-revision": 0,
"crowbar-applied": false,
"schema-revision": 307,
"schema-revision": 308,
"element_states": {
"neutron-server": [ "readying", "ready", "applying" ],
"neutron-network": [ "readying", "ready", "applying" ],
Expand Down
2 changes: 2 additions & 0 deletions chef/data_bags/crowbar/template-neutron.schema
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
"peer_ip": { "type": "str", "required" : true },
"peer_port": { "type": "int", "required" : true },
"encap": { "type": "str", "required": true },
"integration_bridge": { "type": "str", "required": true },
"access_bridge": { "type": "str", "required": trye },
"vxlan": { "type": "map", "required": true, "mapping" : {
"encap_iface": {"type": "str", "required": true },
"uplink_iface": { "type": "str", "required": true },
Expand Down

0 comments on commit 220ca18

Please sign in to comment.