[CORD-2636]
Remove obsolete/unused files
Change-Id: Ie2d4631b2c5171d0452b3ca9b13553703f990547
diff --git a/ansible/build-ovs.yml b/ansible/build-ovs.yml
deleted file mode 100644
index 6a4112f..0000000
--- a/ansible/build-ovs.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-- hosts: localhost
- serial: 1
- roles:
- - ovs-deb-packages
diff --git a/ansible/corddev.yml b/ansible/corddev.yml
deleted file mode 100644
index 256930c..0000000
--- a/ansible/corddev.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
-- hosts: localhost
- remote_user: vagrant
- serial: 1
- roles:
- - common
- - docker
- - docker-compose
- - consul-template
- - java8-oracle
- - buildtools
diff --git a/ansible/fakeswitch.yml b/ansible/fakeswitch.yml
deleted file mode 100644
index 365920e..0000000
--- a/ansible/fakeswitch.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
-- hosts: localhost
- remote_user: vagrant
- serial: 1
- roles:
- - common
- - fakeswitch
diff --git a/ansible/leafswitch.yml b/ansible/leafswitch.yml
deleted file mode 100644
index 38e77f8..0000000
--- a/ansible/leafswitch.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Set up virtual switch
- hosts: all
- become: yes
- serial: 1
- roles:
- - common
- - fakeswitch
- - fakeswitch-mgmt-net
- - leafswitch
diff --git a/ansible/opencloud-in-a-box-playbook.yml b/ansible/opencloud-in-a-box-playbook.yml
deleted file mode 100644
index 9d04e68..0000000
--- a/ansible/opencloud-in-a-box-playbook.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
----
-# opencloud-in-a-box-playbook.yml
-# configures host for running the OpenCloud-in-a-Box
-
-- name: Include vars
- hosts: localhost
- tasks:
- - name: Include vars
- include_vars: "../config/opencloud_in_a_box.yaml"
-
-- name: Configure libvirt networks
- hosts: localhost
- roles:
- - virt-nets
-
diff --git a/ansible/prod.yml b/ansible/prod.yml
deleted file mode 100644
index e657f0c..0000000
--- a/ansible/prod.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
----
-
-- hosts: localhost
- remote_user: vagrant
- serial: 1
- roles:
- - common
- - head-net
diff --git a/ansible/prodseed.yml b/ansible/prodseed.yml
deleted file mode 100644
index 6da008f..0000000
--- a/ansible/prodseed.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
-- hosts: prod
- remote_user: vagrant
- serial: 1
- roles:
- - common
- - docker
- - docker-compose
- - consul-template
- - registry
- - java8-oracle
diff --git a/ansible/roles/buildtools/defaults/main.yml b/ansible/roles/buildtools/defaults/main.yml
deleted file mode 100644
index a150b10..0000000
--- a/ansible/roles/buildtools/defaults/main.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
-apt_packages:
- - maven
- - git=1:2.14*
- - libxml-xpath-perl
diff --git a/ansible/roles/buildtools/files/repo.bin b/ansible/roles/buildtools/files/repo.bin
deleted file mode 100644
index f9eb9e8..0000000
--- a/ansible/roles/buildtools/files/repo.bin
+++ /dev/null
@@ -1,883 +0,0 @@
-#!/usr/bin/env python
-
-# repo default configuration
-#
-import os
-REPO_URL = os.environ.get('REPO_URL', None)
-if not REPO_URL:
- REPO_URL = 'https://gerrit.googlesource.com/git-repo'
-REPO_REV = 'stable'
-
-# Copyright (C) 2008 Google Inc.
-#
-# 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.
-
-# increment this whenever we make important changes to this script
-VERSION = (1, 23)
-
-# increment this if the MAINTAINER_KEYS block is modified
-KEYRING_VERSION = (1, 2)
-MAINTAINER_KEYS = """
-
- Repo Maintainer <repo@android.kernel.org>
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.2.2 (GNU/Linux)
-
-mQGiBEj3ugERBACrLJh/ZPyVSKeClMuznFIrsQ+hpNnmJGw1a9GXKYKk8qHPhAZf
-WKtrBqAVMNRLhL85oSlekRz98u41H5si5zcuv+IXJDF5MJYcB8f22wAy15lUqPWi
-VCkk1l8qqLiuW0fo+ZkPY5qOgrvc0HW1SmdH649uNwqCbcKb6CxaTxzhOwCgj3AP
-xI1WfzLqdJjsm1Nq98L0cLcD/iNsILCuw44PRds3J75YP0pze7YF/6WFMB6QSFGu
-aUX1FsTTztKNXGms8i5b2l1B8JaLRWq/jOnZzyl1zrUJhkc0JgyZW5oNLGyWGhKD
-Fxp5YpHuIuMImopWEMFIRQNrvlg+YVK8t3FpdI1RY0LYqha8pPzANhEYgSfoVzOb
-fbfbA/4ioOrxy8ifSoga7ITyZMA+XbW8bx33WXutO9N7SPKS/AK2JpasSEVLZcON
-ae5hvAEGVXKxVPDjJBmIc2cOe7kOKSi3OxLzBqrjS2rnjiP4o0ekhZIe4+ocwVOg
-e0PLlH5avCqihGRhpoqDRsmpzSHzJIxtoeb+GgGEX8KkUsVAhbQpUmVwbyBNYWlu
-dGFpbmVyIDxyZXBvQGFuZHJvaWQua2VybmVsLm9yZz6IYAQTEQIAIAUCSPe6AQIb
-AwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEBZTDV6SD1xl1GEAn0x/OKQpy7qI
-6G73NJviU0IUMtftAKCFMUhGb/0bZvQ8Rm3QCUpWHyEIu7kEDQRI97ogEBAA2wI6
-5fs9y/rMwD6dkD/vK9v4C9mOn1IL5JCPYMJBVSci+9ED4ChzYvfq7wOcj9qIvaE0
-GwCt2ar7Q56me5J+byhSb32Rqsw/r3Vo5cZMH80N4cjesGuSXOGyEWTe4HYoxnHv
-gF4EKI2LK7xfTUcxMtlyn52sUpkfKsCpUhFvdmbAiJE+jCkQZr1Z8u2KphV79Ou+
-P1N5IXY/XWOlq48Qf4MWCYlJFrB07xjUjLKMPDNDnm58L5byDrP/eHysKexpbakL
-xCmYyfT6DV1SWLblpd2hie0sL3YejdtuBMYMS2rI7Yxb8kGuqkz+9l1qhwJtei94
-5MaretDy/d/JH/pRYkRf7L+ke7dpzrP+aJmcz9P1e6gq4NJsWejaALVASBiioqNf
-QmtqSVzF1wkR5avZkFHuYvj6V/t1RrOZTXxkSk18KFMJRBZrdHFCWbc5qrVxUB6e
-N5pja0NFIUCigLBV1c6I2DwiuboMNh18VtJJh+nwWeez/RueN4ig59gRTtkcc0PR
-35tX2DR8+xCCFVW/NcJ4PSePYzCuuLvp1vEDHnj41R52Fz51hgddT4rBsp0nL+5I
-socSOIIezw8T9vVzMY4ArCKFAVu2IVyBcahTfBS8q5EM63mONU6UVJEozfGljiMw
-xuQ7JwKcw0AUEKTKG7aBgBaTAgT8TOevpvlw91cAAwUP/jRkyVi/0WAb0qlEaq/S
-ouWxX1faR+vU3b+Y2/DGjtXQMzG0qpetaTHC/AxxHpgt/dCkWI6ljYDnxgPLwG0a
-Oasm94BjZc6vZwf1opFZUKsjOAAxRxNZyjUJKe4UZVuMTk6zo27Nt3LMnc0FO47v
-FcOjRyquvgNOS818irVHUf12waDx8gszKxQTTtFxU5/ePB2jZmhP6oXSe4K/LG5T
-+WBRPDrHiGPhCzJRzm9BP0lTnGCAj3o9W90STZa65RK7IaYpC8TB35JTBEbrrNCp
-w6lzd74LnNEp5eMlKDnXzUAgAH0yzCQeMl7t33QCdYx2hRs2wtTQSjGfAiNmj/WW
-Vl5Jn+2jCDnRLenKHwVRFsBX2e0BiRWt/i9Y8fjorLCXVj4z+7yW6DawdLkJorEo
-p3v5ILwfC7hVx4jHSnOgZ65L9s8EQdVr1ckN9243yta7rNgwfcqb60ILMFF1BRk/
-0V7wCL+68UwwiQDvyMOQuqkysKLSDCLb7BFcyA7j6KG+5hpsREstFX2wK1yKeraz
-5xGrFy8tfAaeBMIQ17gvFSp/suc9DYO0ICK2BISzq+F+ZiAKsjMYOBNdH/h0zobQ
-HTHs37+/QLMomGEGKZMWi0dShU2J5mNRQu3Hhxl3hHDVbt5CeJBb26aQcQrFz69W
-zE3GNvmJosh6leayjtI9P2A6iEkEGBECAAkFAkj3uiACGwwACgkQFlMNXpIPXGWp
-TACbBS+Up3RpfYVfd63c1cDdlru13pQAn3NQy/SN858MkxN+zym86UBgOad2
-=CMiZ
------END PGP PUBLIC KEY BLOCK-----
-
- Conley Owens <cco3@android.com>
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.11 (GNU/Linux)
-
-mQENBFHRvc8BCADFg45Xx/y6QDC+T7Y/gGc7vx0ww7qfOwIKlAZ9xG3qKunMxo+S
-hPCnzEl3cq+6I1Ww/ndop/HB3N3toPXRCoN8Vs4/Hc7by+SnaLFnacrm+tV5/OgT
-V37Lzt8lhay1Kl+YfpFwHYYpIEBLFV9knyfRXS/428W2qhdzYfvB15/AasRmwmor
-py4NIzSs8UD/SPr1ihqNCdZM76+MQyN5HMYXW/ALZXUFG0pwluHFA7hrfPG74i8C
-zMiP7qvMWIl/r/jtzHioH1dRKgbod+LZsrDJ8mBaqsZaDmNJMhss9g76XvfMyLra
-9DI9/iFuBpGzeqBv0hwOGQspLRrEoyTeR6n1ABEBAAG0H0NvbmxleSBPd2VucyA8
-Y2NvM0BhbmRyb2lkLmNvbT6JATgEEwECACIFAlHRvc8CGwMGCwkIBwMCBhUIAgkK
-CwQWAgMBAh4BAheAAAoJEGe35EhpKzgsP6AIAJKJmNtn4l7hkYHKHFSo3egb6RjQ
-zEIP3MFTcu8HFX1kF1ZFbrp7xqurLaE53kEkKuAAvjJDAgI8mcZHP1JyplubqjQA
-xvv84gK+OGP3Xk+QK1ZjUQSbjOpjEiSZpRhWcHci3dgOUH4blJfByHw25hlgHowd
-a/2PrNKZVcJ92YienaxxGjcXEUcd0uYEG2+rwllQigFcnMFDhr9B71MfalRHjFKE
-fmdoypqLrri61YBc59P88Rw2/WUpTQjgNubSqa3A2+CKdaRyaRw+2fdF4TdR0h8W
-zbg+lbaPtJHsV+3mJC7fq26MiJDRJa5ZztpMn8su20gbLgi2ShBOaHAYDDi5AQ0E
-UdG9zwEIAMoOBq+QLNozAhxOOl5GL3StTStGRgPRXINfmViTsihrqGCWBBUfXlUE
-OytC0mYcrDUQev/8ToVoyqw+iGSwDkcSXkrEUCKFtHV/GECWtk1keyHgR10YKI1R
-mquSXoubWGqPeG1PAI74XWaRx8UrL8uCXUtmD8Q5J7mDjKR5NpxaXrwlA0bKsf2E
-Gp9tu1kKauuToZhWHMRMqYSOGikQJwWSFYKT1KdNcOXLQF6+bfoJ6sjVYdwfmNQL
-Ixn8QVhoTDedcqClSWB17VDEFDFa7MmqXZz2qtM3X1R/MUMHqPtegQzBGNhRdnI2
-V45+1Nnx/uuCxDbeI4RbHzujnxDiq70AEQEAAYkBHwQYAQIACQUCUdG9zwIbDAAK
-CRBnt+RIaSs4LNVeB/0Y2pZ8I7gAAcEM0Xw8drr4omg2fUoK1J33ozlA/RxeA/lJ
-I3KnyCDTpXuIeBKPGkdL8uMATC9Z8DnBBajRlftNDVZS3Hz4G09G9QpMojvJkFJV
-By+01Flw/X+eeN8NpqSuLV4W+AjEO8at/VvgKr1AFvBRdZ7GkpI1o6DgPe7ZqX+1
-dzQZt3e13W0rVBb/bUgx9iSLoeWP3aq/k+/GRGOR+S6F6BBSl0SQ2EF2+dIywb1x
-JuinEP+AwLAUZ1Bsx9ISC0Agpk2VeHXPL3FGhroEmoMvBzO0kTFGyoeT7PR/BfKv
-+H/g3HsL2LOB9uoIm8/5p2TTU5ttYCXMHhQZ81AY
-=AUp4
------END PGP PUBLIC KEY BLOCK-----
-"""
-
-GIT = 'git' # our git command
-MIN_GIT_VERSION = (1, 7, 2) # minimum supported git version
-repodir = '.repo' # name of repo's private directory
-S_repo = 'repo' # special repo repository
-S_manifests = 'manifests' # special manifest repository
-REPO_MAIN = S_repo + '/main.py' # main script
-MIN_PYTHON_VERSION = (2, 6) # minimum supported python version
-GITC_CONFIG_FILE = '/gitc/.config'
-GITC_FS_ROOT_DIR = '/gitc/manifest-rw/'
-
-
-import errno
-import optparse
-import re
-import shutil
-import stat
-import subprocess
-import sys
-
-if sys.version_info[0] == 3:
- import urllib.request
- import urllib.error
-else:
- import imp
- import urllib2
- urllib = imp.new_module('urllib')
- urllib.request = urllib2
- urllib.error = urllib2
-
-
-def _print(*objects, **kwargs):
- sep = kwargs.get('sep', ' ')
- end = kwargs.get('end', '\n')
- out = kwargs.get('file', sys.stdout)
- out.write(sep.join(objects) + end)
-
-
-# Python version check
-ver = sys.version_info
-if (ver[0], ver[1]) < MIN_PYTHON_VERSION:
- _print('error: Python version %s unsupported.\n'
- 'Please use Python 2.6 - 2.7 instead.'
- % sys.version.split(' ')[0], file=sys.stderr)
- sys.exit(1)
-
-home_dot_repo = os.path.expanduser('~/.repoconfig')
-gpg_dir = os.path.join(home_dot_repo, 'gnupg')
-
-extra_args = []
-init_optparse = optparse.OptionParser(usage="repo init -u url [options]")
-
-# Logging
-group = init_optparse.add_option_group('Logging options')
-group.add_option('-q', '--quiet',
- dest="quiet", action="store_true", default=False,
- help="be quiet")
-
-# Manifest
-group = init_optparse.add_option_group('Manifest options')
-group.add_option('-u', '--manifest-url',
- dest='manifest_url',
- help='manifest repository location', metavar='URL')
-group.add_option('-b', '--manifest-branch',
- dest='manifest_branch',
- help='manifest branch or revision', metavar='REVISION')
-group.add_option('-m', '--manifest-name',
- dest='manifest_name',
- help='initial manifest file', metavar='NAME.xml')
-group.add_option('--mirror',
- dest='mirror', action='store_true',
- help='create a replica of the remote repositories '
- 'rather than a client working directory')
-group.add_option('--reference',
- dest='reference',
- help='location of mirror directory', metavar='DIR')
-group.add_option('--depth', type='int', default=None,
- dest='depth',
- help='create a shallow clone with given depth; see git clone')
-group.add_option('--archive',
- dest='archive', action='store_true',
- help='checkout an archive instead of a git repository for '
- 'each project. See git archive.')
-group.add_option('-g', '--groups',
- dest='groups', default='default',
- help='restrict manifest projects to ones with specified '
- 'group(s) [default|all|G1,G2,G3|G4,-G5,-G6]',
- metavar='GROUP')
-group.add_option('-p', '--platform',
- dest='platform', default="auto",
- help='restrict manifest projects to ones with a specified '
- 'platform group [auto|all|none|linux|darwin|...]',
- metavar='PLATFORM')
-group.add_option('--no-clone-bundle',
- dest='no_clone_bundle', action='store_true',
- help='disable use of /clone.bundle on HTTP/HTTPS')
-
-
-# Tool
-group = init_optparse.add_option_group('repo Version options')
-group.add_option('--repo-url',
- dest='repo_url',
- help='repo repository location', metavar='URL')
-group.add_option('--repo-branch',
- dest='repo_branch',
- help='repo branch or revision', metavar='REVISION')
-group.add_option('--no-repo-verify',
- dest='no_repo_verify', action='store_true',
- help='do not verify repo source code')
-
-# Other
-group = init_optparse.add_option_group('Other options')
-group.add_option('--config-name',
- dest='config_name', action="store_true", default=False,
- help='Always prompt for name/e-mail')
-
-
-def _GitcInitOptions(init_optparse_arg):
- init_optparse_arg.set_usage("repo gitc-init -u url -c client [options]")
- g = init_optparse_arg.add_option_group('GITC options')
- g.add_option('-f', '--manifest-file',
- dest='manifest_file',
- help='Optional manifest file to use for this GITC client.')
- g.add_option('-c', '--gitc-client',
- dest='gitc_client',
- help='The name of the gitc_client instance to create or modify.')
-
-_gitc_manifest_dir = None
-
-
-def get_gitc_manifest_dir():
- global _gitc_manifest_dir
- if _gitc_manifest_dir is None:
- _gitc_manifest_dir = ''
- try:
- with open(GITC_CONFIG_FILE, 'r') as gitc_config:
- for line in gitc_config:
- match = re.match('gitc_dir=(?P<gitc_manifest_dir>.*)', line)
- if match:
- _gitc_manifest_dir = match.group('gitc_manifest_dir')
- except IOError:
- pass
- return _gitc_manifest_dir
-
-
-def gitc_parse_clientdir(gitc_fs_path):
- """Parse a path in the GITC FS and return its client name.
-
- @param gitc_fs_path: A subdirectory path within the GITC_FS_ROOT_DIR.
-
- @returns: The GITC client name
- """
- if gitc_fs_path == GITC_FS_ROOT_DIR:
- return None
- if not gitc_fs_path.startswith(GITC_FS_ROOT_DIR):
- manifest_dir = get_gitc_manifest_dir()
- if manifest_dir == '':
- return None
- if manifest_dir[-1] != '/':
- manifest_dir += '/'
- if gitc_fs_path == manifest_dir:
- return None
- if not gitc_fs_path.startswith(manifest_dir):
- return None
- return gitc_fs_path.split(manifest_dir)[1].split('/')[0]
- return gitc_fs_path.split(GITC_FS_ROOT_DIR)[1].split('/')[0]
-
-
-class CloneFailure(Exception):
-
- """Indicate the remote clone of repo itself failed.
- """
-
-
-def _Init(args, gitc_init=False):
- """Installs repo by cloning it over the network.
- """
- if gitc_init:
- _GitcInitOptions(init_optparse)
- opt, args = init_optparse.parse_args(args)
- if args:
- init_optparse.print_usage()
- sys.exit(1)
-
- url = opt.repo_url
- if not url:
- url = REPO_URL
- extra_args.append('--repo-url=%s' % url)
-
- branch = opt.repo_branch
- if not branch:
- branch = REPO_REV
- extra_args.append('--repo-branch=%s' % branch)
-
- if branch.startswith('refs/heads/'):
- branch = branch[len('refs/heads/'):]
- if branch.startswith('refs/'):
- _print("fatal: invalid branch name '%s'" % branch, file=sys.stderr)
- raise CloneFailure()
-
- try:
- if gitc_init:
- gitc_manifest_dir = get_gitc_manifest_dir()
- if not gitc_manifest_dir:
- _print('fatal: GITC filesystem is not available. Exiting...',
- file=sys.stderr)
- sys.exit(1)
- gitc_client = opt.gitc_client
- if not gitc_client:
- gitc_client = gitc_parse_clientdir(os.getcwd())
- if not gitc_client:
- _print('fatal: GITC client (-c) is required.', file=sys.stderr)
- sys.exit(1)
- client_dir = os.path.join(gitc_manifest_dir, gitc_client)
- if not os.path.exists(client_dir):
- os.makedirs(client_dir)
- os.chdir(client_dir)
- if os.path.exists(repodir):
- # This GITC Client has already initialized repo so continue.
- return
-
- os.mkdir(repodir)
- except OSError as e:
- if e.errno != errno.EEXIST:
- _print('fatal: cannot make %s directory: %s'
- % (repodir, e.strerror), file=sys.stderr)
- # Don't raise CloneFailure; that would delete the
- # name. Instead exit immediately.
- #
- sys.exit(1)
-
- _CheckGitVersion()
- try:
- if NeedSetupGnuPG():
- can_verify = SetupGnuPG(opt.quiet)
- else:
- can_verify = True
-
- dst = os.path.abspath(os.path.join(repodir, S_repo))
- _Clone(url, dst, opt.quiet, not opt.no_clone_bundle)
-
- if can_verify and not opt.no_repo_verify:
- rev = _Verify(dst, branch, opt.quiet)
- else:
- rev = 'refs/remotes/origin/%s^0' % branch
-
- _Checkout(dst, branch, rev, opt.quiet)
- except CloneFailure:
- if opt.quiet:
- _print('fatal: repo init failed; run without --quiet to see why',
- file=sys.stderr)
- raise
-
-
-def ParseGitVersion(ver_str):
- if not ver_str.startswith('git version '):
- return None
-
- num_ver_str = ver_str[len('git version '):].strip().split('-')[0]
- to_tuple = []
- for num_str in num_ver_str.split('.')[:3]:
- if num_str.isdigit():
- to_tuple.append(int(num_str))
- else:
- to_tuple.append(0)
- return tuple(to_tuple)
-
-
-def _CheckGitVersion():
- cmd = [GIT, '--version']
- try:
- proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- except OSError as e:
- _print(file=sys.stderr)
- _print("fatal: '%s' is not available" % GIT, file=sys.stderr)
- _print('fatal: %s' % e, file=sys.stderr)
- _print(file=sys.stderr)
- _print('Please make sure %s is installed and in your path.' % GIT,
- file=sys.stderr)
- raise CloneFailure()
-
- ver_str = proc.stdout.read().strip()
- proc.stdout.close()
- proc.wait()
-
- ver_act = ParseGitVersion(ver_str)
- if ver_act is None:
- _print('error: "%s" unsupported' % ver_str, file=sys.stderr)
- raise CloneFailure()
-
- if ver_act < MIN_GIT_VERSION:
- need = '.'.join(map(str, MIN_GIT_VERSION))
- _print('fatal: git %s or later required' % need, file=sys.stderr)
- raise CloneFailure()
-
-
-def NeedSetupGnuPG():
- if not os.path.isdir(home_dot_repo):
- return True
-
- kv = os.path.join(home_dot_repo, 'keyring-version')
- if not os.path.exists(kv):
- return True
-
- kv = open(kv).read()
- if not kv:
- return True
-
- kv = tuple(map(int, kv.split('.')))
- if kv < KEYRING_VERSION:
- return True
- return False
-
-
-def SetupGnuPG(quiet):
- try:
- os.mkdir(home_dot_repo)
- except OSError as e:
- if e.errno != errno.EEXIST:
- _print('fatal: cannot make %s directory: %s'
- % (home_dot_repo, e.strerror), file=sys.stderr)
- sys.exit(1)
-
- try:
- os.mkdir(gpg_dir, stat.S_IRWXU)
- except OSError as e:
- if e.errno != errno.EEXIST:
- _print('fatal: cannot make %s directory: %s' % (gpg_dir, e.strerror),
- file=sys.stderr)
- sys.exit(1)
-
- env = os.environ.copy()
- try:
- env['GNUPGHOME'] = gpg_dir
- except UnicodeEncodeError:
- env['GNUPGHOME'] = gpg_dir.encode()
-
- cmd = ['gpg', '--import']
- try:
- proc = subprocess.Popen(cmd,
- env=env,
- stdin=subprocess.PIPE)
- except OSError as e:
- if not quiet:
- _print('warning: gpg (GnuPG) is not available.', file=sys.stderr)
- _print('warning: Installing it is strongly encouraged.', file=sys.stderr)
- _print(file=sys.stderr)
- return False
-
- proc.stdin.write(MAINTAINER_KEYS)
- proc.stdin.close()
-
- if proc.wait() != 0:
- _print('fatal: registering repo maintainer keys failed', file=sys.stderr)
- sys.exit(1)
- _print()
-
- fd = open(os.path.join(home_dot_repo, 'keyring-version'), 'w')
- fd.write('.'.join(map(str, KEYRING_VERSION)) + '\n')
- fd.close()
- return True
-
-
-def _SetConfig(local, name, value):
- """Set a git configuration option to the specified value.
- """
- cmd = [GIT, 'config', name, value]
- if subprocess.Popen(cmd, cwd=local).wait() != 0:
- raise CloneFailure()
-
-
-def _InitHttp():
- handlers = []
-
- mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()
- try:
- import netrc
- n = netrc.netrc()
- for host in n.hosts:
- p = n.hosts[host]
- mgr.add_password(p[1], 'http://%s/' % host, p[0], p[2])
- mgr.add_password(p[1], 'https://%s/' % host, p[0], p[2])
- except: # pylint: disable=bare-except
- pass
- handlers.append(urllib.request.HTTPBasicAuthHandler(mgr))
- handlers.append(urllib.request.HTTPDigestAuthHandler(mgr))
-
- if 'http_proxy' in os.environ:
- url = os.environ['http_proxy']
- handlers.append(urllib.request.ProxyHandler({'http': url, 'https': url}))
- if 'REPO_CURL_VERBOSE' in os.environ:
- handlers.append(urllib.request.HTTPHandler(debuglevel=1))
- handlers.append(urllib.request.HTTPSHandler(debuglevel=1))
- urllib.request.install_opener(urllib.request.build_opener(*handlers))
-
-
-def _Fetch(url, local, src, quiet):
- if not quiet:
- _print('Get %s' % url, file=sys.stderr)
-
- cmd = [GIT, 'fetch']
- if quiet:
- cmd.append('--quiet')
- err = subprocess.PIPE
- else:
- err = None
- cmd.append(src)
- cmd.append('+refs/heads/*:refs/remotes/origin/*')
- cmd.append('refs/tags/*:refs/tags/*')
-
- proc = subprocess.Popen(cmd, cwd=local, stderr=err)
- if err:
- proc.stderr.read()
- proc.stderr.close()
- if proc.wait() != 0:
- raise CloneFailure()
-
-
-def _DownloadBundle(url, local, quiet):
- if not url.endswith('/'):
- url += '/'
- url += 'clone.bundle'
-
- proc = subprocess.Popen(
- [GIT, 'config', '--get-regexp', 'url.*.insteadof'],
- cwd=local,
- stdout=subprocess.PIPE)
- for line in proc.stdout:
- m = re.compile(r'^url\.(.*)\.insteadof (.*)$').match(line)
- if m:
- new_url = m.group(1)
- old_url = m.group(2)
- if url.startswith(old_url):
- url = new_url + url[len(old_url):]
- break
- proc.stdout.close()
- proc.wait()
-
- if not url.startswith('http:') and not url.startswith('https:'):
- return False
-
- dest = open(os.path.join(local, '.git', 'clone.bundle'), 'w+b')
- try:
- try:
- r = urllib.request.urlopen(url)
- except urllib.error.HTTPError as e:
- if e.code in [401, 403, 404, 501]:
- return False
- _print('fatal: Cannot get %s' % url, file=sys.stderr)
- _print('fatal: HTTP error %s' % e.code, file=sys.stderr)
- raise CloneFailure()
- except urllib.error.URLError as e:
- _print('fatal: Cannot get %s' % url, file=sys.stderr)
- _print('fatal: error %s' % e.reason, file=sys.stderr)
- raise CloneFailure()
- try:
- if not quiet:
- _print('Get %s' % url, file=sys.stderr)
- while True:
- buf = r.read(8192)
- if buf == '':
- return True
- dest.write(buf)
- finally:
- r.close()
- finally:
- dest.close()
-
-
-def _ImportBundle(local):
- path = os.path.join(local, '.git', 'clone.bundle')
- try:
- _Fetch(local, local, path, True)
- finally:
- os.remove(path)
-
-
-def _Clone(url, local, quiet, clone_bundle):
- """Clones a git repository to a new subdirectory of repodir
- """
- try:
- os.mkdir(local)
- except OSError as e:
- _print('fatal: cannot make %s directory: %s' % (local, e.strerror),
- file=sys.stderr)
- raise CloneFailure()
-
- cmd = [GIT, 'init', '--quiet']
- try:
- proc = subprocess.Popen(cmd, cwd=local)
- except OSError as e:
- _print(file=sys.stderr)
- _print("fatal: '%s' is not available" % GIT, file=sys.stderr)
- _print('fatal: %s' % e, file=sys.stderr)
- _print(file=sys.stderr)
- _print('Please make sure %s is installed and in your path.' % GIT,
- file=sys.stderr)
- raise CloneFailure()
- if proc.wait() != 0:
- _print('fatal: could not create %s' % local, file=sys.stderr)
- raise CloneFailure()
-
- _InitHttp()
- _SetConfig(local, 'remote.origin.url', url)
- _SetConfig(local,
- 'remote.origin.fetch',
- '+refs/heads/*:refs/remotes/origin/*')
- if clone_bundle and _DownloadBundle(url, local, quiet):
- _ImportBundle(local)
- _Fetch(url, local, 'origin', quiet)
-
-
-def _Verify(cwd, branch, quiet):
- """Verify the branch has been signed by a tag.
- """
- cmd = [GIT, 'describe', 'origin/%s' % branch]
- proc = subprocess.Popen(cmd,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- cwd=cwd)
- cur = proc.stdout.read().strip()
- proc.stdout.close()
-
- proc.stderr.read()
- proc.stderr.close()
-
- if proc.wait() != 0 or not cur:
- _print(file=sys.stderr)
- _print("fatal: branch '%s' has not been signed" % branch, file=sys.stderr)
- raise CloneFailure()
-
- m = re.compile(r'^(.*)-[0-9]{1,}-g[0-9a-f]{1,}$').match(cur)
- if m:
- cur = m.group(1)
- if not quiet:
- _print(file=sys.stderr)
- _print("info: Ignoring branch '%s'; using tagged release '%s'"
- % (branch, cur), file=sys.stderr)
- _print(file=sys.stderr)
-
- env = os.environ.copy()
- try:
- env['GNUPGHOME'] = gpg_dir
- except UnicodeEncodeError:
- env['GNUPGHOME'] = gpg_dir.encode()
-
- cmd = [GIT, 'tag', '-v', cur]
- proc = subprocess.Popen(cmd,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- cwd=cwd,
- env=env)
- out = proc.stdout.read()
- proc.stdout.close()
-
- err = proc.stderr.read()
- proc.stderr.close()
-
- if proc.wait() != 0:
- _print(file=sys.stderr)
- _print(out, file=sys.stderr)
- _print(err, file=sys.stderr)
- _print(file=sys.stderr)
- raise CloneFailure()
- return '%s^0' % cur
-
-
-def _Checkout(cwd, branch, rev, quiet):
- """Checkout an upstream branch into the repository and track it.
- """
- cmd = [GIT, 'update-ref', 'refs/heads/default', rev]
- if subprocess.Popen(cmd, cwd=cwd).wait() != 0:
- raise CloneFailure()
-
- _SetConfig(cwd, 'branch.default.remote', 'origin')
- _SetConfig(cwd, 'branch.default.merge', 'refs/heads/%s' % branch)
-
- cmd = [GIT, 'symbolic-ref', 'HEAD', 'refs/heads/default']
- if subprocess.Popen(cmd, cwd=cwd).wait() != 0:
- raise CloneFailure()
-
- cmd = [GIT, 'read-tree', '--reset', '-u']
- if not quiet:
- cmd.append('-v')
- cmd.append('HEAD')
- if subprocess.Popen(cmd, cwd=cwd).wait() != 0:
- raise CloneFailure()
-
-
-def _FindRepo():
- """Look for a repo installation, starting at the current directory.
- """
- curdir = os.getcwd()
- repo = None
-
- olddir = None
- while curdir != '/' \
- and curdir != olddir \
- and not repo:
- repo = os.path.join(curdir, repodir, REPO_MAIN)
- if not os.path.isfile(repo):
- repo = None
- olddir = curdir
- curdir = os.path.dirname(curdir)
- return (repo, os.path.join(curdir, repodir))
-
-
-class _Options(object):
- help = False
-
-
-def _ParseArguments(args):
- cmd = None
- opt = _Options()
- arg = []
-
- for i in range(len(args)):
- a = args[i]
- if a == '-h' or a == '--help':
- opt.help = True
-
- elif not a.startswith('-'):
- cmd = a
- arg = args[i + 1:]
- break
- return cmd, opt, arg
-
-
-def _Usage():
- gitc_usage = ""
- if get_gitc_manifest_dir():
- gitc_usage = " gitc-init Initialize a GITC Client.\n"
-
- _print(
- """usage: repo COMMAND [ARGS]
-
-repo is not yet installed. Use "repo init" to install it here.
-
-The most commonly used repo commands are:
-
- init Install repo in the current working directory
-""" + gitc_usage +
- """ help Display detailed help on a command
-
-For access to the full online help, install repo ("repo init").
-""", file=sys.stderr)
- sys.exit(1)
-
-
-def _Help(args):
- if args:
- if args[0] == 'init':
- init_optparse.print_help()
- sys.exit(0)
- elif args[0] == 'gitc-init':
- _GitcInitOptions(init_optparse)
- init_optparse.print_help()
- sys.exit(0)
- else:
- _print("error: '%s' is not a bootstrap command.\n"
- ' For access to online help, install repo ("repo init").'
- % args[0], file=sys.stderr)
- else:
- _Usage()
- sys.exit(1)
-
-
-def _NotInstalled():
- _print('error: repo is not installed. Use "repo init" to install it here.',
- file=sys.stderr)
- sys.exit(1)
-
-
-def _NoCommands(cmd):
- _print("""error: command '%s' requires repo to be installed first.
- Use "repo init" to install it here.""" % cmd, file=sys.stderr)
- sys.exit(1)
-
-
-def _RunSelf(wrapper_path):
- my_dir = os.path.dirname(wrapper_path)
- my_main = os.path.join(my_dir, 'main.py')
- my_git = os.path.join(my_dir, '.git')
-
- if os.path.isfile(my_main) and os.path.isdir(my_git):
- for name in ['git_config.py',
- 'project.py',
- 'subcmds']:
- if not os.path.exists(os.path.join(my_dir, name)):
- return None, None
- return my_main, my_git
- return None, None
-
-
-def _SetDefaultsTo(gitdir):
- global REPO_URL
- global REPO_REV
-
- REPO_URL = gitdir
- proc = subprocess.Popen([GIT,
- '--git-dir=%s' % gitdir,
- 'symbolic-ref',
- 'HEAD'],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- REPO_REV = proc.stdout.read().strip()
- proc.stdout.close()
-
- proc.stderr.read()
- proc.stderr.close()
-
- if proc.wait() != 0:
- _print('fatal: %s has no current branch' % gitdir, file=sys.stderr)
- sys.exit(1)
-
-
-def main(orig_args):
- cmd, opt, args = _ParseArguments(orig_args)
-
- repo_main, rel_repo_dir = None, None
- # Don't use the local repo copy, make sure to switch to the gitc client first.
- if cmd != 'gitc-init':
- repo_main, rel_repo_dir = _FindRepo()
-
- wrapper_path = os.path.abspath(__file__)
- my_main, my_git = _RunSelf(wrapper_path)
-
- cwd = os.getcwd()
- if get_gitc_manifest_dir() and cwd.startswith(get_gitc_manifest_dir()):
- _print('error: repo cannot be used in the GITC local manifest directory.'
- '\nIf you want to work on this GITC client please rerun this '
- 'command from the corresponding client under /gitc/',
- file=sys.stderr)
- sys.exit(1)
- if not repo_main:
- if opt.help:
- _Usage()
- if cmd == 'help':
- _Help(args)
- if not cmd:
- _NotInstalled()
- if cmd == 'init' or cmd == 'gitc-init':
- if my_git:
- _SetDefaultsTo(my_git)
- try:
- _Init(args, gitc_init=(cmd == 'gitc-init'))
- except CloneFailure:
- shutil.rmtree(os.path.join(repodir, S_repo), ignore_errors=True)
- sys.exit(1)
- repo_main, rel_repo_dir = _FindRepo()
- else:
- _NoCommands(cmd)
-
- if my_main:
- repo_main = my_main
-
- ver_str = '.'.join(map(str, VERSION))
- me = [sys.executable, repo_main,
- '--repo-dir=%s' % rel_repo_dir,
- '--wrapper-version=%s' % ver_str,
- '--wrapper-path=%s' % wrapper_path,
- '--']
- me.extend(orig_args)
- me.extend(extra_args)
- try:
- os.execv(sys.executable, me)
- except OSError as e:
- _print("fatal: unable to start %s" % repo_main, file=sys.stderr)
- _print("fatal: %s" % e, file=sys.stderr)
- sys.exit(148)
-
-
-if __name__ == '__main__':
- if ver[0] == 3:
- _print('warning: Python 3 support is currently experimental. YMMV.\n'
- 'Please use Python 2.6 - 2.7 instead.',
- file=sys.stderr)
- main(sys.argv[1:])
diff --git a/ansible/roles/buildtools/tasks/main.yml b/ansible/roles/buildtools/tasks/main.yml
deleted file mode 100644
index 8a22f32..0000000
--- a/ansible/roles/buildtools/tasks/main.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Apt Repo
- apt_repository:
- repo: ppa:git-core/ppa
- state: present
- update_cache: yes
- register: result
- until: result | success
- retries: 3
- delay: 10
-
-- name: Apt packages
- apt:
- name: "{{ item }}"
- with_items: "{{ apt_packages }}"
- tags: [buildtools]
-
-- name: Ensure Repo
- copy:
- src: repo.bin
- dest: /usr/local/bin/repo
- owner: root
- group: root
- mode: 0755
-
diff --git a/ansible/roles/common/defaults/main.yml b/ansible/roles/common/defaults/main.yml
deleted file mode 100644
index f1487c3..0000000
--- a/ansible/roles/common/defaults/main.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
-hosts: [
- { host_ip: "10.100.198.200", host_name: "corddev"},
- { host_ip: "10.100.198.201", host_name: "prod"},
-]
-
-use_latest_for:
- - debian-keyring
- - debian-archive-keyring
- - rng-tools
- - python-netaddr
-
-obsolete_services:
- - puppet
- - chef-client
diff --git a/ansible/roles/common/files/ssh_config b/ansible/roles/common/files/ssh_config
deleted file mode 100644
index 990a43d..0000000
--- a/ansible/roles/common/files/ssh_config
+++ /dev/null
@@ -1,3 +0,0 @@
-Host *
- StrictHostKeyChecking no
- UserKnownHostsFile=/dev/null
diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml
deleted file mode 100644
index b17790a..0000000
--- a/ansible/roles/common/tasks/main.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: JQ is present
- apt:
- name: jq
- force: yes
- tags: [common]
-
-- name: Host is present
- lineinfile:
- dest: /etc/hosts
- regexp: "^{{ item.host_ip }}"
- line: "{{ item.host_ip }} {{ item.host_name }}"
- with_items: "{{ hosts }}"
- tags: [common]
-
-- name: Latest apt packages
- apt:
- name: "{{ item }}"
- with_items: "{{ use_latest_for }}"
- tags: [common]
-
-- name: Services are not running
- service:
- name: "{{ item }}"
- state: stopped
- ignore_errors: yes
- with_items: "{{ obsolete_services }}"
- tags: [common]
-
-- name: Ensure known_hosts file is absent
- file:
- path: "/home/vagrant/.ssh/known_hosts"
- state: absent
-
-- name: Create .ssh directory
- file: path={{ ansible_env['PWD'] }}/.ssh state=directory mode=0755
-
-- name: Disable Known Host Checking
- copy:
- src: files/ssh_config
- dest: "/home/vagrant/.ssh/config"
- owner: "{{ ansible_env['SUDO_USER'] }}"
- group: "{{ ansible_env['SUDO_USER'] }}"
- mode: 0600
diff --git a/ansible/roles/consul-template/files/consul-template b/ansible/roles/consul-template/files/consul-template
deleted file mode 100755
index 46262c6..0000000
--- a/ansible/roles/consul-template/files/consul-template
+++ /dev/null
Binary files differ
diff --git a/ansible/roles/consul-template/files/example.conf.tmpl b/ansible/roles/consul-template/files/example.conf.tmpl
deleted file mode 100644
index fbedd1d..0000000
--- a/ansible/roles/consul-template/files/example.conf.tmpl
+++ /dev/null
@@ -1 +0,0 @@
-The address is {{getv "/nginx/nginx"}}
diff --git a/ansible/roles/consul-template/files/example.ctmpl b/ansible/roles/consul-template/files/example.ctmpl
deleted file mode 100644
index 32a9675..0000000
--- a/ansible/roles/consul-template/files/example.ctmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-{{/*
-Copyright 2017-present Open Networking Foundation
-
-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.
-*/}}
-
-{{range service "nginx"}}
-The address is {{.Address}}:{{.Port}}
-{{end}}
diff --git a/ansible/roles/consul-template/files/example.toml b/ansible/roles/consul-template/files/example.toml
deleted file mode 100644
index e142c44..0000000
--- a/ansible/roles/consul-template/files/example.toml
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-[template]
-src = "example.conf.tmpl"
-dest = "/tmp/example.conf"
-keys = [
- "/nginx/nginx"
-]
\ No newline at end of file
diff --git a/ansible/roles/consul-template/tasks/main.yml b/ansible/roles/consul-template/tasks/main.yml
deleted file mode 100644
index c5c349d..0000000
--- a/ansible/roles/consul-template/tasks/main.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Directory is created
- file:
- path: /data/consul-template
- state: directory
- tags: [consul-template]
-
-- name: File is copied
- copy:
- src: consul-template
- dest: /usr/local/bin/consul-template
- mode: 0755
- tags: [consul-template]
-
-- name: Example template is copied
- copy:
- src: example.ctmpl
- dest: /data/consul-template/example.ctmpl
- mode: 0644
- tags: [consul-template]
diff --git a/ansible/roles/fakeswitch-mgmt-net/files/eth1.cfg b/ansible/roles/fakeswitch-mgmt-net/files/eth1.cfg
deleted file mode 100644
index dc7756f..0000000
--- a/ansible/roles/fakeswitch-mgmt-net/files/eth1.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-# The primary network interface
-auto eth1
-iface eth1 inet dhcp
\ No newline at end of file
diff --git a/ansible/roles/fakeswitch-mgmt-net/handlers/main.yml b/ansible/roles/fakeswitch-mgmt-net/handlers/main.yml
deleted file mode 100644
index 4f2ba96..0000000
--- a/ansible/roles/fakeswitch-mgmt-net/handlers/main.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Bring up eth1
- command: ifup eth1
diff --git a/ansible/roles/fakeswitch-mgmt-net/tasks/main.yml b/ansible/roles/fakeswitch-mgmt-net/tasks/main.yml
deleted file mode 100644
index ccb6f4f..0000000
--- a/ansible/roles/fakeswitch-mgmt-net/tasks/main.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Ensure DHCP on eth1
- copy:
- src: files/eth1.cfg
- dest: /etc/network/interfaces.d/eth1.cfg
- notify:
- - Bring up eth1
diff --git a/ansible/roles/fakeswitch/files/persist b/ansible/roles/fakeswitch/files/persist
deleted file mode 100755
index d032e90..0000000
--- a/ansible/roles/fakeswitch/files/persist
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-echo "persist"
-exit 0
diff --git a/ansible/roles/fakeswitch/files/savepersist b/ansible/roles/fakeswitch/files/savepersist
deleted file mode 100755
index 50d503b..0000000
--- a/ansible/roles/fakeswitch/files/savepersist
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-echo "savepersist"
-exit 0
diff --git a/ansible/roles/fakeswitch/tasks/main.yml b/ansible/roles/fakeswitch/tasks/main.yml
deleted file mode 100644
index 6b7db94..0000000
--- a/ansible/roles/fakeswitch/tasks/main.yml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Ensure Root User
- become: yes
- user:
- name: root
- password: '$6$o5YKQzd9CIadXU$KPaV6CcDd1XPr4cO.dRnWnMnrZl9mBEM84Pfhp9b1v6fLWHdoQ1gPJ4qa0lGvxpukcWtWtwiZezi3JWisMd4D.'
-
-- name: Ensure Directories
- become: yes
- file:
- path: "{{ item }}"
- owner: root
- group: root
- mode: 0755
- state: directory
- with_items:
- - /mnt/flash2
- - /etc/accton
-
-- name: Ensure Commands
- become: yes
- copy:
- src: files/{{ item }}
- dest: /usr/bin/{{ item }}
- owner: root
- group: root
- mode: 0755
- with_items:
- - persist
- - savepersist
-
-- name: Ensure Root SSH
- become: yes
- lineinfile:
- dest: "/etc/ssh/sshd_config"
- regexp: "^PermitRootLogin"
- line: "PermitRootLogin yes"
-
-- name: Ensure SSH Config
- become: yes
- service:
- name: ssh
- state: restarted
- #failed_when: false
-
-- name: Ensure /mnt/onl/data directory present
- become: yes
- file:
- path: /mnt/onl/data
- owner: root
- group: root
- state: directory
diff --git a/ansible/roles/java/tasks/main.yml b/ansible/roles/java/tasks/main.yml
deleted file mode 100644
index c06ee5d..0000000
--- a/ansible/roles/java/tasks/main.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Package is present
- apt:
- name=openjdk-7-jdk
- state=present
- tags: [java]
diff --git a/ansible/roles/java8-oracle/tasks/main.yml b/ansible/roles/java8-oracle/tasks/main.yml
deleted file mode 100644
index 090d6a9..0000000
--- a/ansible/roles/java8-oracle/tasks/main.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
----
-- name: Install add-apt-repository
- become: yes
- apt:
- name: software-properties-common
- state: latest
- tags:
- - skip_ansible_lint
-
-- name: Add Oracle Java repository
- become: yes
- apt_repository:
- repo: 'ppa:webupd8team/java'
- register: result
- until: result | success
- retries: 3
- delay: 10
-
-- name: Accept Java 8 license
- become: yes
- debconf: name='oracle-java8-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
-
-- name: Install Oracle Java 8
- become: yes
- apt:
- name: "{{item}}"
- state: latest
- with_items:
- - oracle-java8-installer
- - ca-certificates
- - oracle-java8-set-default
- tags:
- - skip_ansible_lint
diff --git a/ansible/roles/leafswitch/tasks/bridge.yml b/ansible/roles/leafswitch/tasks/bridge.yml
deleted file mode 100644
index c44518a..0000000
--- a/ansible/roles/leafswitch/tasks/bridge.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Ensure brctl
- apt:
- name: bridge-utils
- state: present
-
-- name: Ensure bridge
- template:
- src: templates/leafbr.cfg.j2
- dest: /etc/network/interfaces.d/leafbr.cfg
-
-- name: Ensure bridge is up
- command: ifup leafbr
- tags:
- - skip_ansible_lint # running a sub job
diff --git a/ansible/roles/leafswitch/tasks/fabric.yml b/ansible/roles/leafswitch/tasks/fabric.yml
deleted file mode 100644
index f440f98..0000000
--- a/ansible/roles/leafswitch/tasks/fabric.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Start ofdatapath
- shell: pgrep ofdatapath || ofdatapath -i eth2,eth3,eth4,eth5 -d {{ ansible_eth1.macaddress | hwaddr('bare') }} --no-slicing -D punix:/var/run/cpqd.sock
- tags:
- - skip_ansible_lint # running a sub job
-
-# /etc/resolv.conf not set up correctly in switches, use controller IP addr instead
-- name: Start ofprotocol
- shell: pgrep ofprotocol || ofprotocol -D --log-file=/var/log/ofprotocol.log unix:/var/run/cpqd.sock tcp:10.1.0.1:6653
- tags:
- - skip_ansible_lint # running a sub job
\ No newline at end of file
diff --git a/ansible/roles/leafswitch/tasks/main.yml b/ansible/roles/leafswitch/tasks/main.yml
deleted file mode 100644
index 15925d6..0000000
--- a/ansible/roles/leafswitch/tasks/main.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Ensure interface config files
- template:
- src: templates/ethX.cfg.j2
- dest: /etc/network/interfaces.d/{{ item }}.cfg
- with_items:
- - eth2
- - eth3
- - eth4
- - eth5
-
-- name: Ensure interfaces are up
- command: ifup {{ item }}
- with_items:
- - eth2
- - eth3
- - eth4
- - eth5
- tags:
- - skip_ansible_lint # running a sub job
-
-- name: Ensure fabric configuration
- include: fabric.yml
- when: fabric
-
-- name: Ensure bridge configuration
- include: bridge.yml
- when: not fabric
-
diff --git a/ansible/roles/leafswitch/templates/ethX.cfg.j2 b/ansible/roles/leafswitch/templates/ethX.cfg.j2
deleted file mode 100644
index ae2edbd..0000000
--- a/ansible/roles/leafswitch/templates/ethX.cfg.j2
+++ /dev/null
@@ -1,21 +0,0 @@
-
-{#
-Copyright 2017-present Open Networking Foundation
-
-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.
-#}
-
-
-auto {{ item }}
-iface {{ item }} inet manual
-up ifconfig {{ item }} up
\ No newline at end of file
diff --git a/ansible/roles/leafswitch/templates/leafbr.cfg.j2 b/ansible/roles/leafswitch/templates/leafbr.cfg.j2
deleted file mode 100644
index 8c3c6e4..0000000
--- a/ansible/roles/leafswitch/templates/leafbr.cfg.j2
+++ /dev/null
@@ -1,25 +0,0 @@
-
-{#
-Copyright 2017-present Open Networking Foundation
-
-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.
-#}
-
-
-auto leafbr
-iface leafbr inet static
- address {{ net_prefix }}.254
- network {{ net_prefix }}.0
- netmask 255.255.255.0
- broadcast {{ net_prefix }}.255
- bridge_ports eth2 eth3 eth4 eth5
diff --git a/ansible/roles/ovs-deb-packages/defaults/main.yml b/ansible/roles/ovs-deb-packages/defaults/main.yml
deleted file mode 100644
index 5a7aafc..0000000
--- a/ansible/roles/ovs-deb-packages/defaults/main.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-ovs_version: 2.5.3
\ No newline at end of file
diff --git a/ansible/roles/ovs-deb-packages/tasks/main.yml b/ansible/roles/ovs-deb-packages/tasks/main.yml
deleted file mode 100644
index 464ed9b..0000000
--- a/ansible/roles/ovs-deb-packages/tasks/main.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-- name: Install prereqs for building OVS
- apt:
- name: "{{ item }}"
- state: present
- update_cache: yes
- become: yes
- with_items:
- - build-essential
- - fakeroot
- - graphviz
- - autoconf
- - automake
- - bzip2
- - debhelper
- - dh-autoreconf
- - libssl-dev
- - libtool
- - openssl
- - procps
- - python-all
- - python-qt4
- - python-twisted-conch
- - python-zopeinterface
-
-- name: Download and unarchive OVS tarball
- unarchive:
- src: http://openvswitch.org/releases/openvswitch-{{ ovs_version }}.tar.gz
- dest: /tmp/
- remote_src: yes
-
-- name: Build OVS .deb packages
- command: fakeroot debian/rules binary
- args:
- chdir: /tmp/openvswitch-{{ ovs_version }}
- creates: /tmp/openvswitch-switch_{{ ovs_version }}-1_amd64.deb
diff --git a/ansible/roles/spineswitch/tasks/bridge.yml b/ansible/roles/spineswitch/tasks/bridge.yml
deleted file mode 100644
index 72a5498..0000000
--- a/ansible/roles/spineswitch/tasks/bridge.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Ensure brctl
- apt:
- name: bridge-utils
- state: present
-
-- name: Ensure bridge
- template:
- src: templates/spinebr.cfg.j2
- dest: /etc/network/interfaces.d/spinebr.cfg
-
-- name: Ensure bridge is up
- command: ifup spinebr
- tags:
- - skip_ansible_lint # running a sub job
diff --git a/ansible/roles/spineswitch/tasks/fabric.yml b/ansible/roles/spineswitch/tasks/fabric.yml
deleted file mode 100644
index 3890f12..0000000
--- a/ansible/roles/spineswitch/tasks/fabric.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Start ofdatapath
- command: pgrep ofdatapath || ofdatapath -i eth2,eth3 -d {{ ansible_eth1.macaddress | hwaddr('bare') }} --no-slicing -D punix:/var/run/cpqd.sock
- tags:
- - skip_ansible_lint # running a sub job
-
-# /etc/resolv.conf not set up correctly in switches, use controller IP addr instead
-- name: Start ofprotocol
- command: pgrep ofprotocol || ofprotocol -D --log-file=/var/log/ofprotocol.log unix:/var/run/cpqd.sock tcp:10.1.0.1:6653
- tags:
- - skip_ansible_lint # running a sub job
diff --git a/ansible/roles/spineswitch/tasks/main.yml b/ansible/roles/spineswitch/tasks/main.yml
deleted file mode 100644
index 3fb10d6..0000000
--- a/ansible/roles/spineswitch/tasks/main.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Ensure interface config files
- template:
- src: templates/ethX.cfg.j2
- dest: /etc/network/interfaces.d/{{ item }}.cfg
- with_items:
- - eth2
- - eth3
-
-- name: Ensure interfaces are up
- command: ifup {{ item }}
- with_items:
- - eth2
- - eth3
- tags:
- - skip_ansible_lint # running a sub job
-
-- name: Ensure fabric configuration
- include: fabric.yml
- when: fabric
-
-- name: Ensure bridge configuration
- include: bridge.yml
- when: not fabric
-
diff --git a/ansible/roles/spineswitch/templates/ethX.cfg.j2 b/ansible/roles/spineswitch/templates/ethX.cfg.j2
deleted file mode 100644
index ae2edbd..0000000
--- a/ansible/roles/spineswitch/templates/ethX.cfg.j2
+++ /dev/null
@@ -1,21 +0,0 @@
-
-{#
-Copyright 2017-present Open Networking Foundation
-
-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.
-#}
-
-
-auto {{ item }}
-iface {{ item }} inet manual
-up ifconfig {{ item }} up
\ No newline at end of file
diff --git a/ansible/roles/spineswitch/templates/spinebr.cfg.j2 b/ansible/roles/spineswitch/templates/spinebr.cfg.j2
deleted file mode 100644
index 0ced866..0000000
--- a/ansible/roles/spineswitch/templates/spinebr.cfg.j2
+++ /dev/null
@@ -1,25 +0,0 @@
-
-{#
-Copyright 2017-present Open Networking Foundation
-
-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.
-#}
-
-
-auto spinebr
-iface spinebr inet static
- address {{ net_prefix }}.253
- network {{ net_prefix }}.0
- netmask 255.255.255.0
- broadcast {{ net_prefix }}.255
- bridge_ports eth2 eth3
diff --git a/ansible/roles/virt-nets/defaults/main.yml b/ansible/roles/virt-nets/defaults/main.yml
deleted file mode 100644
index 7112867..0000000
--- a/ansible/roles/virt-nets/defaults/main.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
----
-# virt-nets/defaults/main.yml
-
-virt_nets: []
-
diff --git a/ansible/roles/virt-nets/tasks/main.yml b/ansible/roles/virt-nets/tasks/main.yml
deleted file mode 100644
index ef238b4..0000000
--- a/ansible/roles/virt-nets/tasks/main.yml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
----
-# virt-nets/tasks/main.yml
-
-- name: Install libvirt/lxml python module
- apt:
- name: "{{ item }}"
- update_cache: yes
- cache_valid_time: 3600
- with_items:
- - python-libvirt
- - python-lxml
-
-- name: collect libvirt network facts
- virt_net:
- command: facts
-
-- name: Tear down libvirt's default network
- when: ansible_libvirt_networks["default"] is defined
- virt_net:
- command: "{{ item }}"
- name: "default"
- with_items:
- - destroy
- - undefine
-
-# note, this isn't idempotent, so may need manual fixing if it changes
-- name: Define libvirt networks settings (IP/DHCP/DNS)
- when: "{{ ansible_libvirt_networks[item.name] is not defined }}"
- virt_net:
- name: "{{ item.name }}"
- command: define
- xml: "{{ lookup('template', 'virt_net.xml.j2') }}"
- with_items: "{{ virt_nets }}"
-
-- name: Collect libvirt network facts after defining new network
- virt_net:
- command: facts
-
-- name: Start libvirt networks
- when: "{{ ansible_libvirt_networks[item.name].state != 'active' }}"
- virt_net:
- name: "{{ item.name }}"
- command: create
- autostart: yes
- with_items: "{{ virt_nets }}"
-
-- name: Have libvirt networks automatically start on reboot
- when: "{{ ansible_libvirt_networks[item.name].autostart != 'yes' }}"
- virt_net:
- name: "{{ item.name }}"
- autostart: yes
- with_items: "{{ virt_nets }}"
-
diff --git a/ansible/roles/virt-nets/templates/virt_net.xml.j2 b/ansible/roles/virt-nets/templates/virt_net.xml.j2
deleted file mode 100644
index 8fa621b..0000000
--- a/ansible/roles/virt-nets/templates/virt_net.xml.j2
+++ /dev/null
@@ -1,31 +0,0 @@
-
-{#
-Copyright 2017-present Open Networking Foundation
-
-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.
-#}
-
-
-<network>
- <name>{{ item.name }}</name>
- <bridge name="br-{{ item.name }}"/>
- <forward/>
- <ip address="{{ item.ipv4_prefix }}.1" netmask="255.255.255.0">
- <dhcp>
- <range start="{{ item.ipv4_prefix }}.2" end="{{ item.ipv4_prefix }}.254"/>
-{% for node in item.nodes %}
- <host name='{{ node.name }}' ip='{{ item.ipv4_prefix }}.{{ node.ipv4_last_octet }}'/>
-{% endfor %}
- </dhcp>
- </ip>
-</network>
diff --git a/ansible/roles/vlan-stag-ctag/defaults/main.yml b/ansible/roles/vlan-stag-ctag/defaults/main.yml
deleted file mode 100644
index 78e5803..0000000
--- a/ansible/roles/vlan-stag-ctag/defaults/main.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
-olt_if: eth1
-s_tag: 222
-c_tag: 111
diff --git a/ansible/roles/vlan-stag-ctag/handlers/main.yml b/ansible/roles/vlan-stag-ctag/handlers/main.yml
deleted file mode 100644
index d3ec3c4..0000000
--- a/ansible/roles/vlan-stag-ctag/handlers/main.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Reboot node
- command: shutdown -r now
diff --git a/ansible/roles/vlan-stag-ctag/tasks/main.yml b/ansible/roles/vlan-stag-ctag/tasks/main.yml
deleted file mode 100644
index 381c46f..0000000
--- a/ansible/roles/vlan-stag-ctag/tasks/main.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-- name: Set up /etc/rc.local (creates VLAN interfaces)
- template:
- src: templates/rc.local.j2
- dest: /etc/rc.local
- mode: 0755
- owner: root
- notify:
- - Reboot node
diff --git a/ansible/roles/vlan-stag-ctag/templates/rc.local.j2 b/ansible/roles/vlan-stag-ctag/templates/rc.local.j2
deleted file mode 100644
index b23cc95..0000000
--- a/ansible/roles/vlan-stag-ctag/templates/rc.local.j2
+++ /dev/null
@@ -1,31 +0,0 @@
-
-{#
-Copyright 2017-present Open Networking Foundation
-
-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.
-#}
-
-
-#!/bin/sh -e
-
-# Set up VLAN tagging interface ("simulated OLT")
-ip link add link {{ olt_if }} name {{ olt_if }}.{{ s_tag }} type vlan id {{ s_tag }}
-ip link add link {{ olt_if }}.{{ s_tag }} name {{ olt_if }}.{{ s_tag }}.{{ c_tag }} type vlan id {{ c_tag }}
-ifconfig {{ olt_if }} up
-ifconfig {{ olt_if }}.{{ s_tag }} up
-ifconfig {{ olt_if }}.{{ s_tag }}.{{ c_tag }} up
-
-# Get IP address from vSG
-dhclient {{ olt_if }}.{{ s_tag }}.{{ c_tag }}
-
-exit 0
diff --git a/ansible/spineswitch.yml b/ansible/spineswitch.yml
deleted file mode 100644
index 5a82dfc..0000000
--- a/ansible/spineswitch.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
-- hosts: localhost
- remote_user: vagrant
- serial: 1
- roles:
- - common
- - fakeswitch
- - fakeswitch-mgmt-net
- - spineswitch
diff --git a/ansible/testclient.yml b/ansible/testclient.yml
deleted file mode 100644
index 5a50069..0000000
--- a/ansible/testclient.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-
-- hosts: localhost
- remote_user: vagrant
- serial: 1
- roles:
- - vlan-stag-ctag
diff --git a/docs/objectives.md b/docs/objectives.md
deleted file mode 100644
index 389e76c..0000000
--- a/docs/objectives.md
+++ /dev/null
@@ -1,151 +0,0 @@
-# CORD Repo Requirements and Design
-
-## Two Main Objectives
-
-**Trying CORD Must be a Pleasant Experience**
-
-1. Very pleasant first impression for shrink-wrapped "copy-paste" trial
- * 5-10 simple commands
- * 1-2 verified prerequisites
- * <60 minutes)
-1. One/two relevant baked-in use-case(s)
-1. A few supported target environments to chose from (see below)
-
-**Extending, customizing CORD should be well supported**
-
-1. Straightforward to customize and extend
-1. Customizations, extensions can be implemented in their own repo(s) to allow their own SCM by user, independent of CORD CI/CD repos
-1. Tutorials on-line (as well as embedded in the top-level repo) provides step-by-step guidance
-
-## Definitions
-
-[illustration to be added to further explain these:]
-
-* Dev host
-* Dev env (may be a VM on the dev host)
-* Target (deployment) environments
-* Upstream artifacts
-* Upstream artifact repo(s)
-* Result/staged artifact repo
-* Replicated local repo
-* Build phase/process
-* Deployment phase/process
- * Seed stage
- * Push stage
- * Local (pull) stage
-* Use-case phase
-* Clean-up processes
-
-
-## Detailed Short-Term Requirements
-
-These requirements are to support the intended experience outlined above:
-
-* Supported environments for dev host:
- * Mac OS X
- * Linux
- * [Possibly Windows - lower prio, but it may be feasible due to the vagrant/external deployment models]
-* Supported target (deployment) configurations [lets narrow this down for 1st release]:
- * all-in-one on local VM (Vagrant)
- * all-in-one IP-accessible bare-metal server (with Ubuntu 14.04LTS pre-installed)
- * all-in-one AWS node, pre-instantiated with Ubuntu 14.04LTS
- * all-in-one AWS node, automated pre-instantiation (needs AWS credentials, default region, but can be overridden, pem file, etc.)
- * few-server, server-only, distributed deployment, local physical servers with given IP
- * few-server, AWS, remote-deployed with auto-created nodes
- * real-pod - config 1
- * real-pod - config 2
- * real-pod - config 3
-* Trial mode should have minimalistic prerequisites on the development host:
- * git - to clone the top-level repo
- * vagrant - to bring up the development environment, and also as deployment target
-* Trial mode should allow host to be cleaned up (no trace left if user decides to wipe)
-* Example steps to achieve above goal
- * Step 1: git clone <opencord repo>
- * Step 2: cd <repo>
- * Step 3: vagrant up cord-devenv # may take a few minutes for the 1st time
- * Step 4: vagrant ssh cord-devenv
- * Step 5: cd \<repo>
- * Step 6: \<config target>
- * Step 7: \<deploy to target> # may take a few times ten minutes for the 1st time
-* In addition to vagrant-based Linux dev env, MAC OS X shall be supported as native dev env too (albeit with more setup effort, which shall be well documented too)
-* Consistent, clean, informative console feedback as the deployment progresses
-* All assumption are verified (prerequisites, version numbers, etc.)
-* Informative, helpful, consistent error messages that help to diagnose the problem and to make progress
-* Allow continuation of deployment process in case of error disrupted previous run (should not need to wipe everything)
- * Idempotent steps as much as possible
-* Easy full re-deployment after changes made in local devenv shall be supported (and be fast)
-* Embedded documentation, but also available on-line
-* All upstream artifacts shall be version-controlled, traceable and verifiable (md5, sha1 or sha256)
- * Upstream includes:
- * Vagrant box
- * Docker images
- * git source repos
- * [git binary artifacts]
- * Maven repos
- * Python/pip repos
- * Debian repos
-* Upstream references shall be configurable
-* We shall support the creation and the use of controlled local artifact repositories which can contain all upstream dependencies
- * To support isolated lab environments
- * To allow cascading, connected (recursive) CI/CD pipelines
- * Best would be to consolidate all these formats into one packaging and deployment format: docker image/container
-* When/if upstream points to an intranet repo, deployment process must not require Internet access (only access to the local artifact repo)
-* Rely on DevOps 2.0 latest/best practices:
- * Not to reinvent the wheel
- * Allow people to be self-sufficient (using their modern skills)
- * Will make our job easier: no need to explain; we can point to contemporary docs
-* Number of git repos involved in CORD deployment should be "healthy"
- * One top-level CI/CD repo to allow above experience
- * It may check out a few additional sub-repos automatically
- * Sub-repos should be used for truly self-contained projects:
- * Where loose coupling with other projects is really desirable
- * When there repo lines up naturally with team ownership
- * When project is useful without the rest of the CORD ensemble
-* Three domains of configuration:
- * Source of upstream prerequisites
- * Target deployment environment
- * Deployed use-case
-* Multi-server (N server) deployment should not require to copy all artifacts remotely N time, but rather a one-time push/pull of such artifacts to a local repo, and additional servers shall pull from the local repo.
-* Well-supported and well-documented manual steps for the following work-flows:
- * Dev host: Verify pre-requisites on dev host
- * Dev host or dev env: Pull down or update local top-level repo
- * Dev host: Build development env
- * Dev host: start/stop dev env (once it is built)
- * Dev env: Pull down all prerequisites
- * Dev env: Update prerequisites after updating top-level repo (or modifying upstream configs)
- * Dev env: Build all target artifacts (whatever needs building)
- * Dev env: Run pre-deployment tests (if any)
- * Dev env: Select server and start it if needed (docker image with docker registry)
- * Dev env: Push all target artifacts to target artifact repo (with optional tag)
- * Dev env: Select / configure target (manual config of target descriptor files)
- * Dev env: Verify target readiness
- * Dev env: Deploy to select target (from optional tag)
- * Target: Execute select post-deploy test suite(s) on select target
- * Dev env or target: Destroy/wipe target (as applicable)
-
-
-## Detailed Longer-term Requirements
-
-* Supported evaluation use-cases shall include:
- * Testing HA scenarios
- * Testing scale-out and scale-in scenarios
- * Testing upgrade process scenarios
- * Numerical tests (performance tests)
- * [Posting tests to test report server]
-* The CI/CD environment shall be embedded into the CORD repo
-* The CI/CD environment shall support easy setup of:
- * Multiple deployment stations (for various types of tests, such as post-commit regression tests, daily smoke- and performance tests)
- * Local or remote git repo for SCM
- * Self-contained jenkins profile(s) for automating CI/CD pipeline (useful/meaningful as is, but customizable by user)
-
-
-# Design
-
-[to be flashed out once we ratify the requirements]
-
-
-## Open Issues
-
-* On AWS we need a container-only use-case (absolutely no VMs) - is that feasible?
-* Same is needed in a Vagrant-based local simulated env - is that feasible?
-* Role of local Orchestrator in deployment and management of the basic infrastructure - we believe that this shall be minimized to avoid self-management loop. Specifically, local Orchestrator shall not manage what it depends on for its own functionality
diff --git a/scripts/bootstrap_ansible.sh b/scripts/bootstrap_ansible.sh
deleted file mode 100755
index 860c53b..0000000
--- a/scripts/bootstrap_ansible.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env bash
-#
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-set -e
-
-echo "Installing Ansible using apt..."
-apt-get install -y software-properties-common ca-certificates
-apt-add-repository ppa:ansible/ansible
-apt-get update
-apt-get install -y ansible
-mkdir -p /etc/ansible
-
diff --git a/scripts/cord-in-a-box.sh b/scripts/cord-in-a-box.sh
deleted file mode 100755
index f76510e..0000000
--- a/scripts/cord-in-a-box.sh
+++ /dev/null
@@ -1,424 +0,0 @@
-#!/usr/bin/env bash
-#
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-# cord-in-a-box.sh
-
-set -e -x
-
-# start time, used to name logfiles
-START_T=$(date -u "+%Y%m%d_%H%M%SZ")
-
-# Paths
-CORDDIR=~/cord
-VMDIR=/opt/cord/build/
-CONFIG=config/cord_in_a_box.yml
-SSHCONFIG=~/.ssh/config
-VAGRANT_CWD=${CORDDIR}/build/
-VAGRANT_VM_PREFIX=build
-
-# CORD versioning
-REPO_BRANCH="master"
-VERSION_STRING="CiaB Devel"
-
-function finish {
- EXIT=$?
- python $CORDDIR/build/elk-logger/mixpanel --event FINISH --corddir $CORDDIR --finish --status $EXIT
-}
-
-function add_box() {
- vagrant box list | grep $1 | grep virtualbox || vagrant box add $1
- vagrant box list | grep $1 | grep libvirt || vagrant mutate $1 libvirt --input-provider virtualbox
-}
-
-function run_stage {
- cd $CORDDIR
- python build/elk-logger/mixpanel --event $1-start --corddir $CORDDIR
-
- echo "==> "$1": Starting"
- $1
- echo "==> "$1": Complete"
-
- cd $CORDDIR
- python build/elk-logger/mixpanel --event $1-end --corddir $CORDDIR
-}
-
-function cleanup_from_previous_test() {
- echo "## Cleanup ##"
-
- if [ -d $CORDDIR/build ]
- then
- echo "Destroying all Vagrant VMs"
- cd $CORDDIR/build
- for i in `seq 12`; do
- sudo su $USER -c "VAGRANT_CWD=$VAGRANT_CWD vagrant destroy" && break
- done
- fi
-
- echo "Removing $CORDDIR"
- cd ~
- rm -rf $CORDDIR
-}
-
-function bootstrap() {
-
- echo "Generating build id"
- rm -f /tmp/cord-build-version
- dd bs=18 count=1 if=/dev/urandom | base64 | tr +/ _. > /tmp/cord-build
-
- if [ ! -x "/usr/local/bin/repo" ]
- then
- echo "Installing repo..."
- REPO_SHA256SUM="394d93ac7261d59db58afa49bb5f88386fea8518792491ee3db8baab49c3ecda"
- curl -o /tmp/repo 'https://gerrit.opencord.org/gitweb?p=repo.git;a=blob_plain;f=repo;hb=refs/heads/stable'
- echo "$REPO_SHA256SUM /tmp/repo" | sha256sum -c -
- sudo mv /tmp/repo /usr/local/bin/repo
- sudo chmod a+x /usr/local/bin/repo
- fi
-
- if [ ! -x "/usr/bin/vagrant" ]
- then
- echo "Installing vagrant and associated tools..."
- VAGRANT_SHA256SUM="faff6befacc7eed3978b4b71f0dbb9c135c01d8a4d13236bda2f9ed53482d2c4" # version 1.9.3
- curl -o /tmp/vagrant.deb https://releases.hashicorp.com/vagrant/1.9.3/vagrant_1.9.3_x86_64.deb
- echo "$VAGRANT_SHA256SUM /tmp/vagrant.deb" | sha256sum -c -
- sudo apt-get update
- sudo dpkg -i /tmp/vagrant.deb
- sudo apt-get -y install qemu-kvm libvirt-bin libvirt-dev curl nfs-kernel-server git build-essential python-pip
- sudo adduser $USER libvirtd
- sudo pip install pyparsing python-logstash mixpanel
- fi
-
- echo "Installing vagrant plugins..."
- vagrant plugin list | grep vagrant-libvirt || vagrant plugin install vagrant-libvirt --plugin-version 0.0.35
- vagrant plugin list | grep vagrant-mutate || vagrant plugin install vagrant-mutate
-
- add_box ubuntu/trusty64
-
- echo "Creating SSH key..."
- [ -e ~/.ssh/id_rsa ] || ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
-
- if [ ! -d "$CORDDIR" ]
- then
- echo "Downloading CORD/XOS..."
-
- if [ ! -e "~/.gitconfig" ]
- then
- echo "No ~/.gitconfig, setting testing defaults"
- git config --global user.name 'Test User'
- git config --global user.email 'test@null.com'
- git config --global color.ui false
- fi
-
- # make sure we can find gerrit.opencord.org as DNS failures will fail the build
- dig +short gerrit.opencord.org || (echo "ERROR: gerrit.opencord.org can't be looked up in DNS" && exit 1)
-
- mkdir $CORDDIR && cd $CORDDIR
- repo init -u https://gerrit.opencord.org/manifest -b $REPO_BRANCH
- repo sync
-
- # check out gerrit branches using repo
- for gerrit_branch in ${GERRIT_BRANCHES[@]}; do
- echo "Checking out opencord gerrit branch: $gerrit_branch"
- repo download ${gerrit_branch/:/ }
- done
- fi
-
- exec > >(tee -i $CORDDIR/install.out)
- exec 2>&1
-
- # Start tracking failures from this point
- trap finish EXIT
-
-}
-
-function cloudlab_setup() {
-
- # Don't do anything if not a CloudLab node
- [ ! -d /usr/local/etc/emulab ] && return
-
- # The watchdog will sometimes reset groups, turn it off
- if [ -e /usr/local/etc/emulab/watchdog ]
- then
- sudo /usr/bin/perl -w /usr/local/etc/emulab/watchdog stop
- sudo mv /usr/local/etc/emulab/watchdog /usr/local/etc/emulab/watchdog-disabled
- fi
-
- # Mount extra space, if haven't already
- if [ ! -d /mnt/extra ]
- then
- # for NVME SSD on Utah Cloudlab, not supported by mkextrafs
- if $(df | grep -q nvme0n1p1) && [ -e /usr/testbed/bin/mkextrafs ]
- then
- sudo mkdir -p /mnt/extra
-
- # set partition type of 4th partition to Linux, ignore errors
- echo -e "t\n4\n82\np\nw\nq" | sudo fdisk /dev/nvme0n1 || true
-
- sudo mkfs.ext4 /dev/nvme0n1p4
- echo "/dev/nvme0n1p4 /mnt/extra/ ext4 defaults 0 0" | sudo tee -a /etc/fstab
- sudo mount /mnt/extra
- mount | grep nvme0n1p4 || (echo "ERROR: NVME mkfs/mount failed, exiting!" && exit 1)
-
- elif [ -e /usr/testbed/bin/mkextrafs ] # if on Clemson/Wisconsin Cloudlab
- then
- sudo mkdir -p /mnt/extra
-
- # Sometimes this command fails on the first try
- sudo /usr/testbed/bin/mkextrafs -r /dev/sdb -qf "/mnt/extra/" || sudo /usr/testbed/bin/mkextrafs -r /dev/sdb -qf "/mnt/extra/"
-
- # Check that the mount succeeded (sometimes mkextrafs succeeds but device not mounted)
- mount | grep sdb || (echo "ERROR: mkextrafs failed, exiting!" && exit 1)
- fi
- fi
-
- # replace /var/lib/libvirt/images with a symlink
- [ -d /var/lib/libvirt/images/ ] && [ ! -h /var/lib/libvirt/images ] && sudo rmdir /var/lib/libvirt/images
- sudo mkdir -p /mnt/extra/libvirt_images
-
- if [ ! -e /var/lib/libvirt/images ]
- then
- sudo ln -s /mnt/extra/libvirt_images /var/lib/libvirt/images
- fi
-}
-
-function elk_up() {
-
- cd $CORDDIR
- sudo chmod +x build/elk-logger/logstash_tail
-
- build/elk-logger/logstash_tail --file install.out --hostport 10.100.198.201:5617 &
-}
-
-function vagrant_vms_up() {
-
- echo "Bringing up CORD-in-a-Box Vagrant VM's..."
- cd $CORDDIR/build
-
- sudo su $USER -c "VAGRANT_CWD=$VAGRANT_CWD vagrant up corddev prod --provider libvirt"
-
- # This is a workaround for a weird issue with ARP cache timeout breaking 'vagrant ssh'
- # It allows SSH'ing to the machine via 'ssh corddev'
- sudo su $USER -c "VAGRANT_CWD=$VAGRANT_CWD vagrant ssh-config corddev prod > $SSHCONFIG"
-
- # copy host SSH keypair to corddev
- scp ~/.ssh/id_rsa* corddev:.ssh
- ssh corddev "chmod go-r ~/.ssh/id_rsa"
-}
-
-function install_head_node() {
- cd $CORDDIR/build
-
- # SSH config saved earlier allows us to connect to VM without running 'vagrant'
- ssh corddev "cd $VMDIR; ./gradlew -PdeployConfig=$VMDIR/$CONFIG fetch"
- ssh corddev "cd $VMDIR; ./gradlew -PdeployConfig=$VMDIR/$CONFIG buildImages"
- ssh corddev "cd $VMDIR; ping -c 3 prod; ./gradlew -PdeployConfig=$VMDIR/$CONFIG -PtargetReg=10.100.198.201:5000 publish"
- ssh corddev "cd $VMDIR; ./gradlew -PdeployConfig=$VMDIR/$CONFIG deploy"
-}
-
-function set_up_maas_user() {
- # Set up MAAS user on server to restart nodes via libvirt
- grep maas /etc/passwd || sudo useradd -m maas
- sudo adduser maas libvirtd
-
- # Copy generated public key to maas user's authorized_keys
- sudo su maas -c "mkdir -p ~/.ssh"
- sudo cp $HOME/.ssh/id_rsa.pub ~maas/.ssh/authorized_keys
- sudo chown maas:maas ~maas/.ssh/authorized_keys
-
- # Copy generated private key to maas user's home dir in prod VM
- scp $HOME/.ssh/id_rsa prod:/tmp
- ssh prod "sudo mkdir -p ~maas/.ssh"
- ssh prod "sudo cp /tmp/id_rsa ~maas/.ssh/id_rsa"
- ssh prod "sudo chown -R maas:maas ~maas/.ssh"
-}
-
-function turn_off_learning () {
- NET=$1
- BRIDGE=`sudo virsh net-info $NET|grep "Bridge:"|awk '{print $2}'`
- sudo brctl setageing $BRIDGE 0
- sudo brctl stp $BRIDGE off
-}
-
-function leaf_spine_up() {
- cd $CORDDIR/build
-
- if [[ $FABRIC -ne 0 ]]
- then
- sudo su $USER -c "VAGRANT_CWD=$VAGRANT_CWD FABRIC=$FABRIC vagrant up leaf-1 leaf-2 spine-1 spine-2 --provider libvirt"
- else
- # Linux bridging seems to be having issues with two spine switches
- sudo su $USER -c "VAGRANT_CWD=$VAGRANT_CWD FABRIC=$FABRIC vagrant up leaf-1 leaf-2 spine-1 --provider libvirt"
- fi
-
- # Turn off MAC learning on "links" -- i.e., bridges created by libvirt.
- # Without this, sometimes packets are dropped because the bridges
- # think they are not local -- this needs further investigation.
- # A better solution might be to replace the bridges with UDP tunnels, but this
- # is not supported with the version of libvirt available on Ubuntu 14.04.
- turn_off_learning head-node-leaf-1
- turn_off_learning compute-node-1-leaf-1
- turn_off_learning compute-node-2-leaf-2
- turn_off_learning compute-node-3-leaf-2
- turn_off_learning leaf-1-spine-1
- turn_off_learning leaf-1-spine-2
- turn_off_learning leaf-2-spine-1
- turn_off_learning leaf-2-spine-2
-}
-
-function add_compute_node() {
- echo add_compute_node: $1 $2
-
- cd $CORDDIR/build
- sudo su $USER -c "VAGRANT_CWD=$VAGRANT_CWD vagrant up $1 --provider libvirt"
-
- # Set up power cycling for the compute node and wait for it to be provisioned
- ssh prod "cd $VMDIR/ansible; ansible-playbook maas-provision.yml --extra-vars \"maas_user=maas vagrant_name=$2\""
-
- echo ""
- echo "$1 is fully provisioned!"
-}
-
-function initialize_fabric() {
- echo "Initializing fabric"
- ssh prod "cd $VMDIR/platform-install; ansible-playbook -i /etc/maas/ansible/pod-inventory cord-refresh-fabric.yml"
-
- echo "Fabric ping test"
- ssh prod "cd $VMDIR/platform-install; ansible-playbook -i /etc/maas/ansible/pod-inventory cord-fabric-pingtest.yml"
-}
-
-function run_e2e_test () {
- cd $CORDDIR/build
-
- # User has been added to the lbvirtd group, but su $USER to be safe
- ssh corddev "cd $VMDIR; ./gradlew -PdeployConfig=$VMDIR/$CONFIG postDeployTests"
-}
-
-function run_diagnostics() {
- ssh corddev "cd $VMDIR; ./gradlew -PdeployConfig=$VMDIR/$CONFIG PIrunDiag"
-}
-
-# Parse options
-GERRIT_BRANCHES=
-RUN_TEST=0
-SETUP_ONLY=0
-DIAGNOSTICS=0
-CLEANUP=0
-FABRIC=0
-#By default, cord-in-a-box creates 1 compute node. If more than one compute is
-#needed, use -n option
-NUM_COMPUTE_NODES=1
-
-while getopts "b:cdfhn:stv" opt; do
- case ${opt} in
- b ) GERRIT_BRANCHES+=("$OPTARG")
- ;;
- c ) CLEANUP=1
- ;;
- d ) DIAGNOSTICS=1
- ;;
- f ) FABRIC=1
- ;;
- h ) echo "Usage:"
- echo " $0 install OpenStack and prep XOS and ONOS VMs [default]"
- echo " $0 -b <project:changeset/revision> checkout a changesets from gerrit. Can"
- echo " be used multiple times."
- echo " $0 -c cleanup from previous test"
- echo " $0 -d run diagnostic collector"
- echo " $0 -f use ONOS fabric (EXPERIMENTAL)"
- echo " $0 -h display this help message"
- echo " $0 -n # number of compute nodes to setup. Currently max 2 nodes can be supported"
- echo " $0 -s run initial setup phase only (don't start building CORD)"
- echo " $0 -t do install, bring up cord-pod configuration, run E2E test"
- echo " $0 -v print CiaB version and exit"
- exit 0
- ;;
- n ) NUM_COMPUTE_NODES=$OPTARG
- ;;
- s ) SETUP_ONLY=1
- ;;
- t ) RUN_TEST=1
- ;;
- v ) echo "$VERSION_STRING ($REPO_BRANCH branch)"
- exit 0
- ;;
- \? ) echo "Invalid option: -$OPTARG"
- exit 1
- ;;
- esac
-done
-
-# What to do
-if [[ $CLEANUP -eq 1 ]]
-then
- cleanup_from_previous_test
-fi
-
-echo ""
-echo "Preparing to install $VERSION_STRING ($REPO_BRANCH branch)"
-echo ""
-
-bootstrap
-run_stage cloudlab_setup
-run_stage vagrant_vms_up
-run_stage elk_up
-
-if [[ $SETUP_ONLY -ne 0 ]]
-then
- echo "Finished build environment setup, exiting..."
- exit 0
-fi
-
-run_stage install_head_node
-run_stage set_up_maas_user
-run_stage leaf_spine_up
-
-if [[ $NUM_COMPUTE_NODES -gt 3 ]]
-then
- echo "currently max only three compute nodes can be supported..."
- NUM_COMPUTE_NODES=3
-fi
-
-echo "==> Adding compute nodes: Starting"
-for i in `seq 1 $NUM_COMPUTE_NODES`;
-do
- echo adding the compute node: compute-node-$i
- add_compute_node compute-node-$i ${VAGRANT_VM_PREFIX}_compute-node-$i
-done
-echo "==> Adding compute nodes: Complete"
-
-# run diagnostics both before/after the fabric/e2e tests
-if [[ $DIAGNOSTICS -eq 1 ]]
-then
- run_diagnostics
-fi
-
-
-if [[ $FABRIC -ne 0 ]]
-then
- run_stage initialize_fabric
-fi
-
-if [[ $RUN_TEST -eq 1 ]]
-then
- run_stage run_e2e_test
-fi
-
-if [[ $DIAGNOSTICS -eq 1 ]]
-then
- run_stage run_diagnostics
-fi
-
-exit 0
diff --git a/scripts/install.sh b/scripts/install.sh
deleted file mode 100755
index d037910..0000000
--- a/scripts/install.sh
+++ /dev/null
@@ -1,814 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-# Mininet install script for Ubuntu (and Debian Wheezy+)
-# Brandon Heller (brandonh@stanford.edu)
-
-# Fail on error
-set -e
-
-# Fail on unset var usage
-set -o nounset
-
-# Get directory containing mininet folder
-MININET_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd -P )"
-
-# Set up build directory, which by default is the working directory
-# unless the working directory is a subdirectory of mininet,
-# in which case we use the directory containing mininet
-BUILD_DIR="$(pwd -P)"
-case $BUILD_DIR in
- $MININET_DIR/*) BUILD_DIR=$MININET_DIR;; # currect directory is a subdirectory
- *) BUILD_DIR=$BUILD_DIR;;
-esac
-
-# Location of CONFIG_NET_NS-enabled kernel(s)
-KERNEL_LOC=http://www.openflow.org/downloads/mininet
-
-# Attempt to identify Linux release
-
-DIST=Unknown
-RELEASE=Unknown
-CODENAME=Unknown
-ARCH=`uname -m`
-if [ "$ARCH" = "x86_64" ]; then ARCH="amd64"; fi
-if [ "$ARCH" = "i686" ]; then ARCH="i386"; fi
-
-test -e /etc/debian_version && DIST="Debian"
-grep Ubuntu /etc/lsb-release &> /dev/null && DIST="Ubuntu"
-if [ "$DIST" = "Ubuntu" ] || [ "$DIST" = "Debian" ]; then
- install='sudo apt-get -y install'
- remove='sudo apt-get -y remove'
- pkginst='sudo dpkg -i'
- # Prereqs for this script
- if ! which lsb_release &> /dev/null; then
- $install lsb-release
- fi
-fi
-test -e /etc/fedora-release && DIST="Fedora"
-if [ "$DIST" = "Fedora" ]; then
- install='sudo yum -y install'
- remove='sudo yum -y erase'
- pkginst='sudo rpm -ivh'
- # Prereqs for this script
- if ! which lsb_release &> /dev/null; then
- $install redhat-lsb-core
- fi
-fi
-if which lsb_release &> /dev/null; then
- DIST=`lsb_release -is`
- RELEASE=`lsb_release -rs`
- CODENAME=`lsb_release -cs`
-fi
-echo "Detected Linux distribution: $DIST $RELEASE $CODENAME $ARCH"
-
-# Kernel params
-
-KERNEL_NAME=`uname -r`
-KERNEL_HEADERS=kernel-headers-${KERNEL_NAME}
-
-if ! echo $DIST | egrep 'Ubuntu|Debian|Fedora'; then
- echo "Install.sh currently only supports Ubuntu, Debian and Fedora."
- exit 1
-fi
-
-# More distribution info
-DIST_LC=`echo $DIST | tr [A-Z] [a-z]` # as lower case
-
-
-# Determine whether version $1 >= version $2
-# usage: if version_ge 1.20 1.2.3; then echo "true!"; fi
-function version_ge {
- # sort -V sorts by *version number*
- latest=`printf "$1\n$2" | sort -V | tail -1`
- # If $1 is latest version, then $1 >= $2
- [ "$1" == "$latest" ]
-}
-
-
-# Kernel Deb pkg to be removed:
-KERNEL_IMAGE_OLD=linux-image-2.6.26-33-generic
-
-DRIVERS_DIR=/lib/modules/${KERNEL_NAME}/kernel/drivers/net
-
-OVS_RELEASE=1.4.0
-OVS_PACKAGE_LOC=https://github.com/downloads/mininet/mininet
-OVS_BUILDSUFFIX=-ignore # was -2
-OVS_PACKAGE_NAME=ovs-$OVS_RELEASE-core-$DIST_LC-$RELEASE-$ARCH$OVS_BUILDSUFFIX.tar
-OVS_TAG=v$OVS_RELEASE
-
-OF13_SWITCH_REV=${OF13_SWITCH_REV:-""}
-
-
-function kernel {
- echo "Install Mininet-compatible kernel if necessary"
- sudo apt-get update
- if ! $install linux-image-$KERNEL_NAME; then
- echo "Could not install linux-image-$KERNEL_NAME"
- echo "Skipping - assuming installed kernel is OK."
- fi
-}
-
-function kernel_clean {
- echo "Cleaning kernel..."
-
- # To save disk space, remove previous kernel
- if ! $remove $KERNEL_IMAGE_OLD; then
- echo $KERNEL_IMAGE_OLD not installed.
- fi
-
- # Also remove downloaded packages:
- rm -f $HOME/linux-headers-* $HOME/linux-image-*
-}
-
-# Install Mininet deps
-function mn_deps {
- echo "Installing Mininet dependencies"
- if [ "$DIST" = "Fedora" ]; then
- $install gcc make socat psmisc xterm openssh-clients iperf \
- iproute telnet python-setuptools libcgroup-tools \
- ethtool help2man pyflakes pylint python-pep8
- else
- $install gcc make socat psmisc xterm ssh iperf iproute telnet \
- python-setuptools cgroup-bin ethtool help2man \
- pyflakes pylint pep8
- fi
-
- echo "Installing Mininet core"
- pushd $MININET_DIR/mininet
- sudo make install
- popd
-}
-
-# Install Mininet developer dependencies
-function mn_dev {
- echo "Installing Mininet developer dependencies"
- $install doxygen doxypy texlive-fonts-recommended
- if ! $install doxygen-latex; then
- echo "doxygen-latex not needed"
- fi
-}
-
-# The following will cause a full OF install, covering:
-# -user switch
-# The instructions below are an abbreviated version from
-# http://www.openflowswitch.org/wk/index.php/Debian_Install
-function of {
- echo "Installing OpenFlow reference implementation..."
- cd $BUILD_DIR
- $install autoconf automake libtool make gcc
- if [ "$DIST" = "Fedora" ]; then
- $install git pkgconfig glibc-devel
- else
- $install git-core autotools-dev pkg-config libc6-dev
- fi
- git clone git://openflowswitch.org/openflow.git
- cd $BUILD_DIR/openflow
-
- # Patch controller to handle more than 16 switches
- patch -p1 < $MININET_DIR/mininet/util/openflow-patches/controller.patch
-
- # Resume the install:
- ./boot.sh
- ./configure
- make
- sudo make install
- cd $BUILD_DIR
-}
-
-function of13 {
- echo "Installing OpenFlow 1.3 soft switch implementation..."
- cd $BUILD_DIR/
- $install git-core autoconf automake autotools-dev pkg-config \
- make gcc g++ libtool libc6-dev cmake libpcap-dev libxerces-c2-dev \
- unzip libpcre3-dev flex bison libboost-dev
-
- if [ ! -d "ofsoftswitch13" ]; then
- git clone https://github.com/CPqD/ofsoftswitch13.git
- if [[ -n "$OF13_SWITCH_REV" ]]; then
- cd ofsoftswitch13
- git checkout ${OF13_SWITCH_REV}
- cd ..
- fi
- fi
-
- # Install netbee
- if [ "$DIST" = "Ubuntu" ] && version_ge $RELEASE 14.04; then
- NBEESRC="nbeesrc-feb-24-2015"
- NBEEDIR="netbee"
- else
- NBEESRC="nbeesrc-jan-10-2013"
- NBEEDIR="nbeesrc-jan-10-2013"
- fi
-
- NBEEURL=${NBEEURL:-http://www.nbee.org/download/}
- wget -nc ${NBEEURL}${NBEESRC}.zip
- unzip ${NBEESRC}.zip
- cd ${NBEEDIR}/src
- cmake .
- make
- cd $BUILD_DIR/
- sudo cp ${NBEEDIR}/bin/libn*.so /usr/local/lib
- sudo ldconfig
- sudo cp -R ${NBEEDIR}/include/ /usr/
-
- # Resume the install:
- cd $BUILD_DIR/ofsoftswitch13
- ./boot.sh
- ./configure
- make
- sudo make install
- cd $BUILD_DIR
-}
-
-
-function install_wireshark {
- if ! which wireshark; then
- echo "Installing Wireshark"
- if [ "$DIST" = "Fedora" ]; then
- $install wireshark wireshark-gnome
- else
- $install wireshark tshark
- fi
- fi
-
- # Copy coloring rules: OF is white-on-blue:
- echo "Optionally installing wireshark color filters"
- mkdir -p $HOME/.wireshark
- cp -n $MININET_DIR/mininet/util/colorfilters $HOME/.wireshark
-
- echo "Checking Wireshark version"
- WSVER=`wireshark -v | egrep -o '[0-9\.]+' | head -1`
- if version_ge $WSVER 1.12; then
- echo "Wireshark version $WSVER >= 1.12 - returning"
- return
- fi
-
- echo "Cloning LoxiGen and building openflow.lua dissector"
- cd $BUILD_DIR
- git clone https://github.com/floodlight/loxigen.git
- cd loxigen
- make wireshark
-
- # Copy into plugin directory
- # libwireshark0/ on 11.04; libwireshark1/ on later
- WSDIR=`find /usr/lib -type d -name 'libwireshark*' | head -1`
- WSPLUGDIR=$WSDIR/plugins/
- PLUGIN=loxi_output/wireshark/openflow.lua
- sudo cp $PLUGIN $WSPLUGDIR
- echo "Copied openflow plugin $PLUGIN to $WSPLUGDIR"
-
- cd $BUILD_DIR
-}
-
-
-# Install Open vSwitch specific version Ubuntu package
-function ubuntuOvs {
- echo "Creating and Installing Open vSwitch packages..."
-
- OVS_SRC=$BUILD_DIR/openvswitch
- OVS_TARBALL_LOC=http://openvswitch.org/releases
-
- if ! echo "$DIST" | egrep "Ubuntu|Debian" > /dev/null; then
- echo "OS must be Ubuntu or Debian"
- $cd BUILD_DIR
- return
- fi
- if [ "$DIST" = "Ubuntu" ] && ! version_ge $RELEASE 12.04; then
- echo "Ubuntu version must be >= 12.04"
- cd $BUILD_DIR
- return
- fi
- if [ "$DIST" = "Debian" ] && ! version_ge $RELEASE 7.0; then
- echo "Debian version must be >= 7.0"
- cd $BUILD_DIR
- return
- fi
-
- rm -rf $OVS_SRC
- mkdir -p $OVS_SRC
- cd $OVS_SRC
-
- if wget $OVS_TARBALL_LOC/openvswitch-$OVS_RELEASE.tar.gz 2> /dev/null; then
- tar xzf openvswitch-$OVS_RELEASE.tar.gz
- else
- echo "Failed to find OVS at $OVS_TARBALL_LOC/openvswitch-$OVS_RELEASE.tar.gz"
- cd $BUILD_DIR
- return
- fi
-
- # Remove any old packages
- $remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller \
- openvswitch-pki openvswitch-switch
-
- # Get build deps
- $install build-essential fakeroot debhelper autoconf automake libssl-dev \
- pkg-config bzip2 openssl python-all procps python-qt4 \
- python-zopeinterface python-twisted-conch dkms
-
- # Build OVS
- cd $BUILD_DIR/openvswitch/openvswitch-$OVS_RELEASE
- DEB_BUILD_OPTIONS='parallel=2 nocheck' fakeroot debian/rules binary
- cd ..
- $pkginst openvswitch-common_$OVS_RELEASE*.deb openvswitch-datapath-dkms_$OVS_RELEASE*.deb \
- openvswitch-pki_$OVS_RELEASE*.deb openvswitch-switch_$OVS_RELEASE*.deb
- if $pkginst openvswitch-controller_$OVS_RELEASE*.deb; then
- echo "Ignoring error installing openvswitch-controller"
- fi
-
- modinfo openvswitch
- sudo ovs-vsctl show
- # Switch can run on its own, but
- # Mininet should control the controller
- # This appears to only be an issue on Ubuntu/Debian
- if sudo service openvswitch-controller stop; then
- echo "Stopped running controller"
- fi
- if [ -e /etc/init.d/openvswitch-controller ]; then
- sudo update-rc.d openvswitch-controller disable
- fi
-}
-
-
-# Install Open vSwitch
-
-function ovs {
- echo "Installing Open vSwitch..."
-
- if [ "$DIST" == "Fedora" ]; then
- $install openvswitch openvswitch-controller
- return
- fi
-
- if [ "$DIST" = "Ubuntu" ] && ! version_ge $RELEASE 14.04; then
- # Older Ubuntu versions need openvswitch-datapath/-dkms
- # Manually installing openvswitch-datapath may be necessary
- # for manually built kernel .debs using Debian's defective kernel
- # packaging, which doesn't yield usable headers.
- if ! dpkg --get-selections | grep openvswitch-datapath; then
- # If you've already installed a datapath, assume you
- # know what you're doing and don't need dkms datapath.
- # Otherwise, install it.
- $install openvswitch-datapath-dkms
- fi
- fi
-
- $install openvswitch-switch
- if $install openvswitch-controller; then
- # Switch can run on its own, but
- # Mininet should control the controller
- # This appears to only be an issue on Ubuntu/Debian
- if sudo service openvswitch-controller stop; then
- echo "Stopped running controller"
- fi
- if [ -e /etc/init.d/openvswitch-controller ]; then
- sudo update-rc.d openvswitch-controller disable
- fi
- else
- echo "Attempting to install openvswitch-testcontroller"
- if ! $install openvswitch-testcontroller; then
- echo "Failed - skipping openvswitch-testcontroller"
- fi
- fi
-
-}
-
-function remove_ovs {
- pkgs=`dpkg --get-selections | grep openvswitch | awk '{ print $1;}'`
- echo "Removing existing Open vSwitch packages:"
- echo $pkgs
- if ! $remove $pkgs; then
- echo "Not all packages removed correctly"
- fi
- # For some reason this doesn't happen
- if scripts=`ls /etc/init.d/*openvswitch* 2>/dev/null`; then
- echo $scripts
- for s in $scripts; do
- s=$(basename $s)
- echo SCRIPT $s
- sudo service $s stop
- sudo rm -f /etc/init.d/$s
- sudo update-rc.d -f $s remove
- done
- fi
- echo "Done removing OVS"
-}
-
-function ivs {
- echo "Installing Indigo Virtual Switch..."
-
- IVS_SRC=$BUILD_DIR/ivs
-
- # Install dependencies
- $install git pkg-config gcc make libnl-3-dev libnl-route-3-dev libnl-genl-3-dev
-
- # Install IVS from source
- cd $BUILD_DIR
- git clone git://github.com/floodlight/ivs $IVS_SRC --recursive
- cd $IVS_SRC
- make
- sudo make install
-}
-
-# Install RYU
-function ryu {
- echo "Installing RYU..."
-
- # install Ryu dependencies"
- $install autoconf automake g++ libtool python make
- if [ "$DIST" = "Ubuntu" ]; then
- $install libxml2 libxslt-dev python-pip python-dev
- sudo pip install gevent
- elif [ "$DIST" = "Debian" ]; then
- $install libxml2 libxslt-dev python-pip python-dev
- sudo pip install gevent
- fi
-
- # if needed, update python-six
- SIX_VER=`pip show six | grep Version | awk '{print $2}'`
- if version_ge 1.7.0 $SIX_VER; then
- echo "Installing python-six version 1.7.0..."
- sudo pip install -I six==1.7.0
- fi
- # fetch RYU
- cd $BUILD_DIR/
- git clone git://github.com/osrg/ryu.git ryu
- cd ryu
-
- # install ryu
- sudo python ./setup.py install
-
- # Add symbolic link to /usr/bin
- sudo ln -s ./bin/ryu-manager /usr/local/bin/ryu-manager
-}
-
-# Install NOX with tutorial files
-function nox {
- echo "Installing NOX w/tutorial files..."
-
- # Install NOX deps:
- $install autoconf automake g++ libtool python python-twisted \
- swig libssl-dev make
- if [ "$DIST" = "Debian" ]; then
- $install libboost1.35-dev
- elif [ "$DIST" = "Ubuntu" ]; then
- $install python-dev libboost-dev
- $install libboost-filesystem-dev
- $install libboost-test-dev
- fi
- # Install NOX optional deps:
- $install libsqlite3-dev python-simplejson
-
- # Fetch NOX destiny
- cd $BUILD_DIR/
- git clone https://github.com/noxrepo/nox-classic.git noxcore
- cd noxcore
- if ! git checkout -b destiny remotes/origin/destiny ; then
- echo "Did not check out a new destiny branch - assuming current branch is destiny"
- fi
-
- # Apply patches
- git checkout -b tutorial-destiny
- git am $MININET_DIR/mininet/util/nox-patches/*tutorial-port-nox-destiny*.patch
- if [ "$DIST" = "Ubuntu" ] && version_ge $RELEASE 12.04; then
- git am $MININET_DIR/mininet/util/nox-patches/*nox-ubuntu12-hacks.patch
- fi
-
- # Build
- ./boot.sh
- mkdir build
- cd build
- ../configure
- make -j3
- #make check
-
- # Add NOX_CORE_DIR env var:
- sed -i -e 's|# for examples$|&\nexport NOX_CORE_DIR=$BUILD_DIR/noxcore/build/src|' ~/.bashrc
-
- # To verify this install:
- #cd ~/noxcore/build/src
- #./nox_core -v -i ptcp:
-}
-
-# Install NOX Classic/Zaku for OpenFlow 1.3
-function nox13 {
- echo "Installing NOX w/tutorial files..."
-
- # Install NOX deps:
- $install autoconf automake g++ libtool python python-twisted \
- swig libssl-dev make
- if [ "$DIST" = "Debian" ]; then
- $install libboost1.35-dev
- elif [ "$DIST" = "Ubuntu" ]; then
- $install python-dev libboost-dev
- $install libboost-filesystem-dev
- $install libboost-test-dev
- fi
-
- # Fetch NOX destiny
- cd $BUILD_DIR/
- git clone https://github.com/CPqD/nox13oflib.git
- cd nox13oflib
-
- # Build
- ./boot.sh
- mkdir build
- cd build
- ../configure
- make -j3
- #make check
-
- # To verify this install:
- #cd ~/nox13oflib/build/src
- #./nox_core -v -i ptcp:
-}
-
-
-# "Install" POX
-function pox {
- echo "Installing POX into $BUILD_DIR/pox..."
- cd $BUILD_DIR
- git clone https://github.com/noxrepo/pox.git
-}
-
-# Install OFtest
-function oftest {
- echo "Installing oftest..."
-
- # Install deps:
- $install tcpdump python-scapy
-
- # Install oftest:
- cd $BUILD_DIR/
- git clone git://github.com/floodlight/oftest
-}
-
-# Install cbench
-function cbench {
- echo "Installing cbench..."
-
- if [ "$DIST" = "Fedora" ]; then
- $install net-snmp-devel libpcap-devel libconfig-devel
- else
- $install libsnmp-dev libpcap-dev libconfig-dev
- fi
- cd $BUILD_DIR/
- git clone git://gitosis.stanford.edu/oflops.git
- cd oflops
- sh boot.sh || true # possible error in autoreconf, so run twice
- sh boot.sh
- ./configure --with-openflow-src-dir=$BUILD_DIR/openflow
- make
- sudo make install || true # make install fails; force past this
-}
-
-function vm_other {
- echo "Doing other Mininet VM setup tasks..."
-
- # Remove avahi-daemon, which may cause unwanted discovery packets to be
- # sent during tests, near link status changes:
- echo "Removing avahi-daemon"
- $remove avahi-daemon
-
- # was: Disable IPv6. Add to /etc/modprobe.d/blacklist:
- #echo "Attempting to disable IPv6"
- #if [ "$DIST" = "Ubuntu" ]; then
- # BLACKLIST=/etc/modprobe.d/blacklist.conf
- #else
- # BLACKLIST=/etc/modprobe.d/blacklist
- #fi
- #sudo sh -c "echo 'blacklist net-pf-10\nblacklist ipv6' >> $BLACKLIST"
- echo "Disabling IPv6"
- # Disable IPv6
- if ! grep 'disable_ipv6' /etc/sysctl.conf; then
- echo 'Disabling IPv6'
- echo '
-# Mininet: disable IPv6
-net.ipv6.conf.all.disable_ipv6 = 1
-net.ipv6.conf.default.disable_ipv6 = 1
-net.ipv6.conf.lo.disable_ipv6 = 1' | sudo tee -a /etc/sysctl.conf > /dev/null
- fi
- # Since the above doesn't disable neighbor discovery, also do this:
- if ! grep 'ipv6.disable' /etc/default/grub; then
- sudo sed -i -e \
- 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 /' \
- /etc/default/grub
- sudo update-grub
- fi
- # Disabling IPv6 breaks X11 forwarding via ssh
- line='AddressFamily inet'
- file='/etc/ssh/sshd_config'
- echo "Adding $line to $file"
- if ! grep "$line" $file > /dev/null; then
- echo "$line" | sudo tee -a $file > /dev/null
- fi
-
- # Enable command auto completion using sudo; modify ~/.bashrc:
- sed -i -e 's|# for examples$|&\ncomplete -cf sudo|' ~/.bashrc
-
- # Install tcpdump, cmd-line packet dump tool. Also install gitk,
- # a graphical git history viewer.
- $install tcpdump gitk
-
- # Install common text editors
- $install vim nano emacs
-
- # Install NTP
- $install ntp
-
- # Install vconfig for VLAN example
- if [ "$DIST" = "Fedora" ]; then
- $install vconfig
- else
- $install vlan
- fi
-
- # Set git to colorize everything.
- git config --global color.diff auto
- git config --global color.status auto
- git config --global color.branch auto
-
- # Reduce boot screen opt-out delay. Modify timeout in /boot/grub/menu.lst to 1:
- if [ "$DIST" = "Debian" ]; then
- sudo sed -i -e 's/^timeout.*$/timeout 1/' /boot/grub/menu.lst
- fi
-
- # Clean unneeded debs:
- rm -f ~/linux-headers-* ~/linux-image-*
-}
-
-# Script to copy built OVS kernel module to where modprobe will
-# find them automatically. Removes the need to keep an environment variable
-# for insmod usage, and works nicely with multiple kernel versions.
-#
-# The downside is that after each recompilation of OVS you'll need to
-# re-run this script. If you're using only one kernel version, then it may be
-# a good idea to use a symbolic link in place of the copy below.
-function modprobe {
- echo "Setting up modprobe for OVS kmod..."
- set +o nounset
- if [ -z "$OVS_KMODS" ]; then
- echo "OVS_KMODS not set. Aborting."
- else
- sudo cp $OVS_KMODS $DRIVERS_DIR
- sudo depmod -a ${KERNEL_NAME}
- fi
- set -o nounset
-}
-
-function all {
- if [ "$DIST" = "Fedora" ]; then
- printf "\nFedora 18+ support (still work in progress):\n"
- printf " * Fedora 18+ has kernel 3.10 RPMS in the updates repositories\n"
- printf " * Fedora 18+ has openvswitch 1.10 RPMS in the updates repositories\n"
- printf " * the install.sh script options [-bfnpvw] should work.\n"
- printf " * for a basic setup just try:\n"
- printf " install.sh -fnpv\n\n"
- exit 3
- fi
- echo "Installing all packages except for -eix (doxypy, ivs, nox-classic)..."
- kernel
- mn_deps
- # Skip mn_dev (doxypy/texlive/fonts/etc.) because it's huge
- # mn_dev
- of
- install_wireshark
- ovs
- # We may add ivs once it's more mature
- # ivs
- # NOX-classic is deprecated, but you can install it manually if desired.
- # nox
- pox
- oftest
- cbench
- echo "Enjoy Mininet!"
-}
-
-# Restore disk space and remove sensitive files before shipping a VM.
-function vm_clean {
- echo "Cleaning VM..."
- sudo apt-get clean
- sudo apt-get autoremove
- sudo rm -rf /tmp/*
- sudo rm -rf openvswitch*.tar.gz
-
- # Remove sensistive files
- history -c # note this won't work if you have multiple bash sessions
- rm -f ~/.bash_history # need to clear in memory and remove on disk
- rm -f ~/.ssh/id_rsa* ~/.ssh/known_hosts
- sudo rm -f ~/.ssh/authorized_keys*
-
- # Remove Mininet files
- #sudo rm -f /lib/modules/python2.5/site-packages/mininet*
- #sudo rm -f /usr/bin/mnexec
-
- # Clear optional dev script for SSH keychain load on boot
- rm -f ~/.bash_profile
-
- # Clear git changes
- git config --global user.name "None"
- git config --global user.email "None"
-
- # Note: you can shrink the .vmdk in vmware using
- # vmware-vdiskmanager -k *.vmdk
- echo "Zeroing out disk blocks for efficient compaction..."
- time sudo dd if=/dev/zero of=/tmp/zero bs=1M
- sync ; sleep 1 ; sync ; sudo rm -f /tmp/zero
-
-}
-
-function usage {
- printf '\nUsage: %s [-abcdfhikmnprtvVwxy03]\n\n' $(basename $0) >&2
-
- printf 'This install script attempts to install useful packages\n' >&2
- printf 'for Mininet. It should (hopefully) work on Ubuntu 11.10+\n' >&2
- printf 'If you run into trouble, try\n' >&2
- printf 'installing one thing at a time, and looking at the \n' >&2
- printf 'specific installation function in this script.\n\n' >&2
-
- printf 'options:\n' >&2
- printf -- ' -a: (default) install (A)ll packages - good luck!\n' >&2
- printf -- ' -b: install controller (B)enchmark (oflops)\n' >&2
- printf -- ' -c: (C)lean up after kernel install\n' >&2
- printf -- ' -d: (D)elete some sensitive files from a VM image\n' >&2
- printf -- ' -e: install Mininet d(E)veloper dependencies\n' >&2
- printf -- ' -f: install Open(F)low\n' >&2
- printf -- ' -h: print this (H)elp message\n' >&2
- printf -- ' -i: install (I)ndigo Virtual Switch\n' >&2
- printf -- ' -k: install new (K)ernel\n' >&2
- printf -- ' -m: install Open vSwitch kernel (M)odule from source dir\n' >&2
- printf -- ' -n: install Mini(N)et dependencies + core files\n' >&2
- printf -- ' -p: install (P)OX OpenFlow Controller\n' >&2
- printf -- ' -r: remove existing Open vSwitch packages\n' >&2
- printf -- ' -s <dir>: place dependency (S)ource/build trees in <dir>\n' >&2
- printf -- ' -t: complete o(T)her Mininet VM setup tasks\n' >&2
- printf -- ' -v: install Open (V)switch\n' >&2
- printf -- ' -V <version>: install a particular version of Open (V)switch on Ubuntu\n' >&2
- printf -- ' -w: install OpenFlow (W)ireshark dissector\n' >&2
- printf -- ' -y: install R(y)u Controller\n' >&2
- printf -- ' -x: install NO(X) Classic OpenFlow controller\n' >&2
- printf -- ' -0: (default) -0[fx] installs OpenFlow 1.0 versions\n' >&2
- printf -- ' -3: -3[fx] installs OpenFlow 1.3 versions\n' >&2
- exit 2
-}
-
-OF_VERSION=1.0
-
-if [ $# -eq 0 ]
-then
- all
-else
- while getopts 'abcdefhikmnprs:tvV:wxy03' OPTION
- do
- case $OPTION in
- a) all;;
- b) cbench;;
- c) kernel_clean;;
- d) vm_clean;;
- e) mn_dev;;
- f) case $OF_VERSION in
- 1.0) of;;
- 1.3) of13;;
- *) echo "Invalid OpenFlow version $OF_VERSION";;
- esac;;
- h) usage;;
- i) ivs;;
- k) kernel;;
- m) modprobe;;
- n) mn_deps;;
- p) pox;;
- r) remove_ovs;;
- s) mkdir -p $OPTARG; # ensure the directory is created
- BUILD_DIR="$( cd -P "$OPTARG" && pwd )"; # get the full path
- echo "Dependency installation directory: $BUILD_DIR";;
- t) vm_other;;
- v) ovs;;
- V) OVS_RELEASE=$OPTARG;
- ubuntuOvs;;
- w) install_wireshark;;
- x) case $OF_VERSION in
- 1.0) nox;;
- 1.3) nox13;;
- *) echo "Invalid OpenFlow version $OF_VERSION";;
- esac;;
- y) ryu;;
- 0) OF_VERSION=1.0;;
- 3) OF_VERSION=1.3;;
- ?) usage;;
- esac
- done
- shift $(($OPTIND - 1))
-fi
diff --git a/scripts/repo-apply.sh b/scripts/repo-apply.sh
deleted file mode 100755
index 00aad86..0000000
--- a/scripts/repo-apply.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-## Script to patch up diff reated by `repo diff`
-
-# from https://groups.google.com/d/msg/repo-discuss/43juvD1qGIQ/7maptZVcEjsJ
-if [ -z "$1" ] || [ ! -e "$1" ]; then
- echo "Usages: $0 <repo_diff_file>";
- exit 0;
-fi
-
-rm -fr _tmp_splits*
-cat $1 | csplit -qf '' -b "_tmp_splits.%d.diff" - '/^project.*\/$/' '{*}'
-
-working_dir=`pwd`
-
-for proj_diff in `ls _tmp_splits.*.diff`
-do
- chg_dir=`cat $proj_diff | grep '^project.*\/$' | cut -d " " -f 2`
- echo "FILE: $proj_diff $chg_dir"
- if [ -e $chg_dir ]; then
- ( cd $chg_dir; \
- cat $working_dir/$proj_diff | grep -v '^project.*\/$' | patch -Np1;);
- else
- echo "$0: Project directory $chg_dir don't exists.";
- fi
-done
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
deleted file mode 100755
index e6e8de5..0000000
--- a/scripts/run-tests.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright 2017-present Open Networking Foundation
-#
-# 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.
-
-set -e
-
-CORDDIR=~/cord
-VMDIR=/opt/cord/build/
-CONFIG=config/cord_in_a_box.yml
-SSHCONFIG=~/.ssh/config
-
-function run_e2e_test () {
- cd $CORDDIR/build
-
- # User has been added to the lbvirtd group, but su $USER to be safe
- ssh corddev "cd $VMDIR; ./gradlew -PdeployConfig=$VMDIR/$CONFIG postDeployTests"
-}
-
-run_e2e_test
-
-exit 0