summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
Diffstat (limited to 'deploy')
-rw-r--r--deploy/adapters/ansible/roles/config-osa/tasks/main.yml10
-rw-r--r--deploy/adapters/ansible/roles/config-osa/templates/setup-odl.yml.j212
-rw-r--r--deploy/adapters/ansible/roles/post-openstack/tasks/main.yml6
-rw-r--r--deploy/bonding.py2
-rw-r--r--deploy/client.py12
-rwxr-xr-xdeploy/compass_conf/package_metadata/openstack.conf8
-rwxr-xr-xdeploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl7
-rw-r--r--deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml2
-rw-r--r--deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml3
-rw-r--r--deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml2
-rw-r--r--deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-moon-ha.yml2
-rw-r--r--deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-nofeature-ha.yml2
-rw-r--r--deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml2
-rw-r--r--deploy/conf/vm_environment/os-odl_l2-moon-ha.yml2
-rw-r--r--deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml3
-rw-r--r--deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml2
-rw-r--r--deploy/config_parse.py8
-rwxr-xr-xdeploy/deploy_host.sh2
-rw-r--r--deploy/opera_adapter.py2
-rwxr-xr-xdeploy/prepare.sh3
-rw-r--r--deploy/rename_nics.py2
-rw-r--r--deploy/reset_compute.py4
-rw-r--r--deploy/setup_vnic.py2
23 files changed, 89 insertions, 11 deletions
diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml
index aac18153..e66ea949 100644
--- a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml
@@ -51,6 +51,16 @@
src: setup-ovs.yml
dest: /opt/openstack-ansible/playbooks
+- name: copy setup-odl.yml
+ template:
+ src: setup-odl.yml.j2
+ dest: /opt/openstack-ansible/playbooks/setup-odl.yml
+
+- name: copy odl_cluster role
+ copy:
+ src: /var/ansible/run/openstack_ocata-opnfv2/roles/odl_cluster
+ dest: /etc/ansible/roles/
+
- name: copy flavor roles
copy:
src: os-flavor
diff --git a/deploy/adapters/ansible/roles/config-osa/templates/setup-odl.yml.j2 b/deploy/adapters/ansible/roles/config-osa/templates/setup-odl.yml.j2
new file mode 100644
index 00000000..18446ce5
--- /dev/null
+++ b/deploy/adapters/ansible/roles/config-osa/templates/setup-odl.yml.j2
@@ -0,0 +1,12 @@
+---
+
+- name: run opendaylight role
+ hosts: neutron_all | galera_container | network_hosts | repo_container
+ max_fail_percentage: 20
+ user: root
+ roles:
+ - odl_cluster
+ vars:
+ - odl_l3_agent: "{{ odl_l3_agent }}"
+ tags:
+ - odl
diff --git a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml
index 63df7260..8140cee7 100644
--- a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml
@@ -7,6 +7,12 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
+- name: setup odl
+ shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \
+ cd /opt/openstack-ansible/playbooks; \
+ openstack-ansible setup-odl.yml > /dev/null"
+ when: opendaylight is defined and opendaylight == "Enable"
+
- name: create network
shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \
cd /opt/openstack-ansible/playbooks; \
diff --git a/deploy/bonding.py b/deploy/bonding.py
index 27e76daa..17b5b205 100644
--- a/deploy/bonding.py
+++ b/deploy/bonding.py
@@ -34,7 +34,7 @@ def create_bonding(network_info, rsa_file, compass_ip):
if __name__ == "__main__":
assert(len(sys.argv) == 4)
create_bonding(
- yaml.load(
+ yaml.safe_load(
open(
sys.argv[1])),
sys.argv[2],
diff --git a/deploy/client.py b/deploy/client.py
index 433d90ec..6d5daa38 100644
--- a/deploy/client.py
+++ b/deploy/client.py
@@ -256,6 +256,9 @@ opts = [
cfg.StrOpt('onos_sfc',
help='onos_sfc enable flag',
default='Disable'),
+ cfg.StrOpt('plugins',
+ help='plugin dict',
+ default='{}'),
]
CONF.register_cli_opts(opts)
@@ -737,11 +740,11 @@ class CompassClient(object):
package_config['network_mapping'] = network_mapping
assert(os.path.exists(CONF.network_cfg))
- network_cfg = yaml.load(open(CONF.network_cfg))
+ network_cfg = yaml.safe_load(open(CONF.network_cfg))
package_config["network_cfg"] = network_cfg
assert(os.path.exists(CONF.neutron_cfg))
- neutron_cfg = yaml.load(open(CONF.neutron_cfg))
+ neutron_cfg = yaml.safe_load(open(CONF.neutron_cfg))
package_config["neutron_config"] = neutron_cfg
"""
@@ -764,6 +767,11 @@ class CompassClient(object):
'moon'] = "Enable" if CONF.moon == "Enable" else "Disable"
package_config[
'onos_sfc'] = "Enable" if CONF.onos_sfc == "Enable" else "Disable"
+ package_config['plugins'] = []
+ if CONF.plugins:
+ for item in CONF.plugins.split(','):
+ key, value = item.split(':')
+ package_config['plugins'].append({key: value})
status, resp = self.client.update_cluster_config(
cluster_id, package_config=package_config)
diff --git a/deploy/compass_conf/package_metadata/openstack.conf b/deploy/compass_conf/package_metadata/openstack.conf
index b07efd4e..cfe66356 100755
--- a/deploy/compass_conf/package_metadata/openstack.conf
+++ b/deploy/compass_conf/package_metadata/openstack.conf
@@ -121,6 +121,14 @@ METADATA = {
'default_value': 'Disable'
}
},
+ 'plugins': {
+ '_self': {
+ 'mapping_to': 'plugins',
+ 'field': 'general_list',
+ 'is_required':False,
+ 'default_value': '[]'
+ }
+ },
'ha_network': {
'_self': {
'mapping_to': 'ha_network',
diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl
index cca66f1d..7b0f4ab0 100755
--- a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl
+++ b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl
@@ -187,6 +187,13 @@ CONGRESS_PASS: $congress_pass
DEMO_PASS: $demo_pass
ADMIN_PASS: $admin_pass
+#set plugins = $getVar('plugins', [])
+#for item in plugins
+#set keys = $item.keys()
+#set values = $item.values()
+$keys[0]: $values[0]
+#end for
+
#set neutron_service_plugins=['router']
#if $getVar('enable_fwaas', True)
diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml
index f7066697..2aa76d49 100644
--- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml
@@ -16,6 +16,8 @@ ipmiUser: root
ipmiVer: '2.0'
moon: "Enable"
+plugins:
+ - opendaylight: "Enable"
hosts:
- name: host1
diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml
index 527c1bfb..08debdc3 100644
--- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml
@@ -15,6 +15,9 @@ POWER_TOOL: ipmitool
ipmiUser: root
ipmiVer: '2.0'
+plugins:
+ - opendaylight: "Enable"
+
hosts:
- name: host1
mac: 'F8:4A:BF:55:A2:8D'
diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml
index e840380a..8c082d38 100644
--- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml
@@ -16,6 +16,8 @@ ipmiUser: root
ipmiVer: '2.0'
odl_l3_agent: "Enable"
+plugins:
+ - opendaylight: "Enable"
hosts:
- name: host1
diff --git a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-moon-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-moon-ha.yml
index d9d6d837..97026c05 100644
--- a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-moon-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-moon-ha.yml
@@ -16,6 +16,8 @@ POWER_TOOL: ipmitool
ipmiVer: '2.0'
moon: "Enable"
+plugins:
+ - opendaylight: "Enable"
hosts:
- name: host1
diff --git a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-nofeature-ha.yml
index 923e1cbd..9018473f 100644
--- a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-nofeature-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-nofeature-ha.yml
@@ -14,6 +14,8 @@ FLAVOR: cluster
POWER_TOOL: ipmitool
ipmiVer: '2.0'
+plugins:
+ - opendaylight: "Enable"
hosts:
- name: host1
diff --git a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml
index 4502cd1e..32eec758 100644
--- a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml
@@ -16,6 +16,8 @@ POWER_TOOL: ipmitool
ipmiVer: '2.0'
odl_l3_agent: "Enable"
+plugins:
+ - opendaylight: "Enable"
hosts:
- name: host1
diff --git a/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml b/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml
index ffb9fa14..759055d6 100644
--- a/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml
+++ b/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml
@@ -12,6 +12,8 @@ TYPE: virtual
FLAVOR: cluster
moon: "Enable"
+plugins:
+ - opendaylight: "Enable"
hosts:
- name: host1
diff --git a/deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml b/deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml
index 042367e6..4296ffda 100644
--- a/deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml
+++ b/deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml
@@ -11,6 +11,9 @@
TYPE: virtual
FLAVOR: cluster
+plugins:
+ - opendaylight: "Enable"
+
hosts:
- name: host1
roles:
diff --git a/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml b/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml
index 10a27ebd..fb530012 100644
--- a/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml
+++ b/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml
@@ -12,6 +12,8 @@ TYPE: virtual
FLAVOR: cluster
odl_l3_agent: "Enable"
+plugins:
+ - opendaylight: "Enable"
hosts:
- name: host1
diff --git a/deploy/config_parse.py b/deploy/config_parse.py
index c7546eeb..8a1ac54b 100644
--- a/deploy/config_parse.py
+++ b/deploy/config_parse.py
@@ -15,7 +15,7 @@ from Cheetah.Template import Template
def init(file):
with open(file) as fd:
- return yaml.load(fd)
+ return yaml.safe_load(fd)
def decorator(func):
@@ -54,6 +54,12 @@ def export_dha_file(s, dha_file, conf_dir, ofile):
env.update(s)
if env.get('hosts', []):
env.pop('hosts')
+ if 'plugins' in env:
+ plugin_list = []
+ for item in env.get('plugins'):
+ plugin_str = ':'.join([item.keys()[0], item.values()[0]])
+ plugin_list.append(plugin_str)
+ env.update({'plugins': ','.join(plugin_list)})
env.update({'TYPE': s.get('TYPE', "virtual")})
env.update({'FLAVOR': s.get('FLAVOR', "cluster")})
diff --git a/deploy/deploy_host.sh b/deploy/deploy_host.sh
index 16bfef67..1556651f 100755
--- a/deploy/deploy_host.sh
+++ b/deploy/deploy_host.sh
@@ -47,7 +47,7 @@ function deploy_host(){
--deployment_timeout="${DEPLOYMENT_TIMEOUT}" --${POLL_SWITCHES_FLAG} --dashboard_url="${DASHBOARD_URL}" \
--cluster_vip="${VIP}" --network_cfg="$NETWORK" --neutron_cfg="$NEUTRON" \
--enable_secgroup="${ENABLE_SECGROUP}" --enable_fwaas="${ENABLE_FWAAS}" --expansion="${EXPANSION}" \
- --rsa_file="$rsa_file" --enable_vpnaas="${ENABLE_VPNAAS}" --odl_l3_agent="${odl_l3_agent}" --moon="${moon}" --onos_sfc="${onos_sfc}"
+ --rsa_file="$rsa_file" --enable_vpnaas="${ENABLE_VPNAAS}" --odl_l3_agent="${odl_l3_agent}" --moon="${moon}" --onos_sfc="${onos_sfc}" --plugins="$plugins"
RET=$?
sleep $((AYNC_TIMEOUT+5))
diff --git a/deploy/opera_adapter.py b/deploy/opera_adapter.py
index 137aba54..fbf1b662 100644
--- a/deploy/opera_adapter.py
+++ b/deploy/opera_adapter.py
@@ -18,7 +18,7 @@ import traceback
def load_file(file):
with open(file) as fd:
try:
- return yaml.load(fd)
+ return yaml.safe_load(fd)
except:
traceback.print_exc()
return None
diff --git a/deploy/prepare.sh b/deploy/prepare.sh
index 1da91a5f..a620ac98 100755
--- a/deploy/prepare.sh
+++ b/deploy/prepare.sh
@@ -111,7 +111,8 @@ function _prepare_python_env() {
pip install netaddr==0.7.19
pip install oslo.config==4.6.0
pip install ansible==2.3.1.0
- pip install docker-compose==1.14.0
+ # For sudo use
+ sudo pip install docker-compose==1.14.0
fi
}
diff --git a/deploy/rename_nics.py b/deploy/rename_nics.py
index 2672c990..f78b3979 100644
--- a/deploy/rename_nics.py
+++ b/deploy/rename_nics.py
@@ -36,7 +36,7 @@ def rename_nics(dha_info, rsa_file, compass_ip, os_version):
if __name__ == "__main__":
assert(len(sys.argv) == 5)
rename_nics(
- yaml.load(
+ yaml.safe_load(
open(
sys.argv[1])),
sys.argv[2],
diff --git a/deploy/reset_compute.py b/deploy/reset_compute.py
index 86afc4f1..2e5103ba 100644
--- a/deploy/reset_compute.py
+++ b/deploy/reset_compute.py
@@ -20,7 +20,7 @@ def exec_cmd(cmd):
def reset_baremetal(dha_info):
print "reset_baremetal"
- hosts_info = yaml.load(open(dha_info))
+ hosts_info = yaml.safe_load(open(dha_info))
# print hosts_info
ipmiUserDf = hosts_info.get('ipmiUser', 'root')
@@ -48,7 +48,7 @@ def reset_baremetal(dha_info):
def reset_virtual(dha_info):
print "reset_virtual"
- hosts_info = yaml.load(open(dha_info))
+ hosts_info = yaml.safe_load(open(dha_info))
print hosts_info
hosts_list = hosts_info.get('hosts', [])
diff --git a/deploy/setup_vnic.py b/deploy/setup_vnic.py
index 7dcd8d94..de3b5ed6 100644
--- a/deploy/setup_vnic.py
+++ b/deploy/setup_vnic.py
@@ -13,7 +13,7 @@ import yaml
if __name__ == "__main__":
network_config_file = os.environ["NETWORK"]
- network_config = yaml.load(open(network_config_file, "r"))
+ network_config = yaml.safe_load(open(network_config_file, "r"))
os.system(
"sudo ovs-vsctl --may-exist add-port br-external mgmt_vnic -- set Interface mgmt_vnic type=internal") # noqa
os.system("sudo ip addr flush mgmt_vnic")