aboutsummaryrefslogtreecommitdiffstats
path: root/installation/ansible-server/src
diff options
context:
space:
mode:
authorTimoney, Dan (dt5972) <dt5972@att.com>2018-09-12 11:18:01 -0400
committerTimoney, Dan (dt5972) <dt5972@att.com>2018-09-12 11:18:01 -0400
commit6e24c8bfaa2fee62775f690644c97113195cc831 (patch)
treed5ff110d45fb4810202d223bc6b656798eb8e42c /installation/ansible-server/src
parent4e2db0d6e56bc19425e6afa3efc7011820942e9e (diff)
Update SDNC to use CCSDK ansible server as base
Update SDNC to use CCSDK ansible server as base for its instance of ansible server Change-Id: Idaf1c83cf50ee526f17b97a3b2e376f6ad3a696b Issue-ID: CCSDK-442 Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com> Former-commit-id: 01809240263c1d5ddad9e1e990a9610bdceaa83a
Diffstat (limited to 'installation/ansible-server/src')
-rw-r--r--installation/ansible-server/src/main/docker/Dockerfile2
-rwxr-xr-xinstallation/ansible-server/src/main/scripts/AnsibleModule.py170
-rwxr-xr-xinstallation/ansible-server/src/main/scripts/AnsibleSql.py322
-rwxr-xr-xinstallation/ansible-server/src/main/scripts/LoadAnsibleMySql.py207
-rw-r--r--installation/ansible-server/src/main/scripts/README103
-rwxr-xr-xinstallation/ansible-server/src/main/scripts/RestServer.py948
-rw-r--r--installation/ansible-server/src/main/scripts/RestServer_config55
-rw-r--r--installation/ansible-server/src/main/scripts/startAnsibleServer.sh20
8 files changed, 1 insertions, 1826 deletions
diff --git a/installation/ansible-server/src/main/docker/Dockerfile b/installation/ansible-server/src/main/docker/Dockerfile
index 86b368c9..cc93f12a 100644
--- a/installation/ansible-server/src/main/docker/Dockerfile
+++ b/installation/ansible-server/src/main/docker/Dockerfile
@@ -1,5 +1,5 @@
# Base ubuntu with added packages needed for open ecomp
-FROM onap/ccsdk-ubuntu-image:${ccsdk.distribution.version}
+FROM onap/ccsdk-ansible-server-image:${ccsdk.distribution.version}
LABEL maintainer="SDN-C Team (sdnc@lists.openecomp.org)"
diff --git a/installation/ansible-server/src/main/scripts/AnsibleModule.py b/installation/ansible-server/src/main/scripts/AnsibleModule.py
deleted file mode 100755
index 3458c28b..00000000
--- a/installation/ansible-server/src/main/scripts/AnsibleModule.py
+++ /dev/null
@@ -1,170 +0,0 @@
-'''
-/*-
-* ============LICENSE_START=======================================================
-* ONAP : APPC
-* ================================================================================
-* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-* ================================================================================
-* Copyright (C) 2017 Amdocs
-* =============================================================================
-* 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.
-*
-* ECOMP is a trademark and service mark of AT&T Intellectual Property.
-* ============LICENSE_END=========================================================
-*/
-'''
-
-import os, subprocess
-import sys
-from collections import namedtuple
-import json
-
-import uuid
-
-def ansibleSysCall (inventory_path, playbook_path, nodelist, mandatory,
- envparameters, localparameters, lcm, timeout):
-
- print "***> in AnsibleModule.ansibleSysCall"
- print " EnvParameters: ", envparameters
- print " LocalParameters:", localparameters
- print " Inventory: ", inventory_path
- print " Playbook: ", playbook_path
- print " NodeList: ", nodelist
- print " Mandatory: ", mandatory
- print " Timeout: ", timeout
- log = []
-
- str_parameters = ''
-
- if not envparameters == {}:
- for key in envparameters:
- if str_parameters == '':
- str_parameters = '"' + str(key) + '=\'' + str(envparameters[key]) + '\''
- else:
- str_parameters += ' ' + str(key) + '=\'' + str(envparameters[key]) + '\''
- str_parameters += '"'
-
- if len(str_parameters) > 0:
- cmd = 'timeout --signal=KILL ' + str(timeout) + \
- ' ansible-playbook -v --extra-vars ' + str_parameters + ' -i ' + \
- inventory_path + ' ' + playbook_path
- else:
- cmd = 'timeout --signal=KILL ' + str(timeout) + \
- ' ansible-playbook -v -i ' + inventory_path + ' ' + playbook_path
-
- print " CMD: ", cmd
-
- print "\n =================ANSIBLE STDOUT BEGIN============================================\n"
- p = subprocess.Popen(cmd, shell=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
- # p.wait()
- (stdout_value, err) = p.communicate()
-
- stdout_value_cleanup = ''
- for line in stdout_value:
- stdout_value_cleanup += line.replace(' ', ' ')
- stdout_value = stdout_value_cleanup.splitlines()
-
- ParseFlag = False
- retval = {}
- returncode = p.returncode
-
- if returncode == 137:
-
- print " ansible-playbook system call timed out"
- # ansible-playbook system call timed out
- for line in stdout_value: # p.stdout.readlines():
- log.append (line)
-
-
- elif 'ping' in lcm:
-
- targetnode = envparameters['TargetNode'].split(' ')
- str_json = None
- for line in stdout_value: # p.stdout.readlines():
- print line # line,
- if "PLAY RECAP" in line:
- ParseFlag = False
- if ParseFlag and len(line.strip())>0:
- str_json += line.strip()
- if "TASK [debug]" in line:
- ParseFlag = True
- str_json = ''
- log.append (line)
-
- if str_json:
- if '=>' in str_json:
- out_json =eval(str_json.split('=>')[1].replace('true','True').replace('false','False'))
-
- if 'ping.stdout_lines' in out_json:
- for node in targetnode:
- ip_address = node
- ok_flag = '0'
- changed_flag = '0'
- unreachable_flag = '0'
- failed_flag = '1'
- for rec in out_json['ping.stdout_lines']:
- if node in rec and "is alive" in rec:
- ok_flag = '1'
- changed_flag = '1'
- unreachable_flag = '0'
- failed_flag = '0'
- for rec in out_json['ping.stdout_lines']:
- if node in rec and "address not found" in rec:
- ok_flag = '0'
- changed_flag = '0'
- unreachable_flag = '1'
- failed_flag = '0'
- retval[ip_address]=[ok_flag, changed_flag, unreachable_flag,
- failed_flag]
- else:
-
- for line in stdout_value: # p.stdout.readlines():
- print line # line,
- if ParseFlag and len(line.strip())>0:
- ip_address = line.split(':')[0].strip()
- ok_flag = line.split(':')[1].strip().split('=')[1].split('changed')[0].strip()
- changed_flag = line.split(':')[1].strip().split('=')[2].split('unreachable')[0].strip()
- unreachable_flag = line.split(':')[1].strip().split('=')[3].split('failed')[0].strip()
- failed_flag = line.split(':')[1].strip().split('=')[4].strip()
- retval[ip_address]=[ok_flag, changed_flag, unreachable_flag, failed_flag]
- if "PLAY RECAP" in line:
- ParseFlag = True
- log.append (line)
-
- # retval['p'] = p.wait()
-
- print " =================ANSIBLE STDOUT END==============================================\n"
-
- return retval, log, returncode
-
-if __name__ == '__main__':
-
- from multiprocessing import Process, Value, Array, Manager
- import time
-
- nodelist = 'host'
-
- playbook_file = 'ansible_sleep@0.00.yml'
-
-
- d = Manager().dict()
-
- p = Process(nodelist=ansible_call, args=('ansible_module_config', playbook_file, nodelist,d, ))
- p.start()
-
- print "Process running"
- print d
- p.join()
- print d
diff --git a/installation/ansible-server/src/main/scripts/AnsibleSql.py b/installation/ansible-server/src/main/scripts/AnsibleSql.py
deleted file mode 100755
index ab58a96c..00000000
--- a/installation/ansible-server/src/main/scripts/AnsibleSql.py
+++ /dev/null
@@ -1,322 +0,0 @@
-'''
-/*-
-* ============LICENSE_START=======================================================
-* ONAP : APPC
-* ================================================================================
-* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-* ================================================================================
-* Copyright (C) 2017 Amdocs
-* =============================================================================
-* 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.
-*
-* ECOMP is a trademark and service mark of AT&T Intellectual Property.
-* ============LICENSE_END=========================================================
-*/
-'''
-
-import pymysql, sys
-from os import listdir
-from os.path import isfile, join
-
-class mySql():
-
- def __init__(self, myhost, myuser, mypasswd, mydb):
- self.con = True
- self.error = ''
- self.db = None
- try:
- self.db = pymysql.connect(host=myhost,
- user=myuser,
- passwd=mypasswd,
- db=mydb)
- self.cur = self.db.cursor()
- except Exception as e:
- self.error = e[1]
- self.con = False
-
- def Query (self, myquery, val = None):
- results = None
- try:
- if val:
- self.cur.execute(myquery, val)
- else:
- self.cur.execute(myquery)
- self.db.commit()
- results = self.cur.fetchall()
- except Exception, e:
- results = repr(e)
- return results
-
- def Close (self):
- if self.db:
- self.db.close()
-
-def loadPlaybook (sqlintf, value, version, ext = '.yml'):
-
- errorCode = 0
- diag = ''
-
- # Test if primary key already defined
- query = "SELECT name FROM playbook WHERE name='" + value +"'"
- results = sqlintf.Query (query)
- if len(results) > 0:
- pass
- else:
- query = "INSERT INTO playbook (name) VALUES ('" + value + "')"
- results = sqlintf.Query (query)
- if len(results) > 0:
- errorCode = 1
- diag = results
-
- # Load playbook
- file = open(playbook_path + value + ext, 'r')
- load_file = file.read()
-
- if not errorCode:
- sql = "UPDATE playbook SET value=%s, version=%s, type=%s WHERE name=%s"
-
- results = sqlintf.Query(sql, (load_file, version, ext, value))
-
- if len (results) > 0:
- # Error loading playbook
- errorCode = 1
- diag = results
-
- return errorCode, diag
-
-def loadCredentials (sqlintf, hostgroup, hostname, cred):
- errorCode = 0
- diag = ''
-
- # Load credentials
-
- query = "SELECT hostname,hostgroup FROM inventory WHERE hostname='" + hostname +"'"
- results = sqlintf.Query (query)
-
- if hostname in str (results):
-
- results_hostgroups = results[0][1]
-
- if hostgroup in results_hostgroups.split(','):
- query = "UPDATE inventory SET hostname='" + hostname + "',credentials='" +\
- cred +\
- "' WHERE hostname='" + hostname + "'"
- else:
-
- results_hostgroups = results_hostgroups + ',' + hostgroup
-
- query = "UPDATE inventory SET hostname='" + hostname + "',credentials='" +\
- cred + "',hostgroup='" + results_hostgroups + \
- "' WHERE hostname='" + hostname + "'"
-
- results = sqlintf.Query (query)
-
- else:
-
- query = "INSERT INTO inventory (hostgroup, hostname, credentials) VALUES ('" + \
- hostgroup + "','" + hostname + "','" + cred + "')"
- results = sqlintf.Query (query)
-
- if len (results) > 0:
- # Error loading playbook
- errorCode = 1
- diag = results
-
- return errorCode, diag
-
-
-def readPlaybook (sqlintf, value, version=None):
-
- errorCode = 0
- diag = ''
-
- print "***> in AnsibleSql.readPlaybook"
-
- if not version:
- query = "SELECT MAX(version) FROM playbook WHERE name like'" + value + "%'"
- print " Query:", query
- results = sqlintf.Query (query)
- version = results[0][0]
-
- print " Provided playbook name:", value
- print " Used version:", version
-
- results = []
- if version:
- query = "SELECT value,type FROM playbook WHERE name='" + value + "@" + version + "'"
- results = sqlintf.Query (query)
-
- print "Query:", query
- print "Results:", results
-
- if len(results) == 0:
- errorCode = 1
- else:
- if len(results[0]) == 0:
- errorCode = 1
- diag = results[0]
- else:
- diag = results[0]
-
- return value, version, errorCode, diag
-
-def readCredentials (sqlintf, tag):
- errorCode = []
- diag = []
-
- print "***> in AnsibleSql.readCredential"
-
- # Load credentials
-
- for rec in tag:
-
- # Try hostgroup
- query = "SELECT hostgroup, hostname, credentials FROM inventory WHERE hostgroup LIKE '%" + \
- rec +"%'"
- query_results = sqlintf.Query (query)
-
- results = ()
- for q in query_results:
- if rec in q[0].split(','):
- l = list(q)
- l[0] = rec
- q = tuple(l)
- results = (q,) + results
-
- if len(results) == 0:
- # Try hostname
- query = "SELECT hostgroup, hostname, credentials FROM inventory WHERE hostname='" + \
- rec +"'"
- results = sqlintf.Query (query)
-
- print " Query:", query
- print " Results:", len(results), results
-
- if len(results) == 0:
- errorCode = 1
- hostgroup = rec
- hostname = rec
- credentials = 'ansible_connection=ssh ansible_ssh_user=na ansible_ssh_private_key_file=na\n'
- diag.append([hostgroup, hostname, credentials])
- else:
- errorCode = 0
- for i in range(len (results)):
- for h in results[i][0].split(','):
- hostgroup = h
- hostname = results[i][1]
- credentials = results[i][2]
- diag.append([hostgroup, hostname, credentials])
-
- return errorCode, diag
-
-
-if __name__ == '__main__':
-
- ################################################################
- # Change below
- ################################################################
- host="localhost" # your host, usually localhost
- user="mysql_user_id" # your username
- passwd="password_4_mysql_user_id" # your password
- db="ansible" # name of the data base
-
- playbook_path = "/home/ubuntu/RestServerOpenSource/"
- inventory = "/home/ubuntu/RestServerOpenSource/Ansible_inventory"
- ################################################################
-
- onlyfiles = [f for f in listdir(playbook_path)
- if isfile(join(playbook_path, f))]
-
- sqlintf = mySql (host, user, passwd, db)
-
- # Load playbooks
-
- print "Loading playbooks"
- for file in onlyfiles:
- if "yml" in file:
-
- name = file.split (".yml")[0]
- print " Loading:", name
- version = name.split("@")[1]
- errorCode, diag = loadPlaybook (sqlintf, name, version, '.yml')
- if errorCode:
- print " Results: Failed - ", diag
- else:
- print " Results: Success"
-
- print "\nLoading inventory"
-
- # Load inventory
-
- hostgroup = None
- inv = {}
- file = open(inventory, 'r')
-
- for line in file:
-
- if '[' in line and ']' in line:
- hostgroup = line.strip().replace('[','').replace(']','')
- inv[hostgroup] = {}
- elif hostgroup and len(line.strip())>0:
- host = line.strip().split(" ")[0]
- credentials = line.replace(host,"")
- inv[hostgroup][host] = credentials
-
- file.close()
-
- for hostgroup in inv:
- print " Loading:", hostgroup
- hostfqdn = ''
- cred = ''
- for hostname in inv[hostgroup]:
- cred = inv[hostgroup][hostname]
- errorCode, diag = loadCredentials (sqlintf, hostgroup, hostname, cred)
- if errorCode:
- print " Results: Failed - ", diag
- else:
- print " Results: Success"
-
- print "\nReading playbook"
-
- # Read playbook
-
- if not sqlintf.con:
- print "Cannot connect to MySql:", sqlintf.error
- sys.exit()
-
- name = "ansible_sleep"
- print "Reading playbook:", name
- value, version, errorCode, diag = readPlaybook (sqlintf, name)
- if errorCode:
- print "Results: Failed - ", diag
- else:
- print "Results: Success"
- print value
- print version
- print diag
-
- print "\nReading inventory"
-
- # Read inventory
-
- tag = ["your_inventory_test_group_name"]
- print "Reading inventory tag:", tag
- errorCode, diag = readCredentials (sqlintf, tag)
- if errorCode:
- print "Results: Failed - ", diag
- else:
- print "Results: Success"
- print diag
-
- sqlintf.Close()
-
diff --git a/installation/ansible-server/src/main/scripts/LoadAnsibleMySql.py b/installation/ansible-server/src/main/scripts/LoadAnsibleMySql.py
deleted file mode 100755
index 0a1c78a6..00000000
--- a/installation/ansible-server/src/main/scripts/LoadAnsibleMySql.py
+++ /dev/null
@@ -1,207 +0,0 @@
-'''
-/*-
-* ============LICENSE_START=======================================================
-* ONAP : APPC
-* ================================================================================
-* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-* ================================================================================
-* Copyright (C) 2017 Amdocs
-* =============================================================================
-* 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.
-*
-* ECOMP is a trademark and service mark of AT&T Intellectual Property.
-* ============LICENSE_END=========================================================
-*/
-'''
-
-#!/usr/bin/python
-import pymysql
-from os import listdir
-from os.path import isfile, join
-
-class mySql():
-
- def __init__(self, myhost, myuser, mypasswd, mydb):
- self.db = pymysql.connect(host=myhost,
- user=myuser,
- passwd=mypasswd,
- db=mydb)
- self.cur = self.db.cursor()
-
- def Query (self, myquery, val = None):
- results = None
- error = None
- try:
- if val:
- self.cur.execute(myquery, val)
- else:
- self.cur.execute(myquery)
- self.db.commit()
- results = self.cur.fetchall()
- except Exception, e:
- error = str (e)
- return results, error
-
- def Close (self):
- self.db.close()
-
-def loadPlaybook (value, version, ext = '.yml'):
-
- errorCode = 0
- diag = ''
-
- # Test if primary key already defined
- query = "SELECT name FROM playbook WHERE name='" + value +"'"
- results, error = sqlintf.Query (query)
- if results:
- # print "Primary key already defined: Updating playbook"
- pass
- else:
- # print "Primary key not defined: Insert new playbook"
- query = "INSERT INTO playbook (name) VALUES ('" + value + "')"
- results, error = sqlintf.Query (query)
- if error:
- errorCode = 1
- diag = error
-
- # Load playbook
- file = open(playbook_path + value + ext, 'r')
- load_file = file.read()
-
- # Load playbook
-
- if not errorCode:
- sql = "UPDATE playbook SET value=%s, version=%s, type=%s WHERE name=%s"
-
- results, error = sqlintf.Query(sql, (load_file, version, ext, value))
-
- if error:
- # Error loading playbook
- errorCode = 1
- diag = error
-
- return errorCode, diag
-
-def loadCredentials (hostgroup, hostname, cred):
- errorCode = 0
- diag = ''
-
- # Load credentials
-
- query = "SELECT hostname,hostgroup FROM inventory WHERE hostname='" + hostname +"'"
- results = sqlintf.Query (query)
-
- print '==>', results
-
- if hostname in str(results):
-
- results_hostgroups = results[0][0][1]
-
- # print "Record already defined: Updating inventory"
- if hostgroup in results_hostgroups.split(','):
- query = "UPDATE inventory SET hostname='" + hostname + "',credentials='" +\
- cred +\
- "' WHERE hostname='" + hostname + "'"
- else:
-
- results_hostgroups = results_hostgroups + ',' + hostgroup
-
- query = "UPDATE inventory SET hostname='" + hostname + "',credentials='" +\
- cred + "',hostgroup='" + results_hostgroups + \
- "' WHERE hostname='" + hostname + "'"
-
- results, error = sqlintf.Query (query)
-
- else:
-
- query = "INSERT INTO inventory (hostgroup, hostname, credentials) VALUES ('" + \
- hostgroup + "','" + hostname + "','" + cred + "')"
- results, error = sqlintf.Query (query)
-
- if error:
- # Error loading credentials
- errorCode = 1
- diag = results
-
- return errorCode, diag
-
-
-if __name__ == '__main__':
-
- ################################################################
- # Change below
- ################################################################
- host="localhost" # your host, usually localhost
- user="mysql_user_id" # your username
- passwd="password_4_mysql_user_id" # your password
- db="ansible" # name of the data base
-
- playbook_path = "/home/ubuntu/RestServerOpenSource/"
- inventory = "/home/ubuntu/RestServerOpenSource/Ansible_inventory"
- ################################################################
-
- onlyfiles = [f for f in listdir(playbook_path)
- if isfile(join(playbook_path, f))]
-
- sqlintf = mySql (host, user, passwd, db)
-
- # Load playbooks
- print "Loading playbooks"
- for file in onlyfiles:
- if "yml" in file:
- name = file.split (".yml")[0]
- print " Loading:", name
- version = name.split("@")[1]
- errorCode, diag = loadPlaybook (name, version)
- if errorCode:
- print " Results: Failed - ", diag
- else:
- print " Results: Success"
- if "tar.gz" in file:
- name = file.split (".tar.gz")[0]
- print " Loading:", name
- version = name.split("@")[1]
- errorCode, diag = loadPlaybook (name, version, ".tar.gz")
-
- print "\nLoading inventory"
-
- # Load inventory
- hostgroup = None
- inv = {}
- file = open(inventory, 'r')
-
- for line in file:
-
- if '[' in line and ']' in line:
- hostgroup = line.strip().replace('[','').replace(']','')
- inv[hostgroup] = {}
- elif hostgroup and len(line.strip())>0:
- host = line.strip().split(" ")[0]
- credentials = line.replace(host,"")
- inv[hostgroup][host] = credentials
-
- file.close()
-
- for hostgroup in inv:
- print " Loading:", hostgroup
- hostfqdn = ''
- cred = ''
- for hostname in inv[hostgroup]:
- cred = inv[hostgroup][hostname]
- errorCode, diag = loadCredentials (hostgroup, hostname, cred)
- if errorCode:
- print " Results: Failed - ", diag
- else:
- print " Results: Success"
-
- sqlintf.Close()
diff --git a/installation/ansible-server/src/main/scripts/README b/installation/ansible-server/src/main/scripts/README
deleted file mode 100644
index 976a8cf7..00000000
--- a/installation/ansible-server/src/main/scripts/README
+++ /dev/null
@@ -1,103 +0,0 @@
-'''
-/*-
-* ============LICENSE_START=======================================================
-* ONAP : APPC
-* ================================================================================
-* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-* ================================================================================
-* Copyright (C) 2017 Amdocs
-* =============================================================================
-* 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.
-*
-* ECOMP is a trademark and service mark of AT&T Intellectual Property.
-* ============LICENSE_END=========================================================
-*/
-'''
-
-============
-INSTALLATION:
-============
-
-Python:
--------
-sudo apt-get install python2.7
-sudo apt-get install python-pip
-pip install PyMySQL
-pip install requests
-
-Ansible:
---------
-sudo apt-get install software-properties-common
-sudo apt-add-repository ppa:ansible/ansible
-sudo apt-get update
-sudo apt-get install ansible
-
-SQL db: N/A for SDNC
--------
-
-sudo apt-get install mysql-server
-
-Set root passwd during installation (i.e. password_4_mysql_user_id)
-
-sudo service mysql restart
-
-Setup mysql: N/A for SDNC
-------------
-
-mysql -u [username]-p
-mysql -uroot -p
-
-Create user (i.e. id=mysql_user_id psswd=password_4_mysql_user_id)
- CREATE USER 'appc'@'%' IDENTIFIED BY 'password_4_mysql_user_id';
- GRANT ALL PRIVILEGES ON *.* TO 'mysql_user_id'@'%';
- SET PASSWORD FOR 'mysql_user_id'@'%'=PASSWORD('password_4_mysql_user_id');
-
-Create schema
- CREATE SCHEMA ansible;
- show databases;
- use ansible;
- CREATE TABLE playbook (name VARCHAR(45) NOT NULL, value BLOB, type VARCHAR(60), version VARCHAR(60), PRIMARY KEY (name));
- show tables;
- CREATE TABLE inventory (hostname VARCHAR(45) NOT NULL, hostgroup VARCHAR(45), credentials VARCHAR(500), PRIMARY KEY (hostname));
- SHOW COLUMNS FROM playbook;
- SHOW COLUMNS FROM inventory;
- GRANT ALL PRIVILEGES ON *.* TO 'mysql_user_id'@'%' IDENTIFIED BY 'password_4_mysql_user_id' WITH GRANT OPTION;
- GRANT ALL PRIVILEGES ON *.* TO 'ansible'@'%' IDENTIFIED BY 'ansible_agent' WITH GRANT OPTION;
- FLUSH PRIVILEGES;
-
-Load db: N/A for SDNC
---------
-
-python LoadAnsibleMySql.py
-
-=============
-CODE TESTING:
-=============
-1. Start RestServer: python RestServer.py
-
-2. Try curl commands (case no secured REST: http & no authentication):
-
-- Request to execute playbook:
-curl -H "Content-type: application/json" -X POST -d '{"Id": "10", "PlaybookName": "ansible_sleep", "NodeList": ["host"], "Timeout": "60", "EnvParameters": {"Sleep": "10"}}' http://0.0.0.0:8000/Dispatch
-
-response: {"ExpectedDuration": "60sec", "StatusMessage": "PENDING", "StatusCode": 100}
-
-- Get results (blocked until test finished):
-curl --cacert ~/SshKey/fusion_eric-vm_cert.pem --user "appc:abc123" -H "Content-type: application/json" -X GET "http://0.0.0.0:8000/Dispatch/?Id=10&Type=GetResult"
-
-response: {"Results": {"localhost": {"GroupName": "host", "StatusMessage": "SUCCESS", "StatusCode": 200}}, "PlaybookName": "ansible_sleep", "Version": "0.00", "Duration": "11.261794", "StatusMessage": "FINISHED", "StatusCode": 200}
-
-- Delete playbook execution information
-curl --cacert ~/SshKey/fusion_eric-vm_cert.pem --user "appc:abc123" -H "Content-type: application/json" -X DELETE http://0.0.0.0:8000/Dispatch/?Id=10
-
-response: {"StatusMessage": "PLAYBOOK EXECUTION RECORDS DELETED", "StatusCode": 200}
diff --git a/installation/ansible-server/src/main/scripts/RestServer.py b/installation/ansible-server/src/main/scripts/RestServer.py
deleted file mode 100755
index 4758a9b9..00000000
--- a/installation/ansible-server/src/main/scripts/RestServer.py
+++ /dev/null
@@ -1,948 +0,0 @@
-'''
-/*-
-* ============LICENSE_START=======================================================
-* ONAP : APPC
-* ================================================================================
-* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-* ================================================================================
-* Copyright (C) 2017 Amdocs
-* =============================================================================
-* 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.
-*
-* ECOMP is a trademark and service mark of AT&T Intellectual Property.
-* ============LICENSE_END=========================================================
-*/
-'''
-
-import time, datetime, json, os, sys, subprocess, re
-import uuid
-import tarfile
-import shutil
-
-import requests
-
-import cherrypy
-from cherrypy.lib.httputil import parse_query_string
-from cherrypy.lib import auth_basic
-
-from multiprocessing import Process, Manager
-
-from AnsibleModule import ansibleSysCall
-
-import AnsibleSql
-from AnsibleSql import readPlaybook, readCredentials
-
-from os import listdir
-from os.path import isfile, join
-
-TestRecord = Manager().dict()
-ActiveProcess = {}
-
-def sys_call (cmd):
- p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- output = p.stdout.readlines()
- retval = p.wait()
- if len (output) > 0:
- for i in range(len(output)):
- output[i] = output[i].strip()
- return retval, output
-
-def callback (Id, Result, Output, Log, returncode):
-
- print "***> in RestServer.callback"
-
- if Id in TestRecord:
- time_now = datetime.datetime.utcnow()
- delta_time = (time_now - TestRecord[Id]['Time']).total_seconds()
- Result['PlaybookName'] = TestRecord[Id]['PlaybookName']
- Result['Version'] = TestRecord[Id]['Version']
- if returncode == 137:
- Result['StatusCode'] = 500
- Result['StatusMessage'] = "TERMINATED"
- else:
- Result['StatusCode'] = 200
- Result['StatusMessage'] = "FINISHED"
-
- # Need to update the whole data structure for key=Id otherwise Manager is not updated
- TestRecord[Id] = {'PlaybookName': TestRecord[Id]['PlaybookName'],
- 'LCM': TestRecord[Id]['LCM'],
- 'Version': TestRecord[Id]['Version'],
- 'NodeList': TestRecord[Id]['NodeList'],
- 'HostGroupList': TestRecord[Id]['HostGroupList'],
- 'HostNameList': TestRecord[Id]['HostNameList'],
- 'Time': TestRecord[Id]['Time'],
- 'Timeout': TestRecord[Id]['Timeout'],
- 'Duration': str(delta_time),
- 'EnvParameters': TestRecord[Id]['EnvParameters'],
- 'LocalParameters': TestRecord[Id]['LocalParameters'],
- 'FileParameters': TestRecord[Id]['FileParameters'],
- 'CallBack': TestRecord[Id]['CallBack'],
- 'Result': Result,
- 'Log': Log,
- 'Output': Output,
- 'Path': TestRecord[Id]['Path'],
- 'Mandatory': TestRecord[Id]['Path']}
-
- if not TestRecord[Id]['CallBack'] == None:
-
- # Posting results to callback server
-
- data = {"StatusCode": 200,
- "StatusMessage": "FINISHED",
- "PlaybookName": TestRecord[Id]["PlaybookName"],
- "Version": TestRecord[Id]["Version"],
- "Duration": TestRecord[Id]["Duration"],
- "Results": TestRecord[Id]['Result']['Results']}
-
- if not TestRecord[Id]['Output']['Output'] == {}:
- for key in data["Results"]:
- if key in TestRecord[Id]['Output']['Output']:
- data["Results"][key]["Output"] = TestRecord[Id]['Output']['Output'][key]
-
- print " Posting to", TestRecord[Id]['CallBack']
-
- s = requests.Session()
- r = s.post(TestRecord[Id]['CallBack'], data = json.dumps(data),
- headers = {'content-type': 'application/json'})
- print " Response", r.status_code, r.text
-
-def RunAnsible_Playbook (callback, Id, Inventory, Playbook, NodeList, TestRecord,
- Path, ArchiveFlag):
-
- print "***> in RestServer.RunAnsible_Playbook"
-
- # Run test in playbook for given target
- Result = ''
-
- retval, log, returncode = ansibleSysCall (Inventory, Playbook, NodeList,
- TestRecord[Id]['Mandatory'],
- TestRecord[Id]['EnvParameters'],
- TestRecord[Id]['LocalParameters'],
- TestRecord[Id]['LCM'],
- TestRecord[Id]['Timeout'])
-
-
- print " returncode:", returncode
- print " retval: ", retval
- print " log: ", log
-
- Log = ''.join(log)
- Output = {'Output': {}}
-
- onlyfiles = [f for f in listdir(Path)
- if isfile(join(Path, f))]
-
- for file in onlyfiles:
- if "results.txt" in file:
- f = open(Path + "/" + file, "r")
- key = file.split("_")[0]
- Output['Output'][key] = f.read()
- f.close()
-
- Result = {'Results': {}}
- if 'could not be found' in Log:
- Result['Results'] = {"StatusCode": 101,
- "StatusMessage": "PLAYBOOK NOT FOUND"}
- if returncode == 137:
- Result['Results'] = {"StatusCode": 500,
- "StatusMessage": "TERMINATED"}
-
- elif TestRecord[Id]['NodeList'] == []:
-
- host_index = None
-
- if 'TargetNode' in TestRecord[Id]['EnvParameters']:
- targetlist = TestRecord[Id]['EnvParameters']['TargetNode'].split(' ')
- else:
- targetlist = ["localhost"]
-
- for key in retval:
- for i in range (len(targetlist)):
- if key in targetlist[i]:
- host_index = i
-
- if int(retval[key][0]) > 0 and int(retval[key][2]) == 0 and \
- int(retval[key][3]) == 0:
-
- if host_index:
- Result['Results'][targetlist[host_index]] = \
- {"GroupName": 'na', "StatusCode": 200, \
- "StatusMessage": "SUCCESS"}
- else:
- Result['Results'][key] = \
- {"GroupName": 'na', "StatusCode": 200, \
- "StatusMessage": "SUCCESS"}
- elif int(retval[key][2]) > 0:
- if host_index:
- Result['Results'][targetlist[host_index]] = \
- {"GroupName": 'na', "StatusCode": 400, \
- "StatusMessage": "NOT REACHABLE"}
- else:
- Result['Results'][key] = \
- {"GroupName": 'na', "StatusCode": 400, \
- "StatusMessage": "NOT REACHABLE"}
- elif int(retval[key][3]) > 0:
- if host_index:
- Result['Results'][targetlist[host_index]] = \
- {"GroupName": 'na', "StatusCode": 400, \
- "StatusMessage": "FAILURE"}
- else:
- Result['Results'][key] = \
- {"GroupName": 'na', "StatusCode": 400, \
- "StatusMessage": "FAILURE"}
- else:
-
- for key in retval:
-
- if len(TestRecord[Id]['HostNameList']) > 0:
-
- host_index = []
- for i in range (len(TestRecord[Id]['HostNameList'])):
- if key in TestRecord[Id]['HostNameList'][i]:
- host_index.append(i)
-
- if int(retval[key][0]) > 0 and int(retval[key][2]) == 0 and \
- int(retval[key][3]) == 0:
-
- if len(host_index) > 0:
- Result['Results'][TestRecord[Id]['HostNameList'][host_index[0]]] = \
- {"GroupName": TestRecord[Id]['HostGroupList'][host_index[0]],
- "StatusCode": 200, "StatusMessage": "SUCCESS"}
-
- for i in range (1, len(host_index)):
- Result['Results'][TestRecord[Id]['HostNameList'][host_index[i]]]["GroupName"]+=\
- "," + TestRecord[Id]['HostGroupList'][host_index[i]]
- else:
- Result['Results'][key] = \
- {"GroupName": key,
- "StatusCode": 200, "StatusMessage": "SUCCESS"}
-
- elif int(retval[key][2]) > 0:
-
- if len(host_index) > 0:
- Result['Results'][TestRecord[Id]['HostNameList'][host_index[0]]] = \
- {"GroupName": TestRecord[Id]['HostGroupList'][host_index[0]],
- "StatusCode": 400, "StatusMessage": "NOT REACHABLE"}
-
- for i in range (1, len(host_index)):
- Result['Results'][TestRecord[Id]['HostNameList'][host_index[i]]]["GroupName"]+=\
- "," + TestRecord[Id]['HostGroupList'][host_index[i]]
- else:
- Result['Results'][key] = \
- {"GroupName": key,
- "StatusCode": 200, "StatusMessage": "NOT REACHABLE"}
-
- elif int(retval[key][3]) > 0:
-
- if len(host_index) > 0:
- Result['Results'][TestRecord[Id]['HostNameList'][host_index[0]]] = \
- {"GroupName": TestRecord[Id]['HostGroupList'][host_index[0]],
- "StatusCode": 400, "StatusMessage": "FAILURE"}
-
- for i in range (1, len(host_index)):
- Result['Results'][TestRecord[Id]['HostNameList'][host_index[i]]]["GroupName"]+=\
- "," + TestRecord[Id]['HostGroupList'][host_index[i]]
- else:
- Result['Results'][key] = \
- {"GroupName": key,
- "StatusCode": 200, "StatusMessage": "FAILURE"}
- else:
- host_index = None
- for i in range (len(TestRecord[Id]['NodeList'])):
- if key in TestRecord[Id]['NodeList'][i]:
- host_index = i
-
- if int(retval[key][0]) > 0 and int(retval[key][2]) == 0 and \
- int(retval[key][3]) == 0:
- Result['Results'][TestRecord[Id]['NodeList'][host_index]] = \
- {"GroupName": 'na', "StatusCode": 200, \
- "StatusMessage": "SUCCESS"}
- elif int(retval[key][2]) > 0:
- Result['Results'][TestRecord[Id]['NodeList'][host_index]] = \
- {"GroupName": 'na', "StatusCode": 400, "StatusMessage": "NOT REACHABLE"}
- elif int(retval[key][3]) > 0:
- Result['Results'][TestRecord[Id]['NodeList'][host_index]] = \
- {"GroupName": 'na', "StatusCode": 400, "StatusMessage": "FAILURE"}
-
- callback (Id, Result, Output, Log, returncode)
-
-class TestManager (object):
-
- @cherrypy.expose
- @cherrypy.tools.json_out()
- @cherrypy.tools.json_in()
- @cherrypy.tools.allow(methods=['POST', 'GET', 'DELETE'])
-
- def Dispatch(self, **kwargs):
-
- # Let cherrypy error handler deal with malformed requests
- # No need for explicit error handler, we use default ones
-
- time_now = datetime.datetime.utcnow()
-
- # Erase old test results (2x timeout)
- if TestRecord:
- for key in TestRecord.copy():
- delta_time = (time_now - TestRecord[key]['Time']).seconds
- if delta_time > 2*TestRecord[key]['Timeout']:
- print "Deleted history for test", key
- if os.path.exists(TestRecord[key]['Path']):
- shutil.rmtree (TestRecord[key]['Path'])
- del TestRecord[key]
-
- print "***> in RestServer.Dispatch:", cherrypy.request.method
-
- HomeDir = os.path.dirname(os.path.realpath("~/"))
-
- if 'POST' in cherrypy.request.method:
-
- input_json = cherrypy.request.json
- print " Payload: ", input_json
-
- if 'Id' in input_json and 'PlaybookName' in input_json:
-
- if True:
-
- if not input_json['Id'] in TestRecord:
-
- Id = input_json['Id']
- PlaybookName = input_json['PlaybookName']
-
- version = None
- if 'Version' in input_json:
- version = input_json['Version']
-
- AnsibleInvFail = True
- AnsiblePlaybookFail = True
-
- MySqlConFail = True
- MySqlCause = ''
-
- LocalNodeList = None
-
- str_uuid = str (uuid.uuid4())
-
- LCM = PlaybookName.split(".")[0].split('_')[-1]
- PlaybookDir = HomeDir + "/" + ansible_temp + "/" + \
- PlaybookName.split(".")[0] + "_" + str_uuid
- AnsibleInv = LCM + "_" + "inventory"
- ArchiveFlag = False
-
- print " LCM: ", LCM
- print " PlaybookDir: ", ansible_temp + PlaybookDir.split(ansible_temp)[1]
- print " AnsibleInv: ", AnsibleInv
- print " ansible_temp: ", ansible_temp
-
- if not os.path.exists(HomeDir + "/" + ansible_temp):
- os.makedirs(HomeDir + "/" + ansible_temp)
-
- os.mkdir(PlaybookDir)
-
- # Process inventory file for target
-
- hostgrouplist = []
- hostnamelist = []
-
- NodeList = []
- if 'NodeList' in input_json:
- NodeList = input_json['NodeList']
-
- print " NodeList: ", NodeList
-
- if NodeList == []:
- # By default set to local host
- AnsibleInvFail = False
-
- LocalNodeList = "host"
- LocalCredentials = "localhost ansible_connection=local"
- f = open(PlaybookDir + "/" + AnsibleInv, "w")
- f.write("[" + LocalNodeList + "]\n")
- f.write(LocalCredentials)
- f.close()
-
- else:
-
- if from_files:
-
- # Get credentials from file
-
- data_inventory_orig = {}
- data_inventory_target = {}
- curr_group = None
-
- print "***>", ansible_path + "/" + ansible_inv
- f = open(ansible_path + "/" + ansible_inv, "r")
- for line in f:
- line = line.rstrip()
-
- if len(line)> 0:
- if '#' not in line:
- if "[" in line and "]" in line:
- data_inventory_orig[line] = []
- curr_group = line
- else:
- data_inventory_orig[curr_group].append(line)
- f.close()
-
- for node in NodeList:
- Fail = True
- if "[" + node + "]" in data_inventory_orig:
- if not "[" + node + "]" in data_inventory_target:
-
- print "RESET", "[" + node + "]"
- data_inventory_target["[" + node + "]"] = []
- else:
- print "OK", "[" + node + "]"
- Fail = False
- for cred in data_inventory_orig["[" + node + "]"]:
- data_inventory_target["[" + node + "]"].append(cred)
-
- else:
- for key in data_inventory_orig:
- if node in " ".join(data_inventory_orig[key]):
- if not key in data_inventory_target:
- data_inventory_target[key] = []
- for cred in data_inventory_orig[key]:
- if node in cred:
- data_inventory_target[key].append(cred)
- Fail = False
-
- if Fail:
- data_inventory_target["["+node+"]"] = \
- [node + " ansible_connection=ssh ansible_ssh_user=na ansible_ssh_private_key_file=na"]
-
- AnsibleInvFail = False
-
- f = open(PlaybookDir + "/" + AnsibleInv, "w")
- for key in data_inventory_target:
- f.write(key + "\n")
- for rec in data_inventory_target[key]:
- hostgrouplist.append(key.replace("[", '').replace("]", ''))
- hostnamelist.append(rec.split(' ')[0])
- f.write(rec + "\n")
- f.close()
-
- else:
-
- # Get credentials from mySQL
-
- sqlintf = AnsibleSql.mySql (host, user, passwd,
- db)
- if sqlintf.con:
- MySqlConFail = False
- errorCode, diag = readCredentials (sqlintf,
- NodeList)
-
- print errorCode, diag
- if len (diag) > 0:
- f = open(PlaybookDir + "/" + AnsibleInv,
- "w")
- AnsibleInvFail = False
- # [hostgroup, hostname, credentials]
- for i in range(len(diag)):
- f.write('[' + diag[i][0] + ']' + "\n")
- f.write(diag[i][1]+ " " + diag[i][2] + "\n\n")
- hostgrouplist.append(diag[i][0])
- hostnamelist.append(diag[i][1])
- f.close()
- else:
- MySqlConFailCause = sqlintf.error
- sqlintf.Close()
-
- timeout = timeout_seconds
- if 'Timeout' in input_json:
- timeout = int (input_json['Timeout'])
-
- EnvParam = {}
- if 'EnvParameters' in input_json:
- EnvParam = input_json['EnvParameters']
-
- LocalParam = {}
- if 'LocalParameters' in input_json:
- LocalParam = input_json['LocalParameters']
-
- FileParam = {}
- if 'FileParameters' in input_json:
- FileParam = input_json['FileParameters']
-
- callback_flag = None
- if 'CallBack' in input_json:
- callback_flag = input_json['CallBack']
-
- TestRecord[Id] = {'PlaybookName': PlaybookName,
- 'LCM': LCM,
- 'Version': version,
- 'NodeList': NodeList,
- 'HostGroupList': hostgrouplist,
- 'HostNameList': hostnamelist,
- 'Time': time_now,
- 'Duration': timeout,
- 'Timeout': timeout,
- 'EnvParameters': EnvParam,
- 'LocalParameters': LocalParam,
- 'FileParameters': FileParam,
- 'CallBack': callback_flag,
- 'Result': {"StatusCode": 100,
- "StatusMessage": 'PENDING',
- "ExpectedDuration": str(timeout) + "sec"},
- 'Log': '',
- 'Output': {},
- 'Path': PlaybookDir,
- 'Mandatory': None}
-
- # Write files
-
- if not TestRecord[Id]['FileParameters'] == {}:
- for key in TestRecord[Id]['FileParameters']:
- filename = key
- filecontent = TestRecord[Id]['FileParameters'][key]
- f = open(PlaybookDir + "/" + filename, "w")
- f.write(filecontent)
- f.close()
-
-
- # Process playbook
-
- if from_files:
-
- # Get playbooks from files
-
- MySqlConFail = False
-
- version = None
- target_PlaybookName = None
-
- if '@' in PlaybookName:
- version = PlaybookName.split("@")[1]
- version = version.replace('.yml','')
- version = version.replace('.tar.gz','')
-
- onlyfiles = [f for f in listdir(ansible_path)
- if isfile(join(ansible_path, f))]
-
- version_max = '0.00'
- version_target = ''
-
- for file in onlyfiles:
- if LCM in file:
- temp_version = file.split("@")[1]
- temp_version = temp_version.replace('.yml','')
- temp_version = temp_version.replace('.tar.gz','')
- if version_max < temp_version:
- version_max = temp_version
-
- if not version == None:
- if version in PlaybookName:
- version_target = version
- target_PlaybookName = file
-
- if target_PlaybookName == None:
- for file in onlyfiles:
- if LCM in file and version_max in file:
- target_PlaybookName = file
- version_target = version_max
-
- if target_PlaybookName:
- AnsiblePlaybookFail = False
- readversion = version_target
- src = ansible_path + "/" + target_PlaybookName
- if ".tar.gz" in target_PlaybookName:
- dest = PlaybookDir + "/" + LCM + ".tar.gz"
- shutil.copy2(src, dest)
- retcode = subprocess.call(['tar', '-xvzf',
- dest, "-C", PlaybookDir])
- ArchiveFlag = True
- else:
- dest = PlaybookDir + "/" + LCM + ".yml"
- shutil.copy2(src, dest)
-
- else:
- # Get playbooks from mySQL
-
- sqlintf = AnsibleSql.mySql (host, user, passwd, db)
- if sqlintf.con:
- MySqlConFail = False
-
- name, readversion, AnsiblePlaybookFail, diag = \
- readPlaybook (sqlintf, PlaybookName.split(".")[0],
- version)
-
- if not AnsiblePlaybookFail:
-
- f = open(PlaybookDir + "/" + LCM + diag[1], "w")
- f.write(diag[0])
- f.close()
-
- if ".tar.gz" in diag[1]:
- retcode = subprocess.call(['tar', '-xvzf',
- PlaybookDir + "/" + LCM + diag[1], "-C", PlaybookDir])
- f.close()
- ArchiveFlag = True
- else:
- MySqlConFailCause = sqlintf.error
- sqlintf.Close()
-
- if MySqlConFail:
- if os.path.exists(PlaybookDir):
- shutil.rmtree (PlaybookDir)
- del TestRecord[Id]
- return {"StatusCode": 101,
- "StatusMessage": "CANNOT CONNECT TO MYSQL: " \
- + MySqlConFailCause}
- elif AnsiblePlaybookFail:
- if os.path.exists(PlaybookDir):
- shutil.rmtree (PlaybookDir)
- del TestRecord[Id]
- return {"StatusCode": 101,
- "StatusMessage": "PLAYBOOK NOT FOUND"}
- elif AnsibleInvFail:
- if os.path.exists(PlaybookDir):
- shutil.rmtree (PlaybookDir)
- del TestRecord[Id]
- return {"StatusCode": 101,
- "StatusMessage": "NODE LIST CREDENTIALS NOT FOUND"}
- else:
-
- # Test EnvParameters
- playbook_path = None
- if ArchiveFlag:
- for dName, sdName, fList in os.walk(PlaybookDir):
- if LCM+".yml" in fList:
- playbook_path = dName
- else:
- playbook_path = PlaybookDir
-
- # Store local vars
- if not os.path.exists(playbook_path + "/vars"):
- os.mkdir(playbook_path + "/vars")
- if not os.path.isfile(playbook_path + "/vars/defaults.yml"):
- os.mknod(playbook_path + "/vars/defaults.yml")
-
- for key in TestRecord[Id]['LocalParameters']:
- host_index = []
- for i in range(len(TestRecord[Id]['HostNameList'])):
- if key in TestRecord[Id]['HostNameList'][i]:
- host_index.append(i)
- if len(host_index) == 0:
- for i in range(len(TestRecord[Id]['HostGroupList'])):
- if key in TestRecord[Id]['HostGroupList'][i]:
- host_index.append(i)
- if len(host_index) > 0:
- for i in range(len(host_index)):
- f = open(playbook_path + "/vars/" +
- TestRecord[Id]['HostNameList'][host_index[i]] +
- ".yml", "a")
- for param in TestRecord[Id]['LocalParameters'][key]:
- f.write(param + ": " +
- str (TestRecord[Id]['LocalParameters'][key][param]) +
- "\n")
- f.close()
-
- # Get mandatory parameters from playbook
- Mandatory = []
- with open(playbook_path + "/" + LCM + ".yml") as origin_file:
- for line in origin_file:
- if "Mandatory" in line:
- temp = line.split(":")[1].strip().replace(' ', '')
- if len(temp) > 0:
- Mandatory = temp.split(",")
-
- TestRecord[Id] = {'PlaybookName': TestRecord[Id]['PlaybookName'],
- 'LCM': TestRecord[Id]['LCM'],
- 'Version': readversion,
- 'NodeList': TestRecord[Id]['NodeList'],
- 'HostGroupList': TestRecord[Id]['HostGroupList'],
- 'HostNameList': TestRecord[Id]['HostNameList'],
- 'Time': TestRecord[Id]['Time'],
- 'Timeout': TestRecord[Id]['Timeout'],
- 'Duration': TestRecord[Id]['Duration'],
- 'EnvParameters': TestRecord[Id]['EnvParameters'],
- 'LocalParameters': TestRecord[Id]['LocalParameters'],
- 'FileParameters': TestRecord[Id]['FileParameters'],
- 'CallBack': TestRecord[Id]['CallBack'],
- 'Result': TestRecord[Id]['Result'],
- 'Log': TestRecord[Id]['Log'],
- 'Output': TestRecord[Id]['Output'],
- 'Path': TestRecord[Id]['Path'],
- 'Mandatory': Mandatory}
-
- TestKey = False
-
- if Mandatory:
- for val in Mandatory:
- if EnvParam:
- if val in EnvParam:
- TestKey = True
- else:
- if LocalParam:
- for key in TestRecord[Id]['NodeList']:
- if key in LocalParam:
- if val in LocalParam[key]:
- TestKey = True
- else:
- if LocalParam:
- for key in TestRecord[Id]['NodeList']:
- if key in LocalParam:
- if val in LocalParam[key]:
- TestKey = True
-
- if not TestKey:
- if os.path.exists(PlaybookDir):
- shutil.rmtree (PlaybookDir)
- del TestRecord[Id]
- return {"StatusCode": 101,
- "StatusMessage": "MISSING MANDATORY PARAMETER: " + \
- " ".join(str(x) for x in Mandatory)}
-
-
- # Cannot use thread because ansible module uses
- # signals which are only supported in main thread.
- # So use multiprocess with shared object
-
- p = Process(target = RunAnsible_Playbook,
- args = (callback, Id, PlaybookDir + "/" + AnsibleInv,
- playbook_path + "/" + LCM + ".yml",
- NodeList, TestRecord, PlaybookDir,
- ArchiveFlag))
- p.start()
- ActiveProcess[Id] = p
- return TestRecord[Id]['Result']
- else:
- return {"StatusCode": 101, "StatusMessage": "TEST ID ALREADY DEFINED"}
-
- else:
- return {"StatusCode": 500, "StatusMessage": "REQUEST MUST INCLUDE: NODELIST"}
-
- else:
- return {"StatusCode": 500, "StatusMessage": "JSON OBJECT MUST INCLUDE: ID, PLAYBOOKNAME"}
-
- elif 'GET' in cherrypy.request.method:
-
- input_data = parse_query_string(cherrypy.request.query_string)
-
- print "***> in RestServer.GET"
- print " Payload: ", input_data, input_data['Type']
-
- if 'Id' in input_data and 'Type' in input_data:
- if not ('GetResult' in input_data['Type'] or 'GetOutput' in input_data['Type'] or 'GetLog' in input_data['Type']):
- return {"StatusCode": 500, "StatusMessage": "RESULTS TYPE UNDEFINED"}
- if input_data['Id'] in TestRecord:
-
- if 'GetResult' in input_data['Type']:
-
- print "Result:", TestRecord[input_data['Id']]['Result']
-
- if 'StatusMessage' in TestRecord[input_data['Id']]['Result'] and getresults_block:
-
- print "*** Request blocked", input_data['Id']
-
- while ActiveProcess[input_data['Id']].is_alive():
- time.sleep(5)
-
- print "*** Request released ", input_data['Id']
-
- print TestRecord[input_data['Id']]['Result']
- if TestRecord[input_data['Id']]['Result']['StatusCode'] == 500:
- out_obj = TestRecord[input_data['Id']]['Result']['Results']
- else:
- out_obj = {"StatusCode": 200,
- "StatusMessage": "FINISHED",
- "PlaybookName": TestRecord[input_data['Id']]["PlaybookName"],
- "Version": TestRecord[input_data['Id']]["Version"],
- "Duration": TestRecord[input_data['Id']]["Duration"],
- "Results": TestRecord[input_data['Id']]['Result']['Results']}
- if not TestRecord[input_data['Id']]['Output']['Output'] == {}:
- for key in out_obj["Results"]:
- if key in TestRecord[input_data['Id']]['Output']['Output']:
- out_obj["Results"][key]["Output"] = TestRecord[input_data['Id']]['Output']['Output'][key]
-
- return out_obj
-
- elif 'GetOutput' in input_data['Type']:
-
- if TestRecord[input_data['Id']]['Output'] == {} and \
- getresults_block:
-
- print "*** Request blocked", input_data['Id']
-
- while TestRecord[input_data['Id']]['Output'] == {} \
- or 'StatusMessage' in TestRecord[input_data['Id']]['Result']:
- time.sleep(5)
-
- print "*** Request released ", input_data['Id']
-
- print "Output:", TestRecord[input_data['Id']]['Output']
- return {"Output": TestRecord[input_data['Id']]['Output']['Output']}
- else:
- # GetLog
-
- if TestRecord[input_data['Id']]['Log'] == '' and \
- getresults_block:
-
- print "*** Request blocked", input_data['Id']
-
- while TestRecord[input_data['Id']]['Log'] == '' \
- or 'StatusMessage' in TestRecord[input_data['Id']]['Result']:
- time.sleep(5)
-
- print "*** Request released ", input_data['Id']
-
- print "Log:", TestRecord[input_data['Id']]['Log']
- return {"Log": TestRecord[input_data['Id']]['Log']}
- else:
- return {"StatusCode": 500, "StatusMessage": "TEST ID UNDEFINED"}
- else:
- return {"StatusCode": 500, "StatusMessage": "MALFORMED REQUEST"}
- elif 'DELETE' in cherrypy.request.method:
- input_data = parse_query_string(cherrypy.request.query_string)
-
- print "***> in RestServer.DELETE"
- print " Payload: ", input_data
-
- if input_data['Id'] in TestRecord:
- if not 'PENDING' in TestRecord[input_data['Id']]['Result']:
- print " Path:", TestRecord[input_data['Id']]['Path']
- if os.path.exists(TestRecord[input_data['Id']]['Path']):
- shutil.rmtree (TestRecord[input_data['Id']]['Path'])
- TestRecord.pop (input_data['Id'])
- if input_data['Id'] in ActiveProcess:
- ActiveProcess.pop (input_data['Id'])
-
- return {"StatusCode": 200, "StatusMessage": "PLAYBOOK EXECUTION RECORDS DELETED"}
- else:
- return {"StatusCode": 200, "StatusMessage": "PENDING"}
- else:
- return {"StatusCode": 500, "StatusMessage": "TEST ID UNDEFINED"}
-
-
-if __name__ == '__main__':
-
- # Read configuration
-
- config_file_path = "RestServer_config"
-
- if not os.path.exists(config_file_path):
- print '[INFO] The config file does not exist'
- sys.exit(0)
-
- ip = 'na'
- port = 'na'
- tls = False
- auth = False
- pub = 'na'
- id = 'na'
- priv = 'na'
- psswd = 'na'
- timeout_seconds = 'na'
- ansible_path = 'na'
- ansible_inv = 'na'
- ansible_temp = 'na'
- host = 'na'
- user = 'na'
- passwd = 'na'
- db = 'na'
- getresults_block = False
- from_files = False
-
- file = open(config_file_path, 'r')
- for line in file.readlines():
- if '#' not in line:
- if 'ip:' in line:
- ip = line.split(':')[1].strip()
- elif 'port:' in line:
- port = line.split(':')[1].strip()
- elif 'tls:' in line:
- tls = 'YES' in line.split(':')[1].strip().upper()
- elif 'auth:' in line:
- auth = 'YES' in line.split(':')[1].strip().upper()
- if tls and 'priv:' in line:
- priv = line.split(':')[1].strip()
- if tls and 'pub:' in line:
- pub = line.split(':')[1].strip()
- if auth and 'id:' in line:
- id = line.split(':')[1].strip()
- if auth and 'psswd:' in line:
- psswd = line.split(':')[1].strip()
- if 'timeout_seconds' in line:
- timeout_seconds = int (line.split(':')[1].strip())
- if 'ansible_path' in line:
- ansible_path = line.split(':')[1].strip()
- if 'ansible_inv' in line:
- ansible_inv = line.split(':')[1].strip()
- if not os.path.exists(ansible_path + "/" + ansible_inv):
- print '[INFO] The ansible_inv file does not exist'
- sys.exit(0)
- if 'ansible_temp' in line:
- ansible_temp = line.split(':')[1].strip()
- if 'host' in line:
- host = line.split(':')[1].strip()
- if 'user' in line:
- user = line.split(':')[1].strip()
- if 'passwd' in line:
- passwd = line.split(':')[1].strip()
- if 'db' in line:
- db = line.split(':')[1].strip()
- if 'getresults_block' in line:
- getresults_block = 'YES' in line.split(':')[1].strip().upper()
- if 'from_files' in line:
- from_files = 'YES' in line.split(':')[1].strip().upper()
- file.close()
-
- # Initialization
-
- global_conf = {
- 'global': {
- 'server.socket_host': ip,
- 'server.socket_port': int(port),
- 'server.protocol_version': 'HTTP/1.1'
- }
- }
-
- if tls:
- # Use pythons built-in SSL
- cherrypy.server.ssl_module = 'builtin'
-
- # Point to certificate files
-
- if not os.path.exists(pub):
- print '[INFO] The public certificate does not exist'
- sys.exit(0)
-
- if not os.path.exists(priv):
- print '[INFO] The private key does not exist'
- sys.exit(0)
-
- cherrypy.server.ssl_certificate = pub
- cherrypy.server.ssl_private_key = priv
-
- if auth:
- userpassdict = {id: psswd}
- checkpassword = cherrypy.lib.auth_basic.checkpassword_dict(userpassdict)
-
- app_conf = {'/':
- {'tools.auth_basic.on': True,
- 'tools.auth_basic.realm': 'earth',
- 'tools.auth_basic.checkpassword': checkpassword,
- }
- }
-
- cherrypy.tree.mount(TestManager(), '/', app_conf)
- else:
- cherrypy.tree.mount(TestManager(), '/')
-
- cherrypy.config.update(global_conf)
-
- # Start server
-
- cherrypy.engine.start()
- cherrypy.engine.block()
diff --git a/installation/ansible-server/src/main/scripts/RestServer_config b/installation/ansible-server/src/main/scripts/RestServer_config
deleted file mode 100644
index a98d8749..00000000
--- a/installation/ansible-server/src/main/scripts/RestServer_config
+++ /dev/null
@@ -1,55 +0,0 @@
-# /*-
-# * ============LICENSE_START=======================================================
-# * ONAP : APPC
-# * ================================================================================
-# * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# * ================================================================================
-# * Copyright (C) 2017 Amdocs
-# * =============================================================================
-# * 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.
-# *
-# * ECOMP is a trademark and service mark of AT&T Intellectual Property.
-# * ============LICENSE_END=========================================================
-# */
-
-# Host definition
-ip: 0.0.0.0
-port: 8000
-
-# Security (controls use of TLS encrypton and RestServer authentication)
-tls: no
-auth: no
-
-# TLS certificates (must be built on application host)
-priv: provide_privated_key.pem
-pub: provide_public_key.pem
-
-# RestServer authentication
-id: sdnc
-psswd: sdnc
-
-# Mysql
-host: dbhost
-user: sdnc
-passwd: sdnc
-db: ansible
-
-# Playbooks
-from_files: yes
-ansible_path: /opt/onap/sdnc/Playbooks
-ansible_inv: Ansible_inventory
-ansible_temp: PlaybooksTemp
-timeout_seconds: 60
-
-# Blocking on GetResults
-getresults_block: yes
diff --git a/installation/ansible-server/src/main/scripts/startAnsibleServer.sh b/installation/ansible-server/src/main/scripts/startAnsibleServer.sh
deleted file mode 100644
index c35f7864..00000000
--- a/installation/ansible-server/src/main/scripts/startAnsibleServer.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-exec &> >(tee -a "/var/log/ansible-server.log")
-
-if [ ! -f /tmp/.ansible-server-installed ]
-then
- pip install PyMySQL
- pip install cherrypy
- pip install requests
-
- apt-get -y install software-properties-common
- apt-add-repository -y ppa:ansible/ansible
- apt-get -y install ansible
-
- cp /etc/ansible/ansible.cfg /etc/ansible/ansible.cfg.orig
- cat /etc/ansible/ansible.cfg.orig | sed -e 's/#host_key_checking/host_key_checking/' > /etc/ansible/ansible.cfg
- date > /tmp/.ansible-server-installed 2>&1
-fi
-
-cd /opt/onap/sdnc
-exec /usr/bin/python RestServer.py
="si"><https://jira.onap.org/browse/SO-1806>`__\ ] - Fix issue where null variable causes task to not - [`SO-1793 <https://jira.onap.org/browse/SO-1793>`__\ ] - add status for delete - [`SO-1792 <https://jira.onap.org/browse/SO-1792>`__\ ] - add status message requirement for create vf module event audit - [`SO-1791 <https://jira.onap.org/browse/SO-1791>`__\ ] - Moved base client to new location - [`SO-1790 <https://jira.onap.org/browse/SO-1790>`__\ ] - Enhanced sniro BB to account for sole service proxies to support 1908. - [`SO-1765 <https://jira.onap.org/browse/SO-1765>`__\ ] - Convert Tabs to Spaces - [`SO-1760 <https://jira.onap.org/browse/SO-1760>`__\ ] - Add Query param to pull back nested stack information - [`SO-1758 <https://jira.onap.org/browse/SO-1758>`__\ ] - Fix POM to allow HTTP long polling to work on camunda - [`SO-1749 <https://jira.onap.org/browse/SO-1749>`__\ ] - re add openstack audit of delete functions after refactor - [`SO-1748 <https://jira.onap.org/browse/SO-1748>`__\ ] - Add support to parse cdl inside LOB and platform - [`SO-1737 <https://jira.onap.org/browse/SO-1737>`__\ ] - if audit fails write sub interface data to a ai - [`SO-1729 <https://jira.onap.org/browse/SO-1729>`__\ ] - Monitor Job Status-Delete - [`SO-1687 <https://jira.onap.org/browse/SO-1687>`__\ ] - removed unused test classes and methods - [`SO-1678 <https://jira.onap.org/browse/SO-1678>`__\ ] - removed extra argument from extractByKey method - [`SO-1676 <https://jira.onap.org/browse/SO-1676>`__\ ] - replace all fixed wiremock ports - [`SO-1671 <https://jira.onap.org/browse/SO-1671>`__\ ] - skip_post_instantiation_configuration schema and tosca ingestion - [`SO-1657 <https://jira.onap.org/browse/SO-1657>`__\ ] - Automated testing for the SO Monitoring component - [`SO-1648 <https://jira.onap.org/browse/SO-1648>`__\ ] - Increasing the test coverage of SO-Monitoring UI - [`SO-1634 <https://jira.onap.org/browse/SO-1634>`__\ ] - Notification Handling - Terminate - [`SO-1633 <https://jira.onap.org/browse/SO-1633>`__\ ] - Terminate VNF (with SVNFM interaction) - [`SO-1632 <https://jira.onap.org/browse/SO-1632>`__\ ] - Handle VNF delete and termination (without SVNFM integration) - [`SO-1630 <https://jira.onap.org/browse/SO-1630>`__\ ] - Monitor Job Status-Create - [`SO-1629 <https://jira.onap.org/browse/SO-1629>`__\ ] - Notification Handling - Instantiate - [`SO-1628 <https://jira.onap.org/browse/SO-1628>`__\ ] - Handle Notification Subscription - [`SO-1627 <https://jira.onap.org/browse/SO-1627>`__\ ] - Create relationship between esr-vnfm and generic-vnf in AAI - [`SO-1626 <https://jira.onap.org/browse/SO-1626>`__\ ] - Monitor Node Status - [`SO-1625 <https://jira.onap.org/browse/SO-1625>`__\ ] - Handle Grant Request (Without Homing/OOF) - [`SO-1624 <https://jira.onap.org/browse/SO-1624>`__\ ] - Instantiate VNF (with SVNFM Interaction) - [`SO-1623 <https://jira.onap.org/browse/SO-1623>`__\ ] - Handle Create VNF request in VNFM adapter - [`SO-1622 <https://jira.onap.org/browse/SO-1622>`__\ ] - Check for existing VNF (with SVNFM Interaction) - [`SO-1621 <https://jira.onap.org/browse/SO-1621>`__\ ] - Create placeholder implementation for create VNF (without SVNFM interaction) - [`SO-1620 <https://jira.onap.org/browse/SO-1620>`__\ ] - Create Shell Adapter - [`SO-1619 <https://jira.onap.org/browse/SO-1619>`__\ ] - Create SO VNFM Adapter Northbound Interface using Swagger - [`SO-1618 <https://jira.onap.org/browse/SO-1618>`__\ ] - SVNFM Simulator - [`SO-1616 <https://jira.onap.org/browse/SO-1616>`__\ ] - Add instance group support to SO - [`SO-1604 <https://jira.onap.org/browse/SO-1604>`__\ ] - SO Catalog Enhancement to support CDS Meta Data for VNF/PNF and PNF Tosca Ingestion - [`SO-1598 <https://jira.onap.org/browse/SO-1598>`__\ ] - add equals and hashcode support to dslquerybuilder - [`SO-1597 <https://jira.onap.org/browse/SO-1597>`__\ ] - improvements to audit inventory feature - [`SO-1596 <https://jira.onap.org/browse/SO-1596>`__\ ] - query clients now have more useable result methods - [`SO-1590 <https://jira.onap.org/browse/SO-1590>`__\ ] - skip cloud region validation for 1906 - [`SO-1589 <https://jira.onap.org/browse/SO-1589>`__\ ] - flow validators can now be skipped via an annotation - [`SO-1582 <https://jira.onap.org/browse/SO-1582>`__\ ] - vnf spin up gr api vnf s base module fails - [`SO-1573 <https://jira.onap.org/browse/SO-1573>`__\ ] - Abstract for CDS Implementation - [`SO-1569 <https://jira.onap.org/browse/SO-1569>`__\ ] - do not attempt to commit empty transactions - [`SO-1538 <https://jira.onap.org/browse/SO-1538>`__\ ] - Integration Test for SO VNFM Adapter - Perform the functional test to validate VNFM Adapter NBI and SOL003-based SBI - [`SO-1534 <https://jira.onap.org/browse/SO-1534>`__\ ] - Create Pre Building Block validator to check if cloud-region orchestration-disabled is true - [`SO-1533 <https://jira.onap.org/browse/SO-1533>`__\ ] - flowvaldiator will allow more flexible filtering - [`SO-1512 <https://jira.onap.org/browse/SO-1512>`__\ ] - Added Camunda migration scripts and updated camunda springboot version - [`SO-1506 <https://jira.onap.org/browse/SO-1506>`__\ ] - E2E Automation - Extend PNF workflow with post-instantiation configuration - [`SO-1501 <https://jira.onap.org/browse/SO-1501>`__\ ] - add new functionality to aai client - [`SO-1495 <https://jira.onap.org/browse/SO-1495>`__\ ] - made max retries configurable via mso config repo - [`SO-1493 <https://jira.onap.org/browse/SO-1493>`__\ ] - restructure a&ai client - [`SO-1487 <https://jira.onap.org/browse/SO-1487>`__\ ] - added license headers to various java files - [`SO-1485 <https://jira.onap.org/browse/SO-1485>`__\ ] - add DSL endpoint support to A&AI Client - [`SO-1483 <https://jira.onap.org/browse/SO-1483>`__\ ] - SO to support a new GRPC client for container to container communication - [`SO-1482 <https://jira.onap.org/browse/SO-1482>`__\ ] - SO Generic Building Block to support config deploy action for CONFIGURE Step - [`SO-1481 <https://jira.onap.org/browse/SO-1481>`__\ ] - Generic Bulding block for assign shall trigger controller for config assign action - [`SO-1477 <https://jira.onap.org/browse/SO-1477>`__\ ] - AAF support for SO - [`SO-1476 <https://jira.onap.org/browse/SO-1476>`__\ ] - Do not process vf module being created when building an index - [`SO-1475 <https://jira.onap.org/browse/SO-1475>`__\ ] - store raw distribution notification in db - [`SO-1474 <https://jira.onap.org/browse/SO-1474>`__\ ] - Test Issue - [`SO-1469 <https://jira.onap.org/browse/SO-1469>`__\ ] - Refactor OOF Homing to Java - [`SO-1462 <https://jira.onap.org/browse/SO-1462>`__\ ] - Clean up AT&T Acronyms from Unit tests for audit - [`SO-1459 <https://jira.onap.org/browse/SO-1459>`__\ ] - add maven build properties to spring actuator - [`SO-1456 <https://jira.onap.org/browse/SO-1456>`__\ ] - prototype fetching resources from openstack and compare to a ai - [`SO-1452 <https://jira.onap.org/browse/SO-1452>`__\ ] - added list of flows to execution for cockpit - [`SO-1451 <https://jira.onap.org/browse/SO-1451>`__\ ] - Updated the SDC API call with the ECOMP OE from AAI - [`SO-1450 <https://jira.onap.org/browse/SO-1450>`__\ ] - support for secure communications between SO and Multicloud - [`SO-1447 <https://jira.onap.org/browse/SO-1447>`__\ ] - Refine multicloud use of SO cloudsites and identify DB - [`SO-1446 <https://jira.onap.org/browse/SO-1446>`__\ ] - Multicloud API updates for generic clouds - [`SO-1445 <https://jira.onap.org/browse/SO-1445>`__\ ] - Multicloud support for volume groups and networks - [`SO-1444 <https://jira.onap.org/browse/SO-1444>`__\ ] - AAI update after vfmodule creation - [`SO-1443 <https://jira.onap.org/browse/SO-1443>`__\ ] - Prepare user_directives for multicloud API - [`SO-1442 <https://jira.onap.org/browse/SO-1442>`__\ ] - Prepare sdnc_directives for multicloud API - [`SO-1441 <https://jira.onap.org/browse/SO-1441>`__\ ] - Handle distribution of service with generic cloud artifacts - [`SO-1436 <https://jira.onap.org/browse/SO-1436>`__\ ] - removed unnecessary repository from pom.xml - [`SO-1432 <https://jira.onap.org/browse/SO-1432>`__\ ] - duplicate add custom object support to a ai client - [`SO-1431 <https://jira.onap.org/browse/SO-1431>`__\ ] - Test issue 1 - [`SO-1429 <https://jira.onap.org/browse/SO-1429>`__\ ] - add custom object support to a ai client - [`SO-1427 <https://jira.onap.org/browse/SO-1427>`__\ ] - Fix to include alloc pool from dhcpStart/end on reqs - [`SO-1426 <https://jira.onap.org/browse/SO-1426>`__\ ] - Upgraded tosca parser to version 1.4.8 and updated imports - [`SO-1425 <https://jira.onap.org/browse/SO-1425>`__\ ] - Re-Factor DMAAP Credentials to use encrypted auth - [`SO-1421 <https://jira.onap.org/browse/SO-1421>`__\ ] - Support for SO->ExtAPI interface/API - [`SO-1414 <https://jira.onap.org/browse/SO-1414>`__\ ] - update all inprogress checks in apih handler - [`SO-1413 <https://jira.onap.org/browse/SO-1413>`__\ ] - replaced org.mockito.Matchers with ArgumentMatchers - [`SO-1411 <https://jira.onap.org/browse/SO-1411>`__\ ] - Test Issue - [`SO-1409 <https://jira.onap.org/browse/SO-1409>`__\ ] - added in validation for number of keys provided - [`SO-1405 <https://jira.onap.org/browse/SO-1405>`__\ ] - apih infra shall ensure data for si matches on macro requests - [`SO-1404 <https://jira.onap.org/browse/SO-1404>`__\ ] - covert sync calls for create and delete network to async - [`SO-1395 <https://jira.onap.org/browse/SO-1395>`__\ ] - E2E Automation - PreInstatition and PostInstatition use cases - [`SO-1389 <https://jira.onap.org/browse/SO-1389>`__\ ] - added mso-request-id when calling SDNCHandler subflow - [`SO-1388 <https://jira.onap.org/browse/SO-1388>`__\ ] - descriptive messages now returned by validator - [`SO-1387 <https://jira.onap.org/browse/SO-1387>`__\ ] - naming ms client fixes - [`SO-1385 <https://jira.onap.org/browse/SO-1385>`__\ ] - removed retired A&AI versions from codebase - [`SO-1384 <https://jira.onap.org/browse/SO-1384>`__\ ] - sdnc handler was not sending workflow exception upwards - [`SO-1383 <https://jira.onap.org/browse/SO-1383>`__\ ] - refactored validator to be more generic - [`SO-1381 <https://jira.onap.org/browse/SO-1381>`__\ ] - Quality of Life logging improvements - [`SO-1380 <https://jira.onap.org/browse/SO-1380>`__\ ] - Service Proxy Consolidation - [`SO-1379 <https://jira.onap.org/browse/SO-1379>`__\ ] - Add validation for vnfs before WorkflowAction starts - [`SO-1378 <https://jira.onap.org/browse/SO-1378>`__\ ] - get subnet sequence number from A&AI - [`SO-1377 <https://jira.onap.org/browse/SO-1377>`__\ ] - Re-enable Actuator for Springboot 2.0 - [`SO-1376 <https://jira.onap.org/browse/SO-1376>`__\ ] - Created sniro request pojos for homingV2 flow - [`SO-1370 <https://jira.onap.org/browse/SO-1370>`__\ ] - Preparation for next scale-out after successful instantiation of the current scale-out operation - [`SO-1369 <https://jira.onap.org/browse/SO-1369>`__\ ] - Processing of configuration parameters during instantiation and scale-out - [`SO-1368 <https://jira.onap.org/browse/SO-1368>`__\ ] - VNF Health check during scale-out to be made as a separate workflow - [`SO-1367 <https://jira.onap.org/browse/SO-1367>`__\ ] - Invoke the APP-C service configuration API after E2E Service instantiation - [`SO-1366 <https://jira.onap.org/browse/SO-1366>`__\ ] - SO Workflow need to call configure API during instantiation - [`SO-1362 <https://jira.onap.org/browse/SO-1362>`__\ ] - Changed the MDC sourcing from LoggingInterceptor to JaxRsFilterLogging. - [`SO-1346 <https://jira.onap.org/browse/SO-1346>`__\ ] - Use SLF4J/Logback, instead of Log4J - [`SO-1307 <https://jira.onap.org/browse/SO-1307>`__\ ] - Add Headers - [`SO-1295 <https://jira.onap.org/browse/SO-1295>`__\ ] - Update SDNC client Version in POM - [`SO-1293 <https://jira.onap.org/browse/SO-1293>`__\ ] - Vnf Recreate - [`SO-1290 <https://jira.onap.org/browse/SO-1290>`__\ ] - Update orchestrationrequest response - [`SO-1288 <https://jira.onap.org/browse/SO-1288>`__\ ] - Enhance GRM Clients to use encrypted auth loading - [`SO-1287 <https://jira.onap.org/browse/SO-1287>`__\ ] - Change all SDNC Calls in GR_API - [`SO-1284 <https://jira.onap.org/browse/SO-1284>`__\ ] - Create Relationship between Vnf and Tenant - [`SO-1283 <https://jira.onap.org/browse/SO-1283>`__\ ] - Fix GR_API cloud info retrieval - [`SO-1282 <https://jira.onap.org/browse/SO-1282>`__\ ] - Update Alacarte Logic for Recreate Flow - [`SO-1279 <https://jira.onap.org/browse/SO-1279>`__\ ] - Replaced the VNFC hardcoded Function - [`SO-1278 <https://jira.onap.org/browse/SO-1278>`__\ ] - Move all ecomp.mso properties to org.onap.so - [`SO-1276 <https://jira.onap.org/browse/SO-1276>`__\ ] - Add Cloud_Owner to northbound request table - [`SO-1275 <https://jira.onap.org/browse/SO-1275>`__\ ] - Resolve path issues - [`SO-1274 <https://jira.onap.org/browse/SO-1274>`__\ ] - CreateAndUpdatePNFResource workflow:: Associate PNF instance - [`SO-1272 <https://jira.onap.org/browse/SO-1272>`__\ ] - Use UUID to fill pnf-id in PNF PnP sub-flow - [`SO-1270 <https://jira.onap.org/browse/SO-1270>`__\ ] - Add New A&AI objects - [`SO-1269 <https://jira.onap.org/browse/SO-1269>`__\ ] - Add serviceRole to MSO SNIRO Interface - [`SO-1260 <https://jira.onap.org/browse/SO-1260>`__\ ] - Add support for naming service - [`SO-1233 <https://jira.onap.org/browse/SO-1233>`__\ ] - Added service role to sniro request when not null - [`SO-1232 <https://jira.onap.org/browse/SO-1232>`__\ ] - Switch to SpringAutoDeployment rather than processes.xml - [`SO-1229 <https://jira.onap.org/browse/SO-1229>`__\ ] - Remove all usage of AlarmLogger - [`SO-1228 <https://jira.onap.org/browse/SO-1228>`__\ ] - Limit Number of Occurs for security reasons - [`SO-1227 <https://jira.onap.org/browse/SO-1227>`__\ ] - Remove Swagger UI due to security scan concerns - [`SO-1226 <https://jira.onap.org/browse/SO-1226>`__\ ] - changed assign vnf sdnc to use the async subflow - [`SO-1225 <https://jira.onap.org/browse/SO-1225>`__\ ] - Add Keystone V3 Support - [`SO-1207 <https://jira.onap.org/browse/SO-1207>`__\ ] - accept a la carte create instance group request from vid - [`SO-1206 <https://jira.onap.org/browse/SO-1206>`__\ ] - Added groupInstanceId and groupInstanceName columns - [`SO-1205 <https://jira.onap.org/browse/SO-1205>`__\ ] - separate error status from progression status in req db - [`SO-806 <https://jira.onap.org/browse/SO-806>`__\ ] - SO PNF PnP workflow shall not set "in-maint" AAI flag - [`SO-798 <https://jira.onap.org/browse/SO-798>`__\ ] - Externalize the PNF PnP workflow? as a Service Instance Deployment workflow? adding the Controller - [`SO-747 <https://jira.onap.org/browse/SO-747>`__\ ] - POC - Enable SO use of Multicloud Generic VNF Instantiation API - [`SO-700 <https://jira.onap.org/browse/SO-700>`__\ ] - SO should be able to support CCVPN service assurance - [`SO-588 <https://jira.onap.org/browse/SO-588>`__\ ] - Automate robot heatbridge manual step to add VF Module stack resources in AAI - [`SO-18 <https://jira.onap.org/browse/SO-18>`__\ ] - Keystone v3 Support in MSO - [`SO-12 <https://jira.onap.org/browse/SO-12>`__\ ] - Support Ocata apis - [`SO-10 <https://jira.onap.org/browse/SO-10>`__\ ] - Deploy a MSO high availability environment - [`SO-7 <https://jira.onap.org/browse/SO-7>`__\ ] - Move modified openstack library to common functions repos - [`SO-6 <https://jira.onap.org/browse/SO-6>`__\ ] - Document how to change username/password for UIs **Security Notes** SO code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and determined to be false positive. The SO open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=43385708>`_. Quick Links: - `SO project page <https://wiki.onap.org/display/DW/Service+Orchestrator+Project>`_ - `Passing Badge information for SO <https://bestpractices.coreinfrastructure.org/en/projects/1702>`_ - `Project Vulnerability Review Table for SO <https://wiki.onap.org/pages/viewpage.action?pageId=43385708>`_ **Known Issues** Testing Terminate and Delete of ETSI VNFM Adapter is done and has some of the minor issues pending, it will be done in El Alto. - [`SO-2013 <https://jira.onap.org/browse/SO-2013>`__\ ] - Test Terminate/Delete VNF with VNFM Adapter **Upgrade Notes** N/A **Deprecation Notes** N/A **Other** N/A Version: 1.4.1 -------------- :Release Date: 2019-04-19 This is the dublin release base version separated from master branch. Version: 1.3.7 -------------- :Release Date: 2019-01-31 This is the official release package that released for the Casablanca Maintenance. Casablanca Release branch **New Features** This release is supporting the features of Casablanca and their defect fixes. - `SO-1400 <https://jira.onap.org/browse/SO-1336>`_ - `SO-1408 <https://jira.onap.org/browse/SO-1408>`_ - `SO-1416 <https://jira.onap.org/browse/SO-1416>`_ - `SO-1417 <https://jira.onap.org/browse/SO-1417>`_ **Docker Images** Dockers released for SO: - onap/so/api-handler-infra,1.3.7 - onap/so/bpmn-infra,1.3.7 - onap/so/catalog-db-adapter,1.3.7 - onap/so/openstack-adapter,1.3.7 - onap/so/request-db-adapter,1.3.7 - onap/so/sdc-controller,1.3.7 - onap/so/sdnc-adapter,1.3.7 - onap/so/so-monitoring,1.3.7 - onap/so/vfc-adapter,1.3.7 **Known Issues** - `SO-1419 <https://jira.onap.org/browse/SO-1419>`_ - is a stretch goal that is under examination. - `SDC-1955 <https://jira.onap.org/browse/SDC-1955>`_ - tested with a workaround to avoid this scenario. To be tested further with updated dockers of SDC, UUI and SO. **Security Notes** SO code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and determined to be false positive. The SO open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=43385708>`_. Quick Links: - `SO project page <https://wiki.onap.org/display/DW/Service+Orchestrator+Project>`_ - `Passing Badge information for SO <https://bestpractices.coreinfrastructure.org/en/projects/1702>`_ - `Project Vulnerability Review Table for SO <https://wiki.onap.org/pages/viewpage.action?pageId=43385708>`_ Version: 1.3.6 -------------- :Release Date: 2019-01-10 This is the official release package that released for the Casablanca Maintenance. Casablanca Release branch **New Features** This release is supporting the features of Casablanca and their defect fixes. - `SO-1336 <https://jira.onap.org/browse/SO-1336>`_ - `SO-1249 <https://jira.onap.org/browse/SO-1249>`_ - `SO-1257 <https://jira.onap.org/browse/SO-1257>`_ - `SO-1258 <https://jira.onap.org/browse/SO-1258>`_ - `SO-1256 <https://jira.onap.org/browse/SO-1256>`_ - `SO-1194 <https://jira.onap.org/browse/SO-1256>`_ - `SO-1248 <https://jira.onap.org/browse/SO-1248>`_ - `SO-1184 <https://jira.onap.org/browse/SO-1184>`_ **Docker Images** Dockers released for SO: - onap/so/api-handler-infra,1.3.6 - onap/so/bpmn-infra,1.3.6 - onap/so/catalog-db-adapter,1.3.6 - onap/so/openstack-adapter,1.3.6 - onap/so/request-db-adapter,1.3.6 - onap/so/sdc-controller,1.3.6 - onap/so/sdnc-adapter,1.3.6 - onap/so/so-monitoring,1.3.6 - onap/so/vfc-adapter,1.3.6 **Known Issues** **Security Notes** SO code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and determined to be false positive. The SO open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=43385708>`_. Quick Links: - `SO project page <https://wiki.onap.org/display/DW/Service+Orchestrator+Project>`_ - `Passing Badge information for SO <https://bestpractices.coreinfrastructure.org/en/projects/1702>`_ - `Project Vulnerability Review Table for SO <https://wiki.onap.org/pages/viewpage.action?pageId=43385708>`_ New release over master branch for Dublin development Version: 1.3.3 -------------- :Release Date: 2018-11-30 This is the official release package that was tested against the 72 hour stability test in integration environment. Casablanca Release branch **New Features** Features delivered in this release: - Automatic scale out of VNFs. - Extend the support of homing to vFW, vCPE usecases through HPA. - Monitoring BPMN workflow capabilities through UI. - SO internal architecture improvements. - Support PNF resource type. - Support to the CCVPN Usecase. - Workflow Designer Integration. **Docker Images** Dockers released for SO: - onap/so/api-handler-infra,1.3.3 - onap/so/bpmn-infra,1.3.3 - onap/so/catalog-db-adapter,1.3.3 - onap/so/openstack-adapter,1.3.3 - onap/so/request-db-adapter,1.3.3 - onap/so/sdc-controller,1.3.3 - onap/so/sdnc-adapter,1.3.3 - onap/so/so-monitoring,1.3.3 - onap/so/vfc-adapter,1.3.3 **Known Issues** There are some issues around the HPA and CCVPN that have been resolved in the patch release of 1.3.5 - `SO-1249 <https://jira.onap.org/browse/SO-1249>`_ The workflow for resource processing use the wrong default value. - `SO-1257 <https://jira.onap.org/browse/SO-1257>`_ Authorization header added to multicloud adapter breaks communication. - `SO-1258 <https://jira.onap.org/browse/SO-1258>`_ OOF Directives are not passed through flows to Multicloud Adapter. - `SO-1256 <https://jira.onap.org/browse/SO-1256>`_ Permission support for Vfcadapter is missing. - `SO-1194 <https://jira.onap.org/browse/SO-1194>`_ Unable to find TOSCA CSAR location using ServiceModelUUID in DoCreateResource BPMN flow. Below issues will be resolved in the next release: - `SO-1248 <https://jira.onap.org/browse/SO-1248>`_ Csar needs to be manually placed into the bpmn corresponding directory. - `SO-1184 <https://jira.onap.org/browse/SO-1184>`_ Database table is not populated for Generic NeutronNet resource. **Security Notes** SO code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and determined to be false positive. The SO open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=43385708>`_. Quick Links: - `SO project page <https://wiki.onap.org/display/DW/Service+Orchestrator+Project>`_ - `Passing Badge information for SO <https://bestpractices.coreinfrastructure.org/en/projects/1702>`_ - `Project Vulnerability Review Table for SO <https://wiki.onap.org/pages/viewpage.action?pageId=43385708>`_ Version: 1.3.1 -------------- :Release Date: 2018-10-24 Branch cut for Casablanca post M4 for integration test. **New Features** Below features are under test: - Automatic scale out of VNFs. - Extend the support of homing to vFW, vCPE usecases through HPA. - Monitoring BPMN workflow capabilities through UI. - SO internal architecture improvements. - Support PNF resource type. - Support to the CCVPN Usecase. - Workflow Designer Integration. Version: 1.3.0 -------------- :Release Date: 2018-08-22 New release over master branch for Casablanca development Version: 1.2.2 -------------- :Release Date: 2018-06-07 The Beijing release is the second release of the Service Orchestrator (SO) project. **New Features** * Enhance Platform maturity by improving SO maturity matrix see `Wiki <https://wiki.onap.org/display/DW/Beijing+Release+Platform+Maturity>`_. * Manual scaling of network services and VNFs. * Homing and placement capabilities through OOF interaction. * Ability to perform change management. * Integrated to APPC * Integrated to OOF * Integrated to OOM **Bug Fixes** The defects fixed in this release could be found `here <https://jira.onap.org/issues/?jql=project%20%3D%20SO%20AND%20affectedVersion%20%3D%20%22Beijing%20Release%22%20AND%20status%20%3D%20Closed%20>`_. **Known Issues** SO docker image is still on ecmop and not onap in the repository. This will be addressed in the next release. **Security Notes** SO code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and determined to be false positive. The SO open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=28377799>`_. Quick Links: - `SO project page <https://wiki.onap.org/display/DW/Service+Orchestrator+Project>`_ - `Passing Badge information for SO <https://bestpractices.coreinfrastructure.org/en/projects/1702>`_ - `Project Vulnerability Review Table for SO <https://wiki.onap.org/pages/viewpage.action?pageId=28377799>`_ **Upgrade Notes** NA **Deprecation Notes** NA Version: 1.1.2 -------------- :Release Date: 2018-01-18 Bug Fixes --------- The key defects fixed in this release : - `SO-344 <https://jira.onap.org/browse/SO-344>`_ Only pass one VNF to DoCreateVnfAndModules. - `SO-348 <https://jira.onap.org/browse/SO-348>`_ Json Analyze Exception in PreProcessRequest. - `SO-352 <https://jira.onap.org/browse/SO-352>`_ SO failed to create VNF - with error message: Internal Error Occurred in CreateVnfInfra QueryCatalogDB Process. - `SO-354 <https://jira.onap.org/browse/SO-354>`_ Change the Service Type And Service Role Version: 1.1.1 -------------- :Release Date: 2017-11-16 **New Features** The SO provides the highest level of service orchestration in the ONAP architecture. It executes end-to-end service activities by processing workflows and business logic and coordinating other ONAP and external component activities. The orchestration engine is a reusable service. Any component of the architecture can execute SO orchestration capabilities. * Orchestration services will process workflows based on defined models and recipe. * The service model maintains consistency and re-usability across all orchestration activities and ensures consistent methods, structure and version of the workflow execution environment. * Orchestration processes interact with other platform components or external systems via standard and well-defined APIs. **Deprecation Notes** There is a MSO 1.0.0 SO implementation existing in the pre-R1 ONAP Gerrit system. The MSO1.0.0 is deprecated by the R1 release and the current release is built over this release. The Gerrit repos of mso/* are voided and already locked as read-only. Following are the deprecated SO projects in gerrit repo: - mso - mso/chef-repo - mso/docker-config - mso/libs - mso/mso-config **Other** NA =========== End of Release Notes