[CORD-2276]
Update xos-base to 16.04, remove unused/legacy packages

Change-Id: Ie60c74bc171c3c1e55d53877e8a9b8cca0f0db27
diff --git a/VERSION b/VERSION
index 519af9a..3f6d5ce 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-6.0.0.dev
+6.0.0.dev0
diff --git a/containers/chameleon/Dockerfile.chameleon b/containers/chameleon/Dockerfile.chameleon
index 7d69ed8..2fc9937 100644
--- a/containers/chameleon/Dockerfile.chameleon
+++ b/containers/chameleon/Dockerfile.chameleon
@@ -25,7 +25,9 @@
 COPY tmp.chameleon /chameleon/chameleon
 
 # Build the protos
-RUN chdir chameleon/chameleon/protos && VOLTHA_BASE=anything make
+RUN pip install docker==3.1.4 klein==17.10.0 fluent-logger==0.9.2 \
+ && chdir chameleon/chameleon/protos \
+ && VOLTHA_BASE=anything make
 
 # Label image
 ARG org_label_schema_schema_version=1.0
diff --git a/containers/xos/Dockerfile.base b/containers/xos/Dockerfile.base
index d94e4db..19359f7 100644
--- a/containers/xos/Dockerfile.base
+++ b/containers/xos/Dockerfile.base
@@ -1,4 +1,3 @@
-
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,49 +12,26 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 # Dockerfile.base
 # This image isn't used, but installs the prereqs for the other XOS images
-FROM ubuntu:14.04.5
+FROM ubuntu:16.04
 
 # Install apt packages, including docker
-RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y \
     apt-transport-https \
+    build-essential \
     curl \
-    cython \
-    gcc \
-    geoip-database \
-    git \
-    graphviz \
-    graphviz-dev \
-    libcurl4-gnutls-dev \
-    libffi-dev \
-    libgeoip1 \
     libpq-dev \
-    libxslt1-dev \
-    libxslt1.1 \
     libyaml-dev \
-    m4 \
     openssh-client \
-    pkg-config \
-    python-dev \
     python-pip \
-    rsync \
     software-properties-common \
     sshpass \
-    supervisor \
-    unzip \
-    wget \
- && apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 \
-    --recv-keys 58118E89F3A912897C070ADBF76221572C52609D \
- && echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | \
-    tee /etc/apt/sources.list.d/docker.list \
  && apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 \
     --recv-keys 46095ACC8548582C1A2699A9D27D666CD88E42B4 \
  && echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | \
     tee -a /etc/apt/sources.list.d/elastic-6.x.list \
  && apt-get update \
- && apt-get install -y docker-engine \
  && apt-get install -y filebeat \
  && update-rc.d filebeat defaults 95 10 \
  && rm -rf /var/lib/apt/lists/* \
@@ -66,11 +42,13 @@
 COPY filebeat.yml /etc/filebeat/filebeat.yml
 
 # Install python packages with pip
+# Upgrade methodology - pip_requested.txt is the manually generated list of pip
+# packages desired, without any added dependencies. It is used to generate
+# pip_requirements.txt by running: pip install -r pip_requested.txt then use
+# `pipdeptree` to make sure dependencies aren't broken, then
+# `pip freeze > pip_requirements.txt` and manually clean up.
 COPY pip_requirements.txt /tmp/pip_requirements.txt
-
-# Upgrade requests from apt installed version
-RUN pip install --no-deps -U -I requests==2.11.1 \
- && pip install --no-deps -U -I pip==9.0.1 setuptools==36.0.1 \
+RUN pip install --no-deps -U -I pip==9.0.3 setuptools==39.0.1 requests==2.18.4 \
  && pip install --no-deps -r /tmp/pip_requirements.txt \
  && pip freeze > /var/xos/pip_freeze_pip_up_`date -u +%Y%m%dT%H%M%S`
 
diff --git a/containers/xos/Dockerfile.xos-core b/containers/xos/Dockerfile.xos-core
index c43853e..1c6ce85 100644
--- a/containers/xos/Dockerfile.xos-core
+++ b/containers/xos/Dockerfile.xos-core
@@ -1,4 +1,3 @@
-
 # Copyright 2017-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,7 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 # xosproject/xos-core
 FROM xosproject/xos-libraries:candidate
 
@@ -21,14 +19,13 @@
 ADD xos /opt/xos
 ADD lib /opt/xos/lib
 
-RUN chmod +x /opt/xos/tools/xos-manage \
- && mkdir -p /opt/cord_profile /opt/xos_services /opt/xos_libraries \
- && sync \
- && /opt/xos/tools/xos-manage genkeys
-
-RUN xosgenx --output /opt/xos/core/models --target django.xtarget --dest-extension py --write-to-file model /opt/xos/core/models/core.xproto
-RUN xosgenx --output /opt/xos/core/models --target django-security.xtarget --dest-file security.py --write-to-file single /opt/xos/core/models/core.xproto
-RUN xosgenx --output /opt/xos/core/models --target init.xtarget --dest-file __init__.py --write-to-file single /opt/xos/core/models/core.xproto
+RUN mkdir -p /opt/cord_profile /opt/xos_services /opt/xos_libraries \
+ && xosgenx --output /opt/xos/core/models --target django.xtarget --dest-extension py \
+      --write-to-file model /opt/xos/core/models/core.xproto \
+ && xosgenx --output /opt/xos/core/models --target django-security.xtarget --dest-file security.py \
+      --write-to-file single /opt/xos/core/models/core.xproto \
+ && xosgenx --output /opt/xos/core/models --target init.xtarget --dest-file __init__.py \
+      --write-to-file single /opt/xos/core/models/core.xproto
 
 # Set environment variables
 ENV HOME /root
diff --git a/containers/xos/pip_requested.txt b/containers/xos/pip_requested.txt
new file mode 100644
index 0000000..ddb2e1a
--- /dev/null
+++ b/containers/xos/pip_requested.txt
@@ -0,0 +1,49 @@
+Django==1.11.11
+Jinja2==2.10
+Pattern==2.6
+PyYAML==3.12
+Twisted==16.6.0
+Werkzeug==0.14.1
+ansible==2.5.0
+astunparse==1.5.0
+django-extensions==2.0.6
+django-timezones==0.2
+djangorestframework==3.7.7
+dnspython==1.15.0
+functools32==3.2.3-2
+futures==3.2.0
+google-api-python-client==1.6.5
+grpcio-tools==1.9.1
+grpcio==1.9.1
+keystoneauth1==3.4.0
+mock==2.0.0
+multistructlog==1.5
+netaddr==0.7.19
+networkx==1.11
+nose==1.3.7
+oslo.log==3.37.0
+oslo.messaging==5.36.0
+oslo.serialization==2.25.0
+oslo.utils==3.36.0
+ply==3.11
+plyxproto==3.0.1
+protobuf==3.5.2
+# Avoids a warning, see http://initd.org/psycopg/docs/faq.html#faq-compile
+psycopg2==2.7.4 --no-binary psycopg2
+pyOpenSSL==17.5.0
+pykwalify==1.6.1
+python-consul==0.7.2
+python-glanceclient==2.9.1
+python-keystoneclient==3.15.0
+python-logstash==0.4.6
+python-neutronclient==5.1.0
+python-novaclient==10.1.0
+python-openstackclient==3.14.0
+pytz==2018.3
+redis==2.10.6
+requests==2.18.4
+service-identity==17.0.0
+shade==1.27.1
+six==1.11.0
+structlog==18.1.0
+tosca-parser==0.9.0
diff --git a/containers/xos/pip_requirements.txt b/containers/xos/pip_requirements.txt
index 3e9b703..9ebf227 100644
--- a/containers/xos/pip_requirements.txt
+++ b/containers/xos/pip_requirements.txt
@@ -1,168 +1,141 @@
-pytz==2018.3
-sphinx==1.3.1
-Babel==2.3.4
-Django==1.11.10
-Jinja2==2.9.6
-Markdown==2.6.8
+Babel==2.5.3
+Django==1.11.11
+Jinja2==2.10
 MarkupSafe==1.0
 Paste==2.0.3
 PasteDeploy==1.5.2
+Pattern==2.6
+PyNaCl==1.2.1
 PyYAML==3.12
-Routes==2.3.1
-WebOb==1.6.1
-amqp==1.4.9
-attrs==17.2.0
-ansible==2.2.2.0
-anyjson==0.3.3
-appdirs==1.4.0
-asn1crypto==0.22.0
-backports.ssl-match-hostname==3.5.0.1
-ca-certs-locater==1.0
-cachetools==1.1.6
-cached-property==1.3.0
-cffi==1.10.0
-cliff==2.2.0
-cmd2==0.6.8
+Routes==2.4.1
+Twisted==16.6.0
+WebOb==1.7.4
+Werkzeug==0.14.1
+amqp==2.2.2
+ansible==2.5.0
+appdirs==1.4.3
+asn1crypto==0.24.0
+astunparse==1.5.0
+attrs==17.4.0
+bcrypt==3.1.4
+cachetools==2.0.1
+certifi==2018.1.18
+cffi==1.11.5
+chardet==3.0.4
+cliff==2.11.0
+cmd2==0.8.2
 colorama==0.3.9
 constantly==15.1.0
-contextlib2==0.5.4
-coreapi==1.32.3
-coverage==4.4.1
-cryptography==1.9
-debtcollector==1.8.0
-decorator==4.1.2
-django-extensions==1.9.9
-django-filter==1.1.0
-django-ipware==2.0.1
+contextlib2==0.5.5
+cryptography==2.2.2
+debtcollector==1.19.0
+decorator==4.2.1
+deprecation==2.0
+django-extensions==2.0.6
 django-timezones==0.2
 djangorestframework==3.7.7
-dnslib==0.9.6
-docutils==0.13.1
-docker==3.1.4
-docker_pycreds==0.2.1
+dnspython==1.15.0
 docopt==0.6.2
-dogpile.cache==0.6.2
+dogpile.cache==0.6.5
+enum-compat==0.0.2
 enum34==1.1.6
-eventlet==0.19.0
+eventlet==0.20.0
 fasteners==0.14.1
 funcsigs==1.0.2
 functools32==3.2.3-2
-futures==3.0.5
-futurist==0.18.0
-google-api-python-client==1.5.3
-greenlet==0.4.10
-sphinx_rtd_theme==0.1.9
-grpcio==1.9.1
+futures==3.2.0
+futurist==1.6.0
+google-api-python-client==1.6.5
+greenlet==0.4.13
 grpcio-tools==1.9.1
-html5lib==0.999
-httplib2==0.9.2
-idna==2.1
-ipaddress==1.0.16
-incremental==16.10.1
-iso8601==0.1.11
-itypes==1.1.0
-fluent-logger==0.9.2
-jsonpatch==1.14
-jsonpointer==1.10
-jsonschema==2.5.1
-keystoneauth1==2.12.1
-klein==17.10.0
-kombu==3.0.35
-lxml==3.6.4
-meld3==0.6.10
+grpcio==1.9.1
+httplib2==0.11.1
+idna==2.6
+incremental==17.5.0
+ipaddress==1.0.19
+iso8601==0.1.12
+jmespath==0.9.3
+jsonpatch==1.21
+jsonpointer==2.0
+jsonschema==2.6.0
+keystoneauth1==3.4.0
+kombu==4.1.0
 mock==2.0.0
-monotonic==1.2
-msgpack-python==0.4.8
+monotonic==1.4
+msgpack==0.5.6
 multistructlog==1.5
+munch==2.2.0
+netaddr==0.7.19
+netifaces==0.10.6
 networkx==1.11
-numpy==1.13.1
-munch==2.0.4
-ndg-httpsclient==0.4.2
-netaddr==0.7.18
-netifaces==0.10.5
 nose==1.3.7
-oauth2client==3.0.0
-openapi-codec==1.0.0
-openstacksdk==0.9.4
-os-client-config==1.21.0
-osc-lib==1.1.0
-oslo.concurrency==3.14.0
-oslo.config==3.17.0
-oslo.context==2.9.0
-oslo.i18n==3.9.0
-oslo.log==3.16.0
-oslo.messaging==5.10.0
-oslo.middleware==3.19.0
-oslo.serialization==2.13.0
-oslo.service==1.16.0
-oslo.utils==3.16.0
-osprofiler==1.4.0
-paramiko==2.0.2
-pattern==2.6
-pbr==1.10.0
-pika==0.10.0
+oauth2client==4.1.2
+openstacksdk==0.12.0
+os-client-config==1.29.0
+os-service-types==1.2.0
+osc-lib==1.10.0
+oslo.concurrency==3.26.0
+oslo.config==6.0.0
+oslo.context==2.20.0
+oslo.i18n==3.20.0
+oslo.log==3.37.0
+oslo.messaging==5.36.0
+oslo.middleware==3.35.0
+oslo.serialization==2.25.0
+oslo.service==1.30.0
+oslo.utils==3.36.0
+packaging==17.1
+paramiko==2.4.1
+pbr==4.0.0
 pika-pool==0.1.3
-ply==3.10
-positional==1.1.1
+pika==0.10.0
+pipdeptree==0.11.0
+ply==3.11
+plyxproto==3.0.1
+positional==1.2.1
 prettytable==0.7.2
 protobuf==3.5.2
-psycopg2==2.6.2
-pyOpenSSL==16.2.0
-pyasn1==0.1.9
-pyasn1-modules==0.0.8
+# Avoids a warning, see http://initd.org/psycopg/docs/faq.html#faq-compile
+psycopg2==2.7.4 --no-binary psycopg2
+pyOpenSSL==17.5.0
+pyasn1-modules==0.2.1
+pyasn1==0.4.2
 pycparser==2.18
-pycrypto==2.6.1
-pycurl==7.43.0
-pygraphviz==1.3.1
-pykwalify==1.6.0
-pyparsing==2.1.8
-python-cinderclient==1.8.0
-python-consul==0.7.0
-python-dateutil==2.5.3
-python-designateclient==2.3.0
-python-gflags==3.0.6
-python-glanceclient==2.5.0
-python-heatclient==1.4.0
-python-ironicclient==1.6.0
-python-keyczar==0.716
-python-keystoneclient==3.5.0
+pyinotify==0.9.6
+pykwalify==1.6.1
+pyparsing==2.2.0
+pyperclip==1.6.0
+python-cinderclient==3.5.0
+python-consul==0.7.2
+python-dateutil==2.7.2
+python-glanceclient==2.9.1
+python-keystoneclient==3.15.0
 python-logstash==0.4.6
-python-magnumclient==2.3.0
-python-mistralclient==2.1.0
 python-neutronclient==5.1.0
-python-novaclient==5.1.0
-python-openstackclient==3.1.0
-python-swiftclient==3.0.0
-python-troveclient==2.5.0
-repoze.lru==0.6
-requests==2.11.1
-requestsexceptions==1.1.3
-retrying==1.3.3
-rfc3986==0.4.1
+python-novaclient==10.1.0
+python-openstackclient==3.14.0
+pytz==2018.3
+redis==2.10.6
+repoze.lru==0.7
+requests==2.18.4
+requestsexceptions==1.4.0
+rfc3986==1.1.0
 rsa==3.4.2
-ruamel.ordereddict==0.4.9
-ruamel.yaml==0.11.15
-service_identity==17.0.0
-shade==1.9.0
-simplejson==3.8.2
+service-identity==17.0.0
+shade==1.27.1
+simplejson==3.13.2
 six==1.11.0
-stevedore==1.17.1
+statsd==3.2.2
+stevedore==1.28.0
 structlog==18.1.0
-supervisor==3.0b2
-texttable==0.8.7
-tosca-parser==0.8.1
-twisted==16.6.0
+subprocess32==3.2.7
+tenacity==4.9.0
+tosca-parser==0.9.0
+typing==3.6.4
 unicodecsv==0.14.1
-uritemplate==0.6
-urllib3==1.7.1
-warlock==1.2.0
-websocket_client==0.39.0
-werkzeug==0.11.15
-wheel==0.24.0
-wrapt==1.10.8
-wsgiref==0.1.2
-zope.interface==4.3.3
-redis==2.10.5
-astunparse==1.5.0
-plyxproto==3.0.1
-setuptools==38.5.2
+uritemplate==3.0.0
+urllib3==1.22
+vine==1.1.4
+warlock==1.3.0
+wrapt==1.10.11
+zope.interface==4.4.3
diff --git a/lib/xos-config/setup.py b/lib/xos-config/setup.py
index 098f544..777a7a1 100644
--- a/lib/xos-config/setup.py
+++ b/lib/xos-config/setup.py
@@ -31,5 +31,9 @@
       author='Matteo Scandolo',
       author_email='teo@onlab.us',
       packages=['xosconfig'],
-      include_package_data=True
+      include_package_data=True,
+      # TODO add all deps to the install_requires section
+      install_requires=[
+          'pykwalify>=1.6.0'
+          ]
      )
diff --git a/xos/core/models/core.xproto b/xos/core/models/core.xproto
index 2c3fbf1..07b4dd4 100644
--- a/xos/core/models/core.xproto
+++ b/xos/core/models/core.xproto
@@ -320,7 +320,7 @@
      required manytoone owner->Slice:ownedNetworks = 8 [help_text = "Slice that owns control of this Network", null = False, db_index = True, blank = False];
      required bool permit_all_slices = 10 [default = False, null = False, db_index = False, blank = True];
      required bool autoconnect = 17 [help_text = "This network can be autoconnected to the slice that owns it", default = True, null = False, db_index = False, blank = True];
-     required manytomany permitted_slices->Slice/Network_permitted_slices:availableNetworks = 18 [db_index = False, null = False, blank = True];
+     required manytomany permitted_slices->Slice/Network_permitted_slices:availableNetworks = 18 [db_index = False, blank = True];
 }
 
 
@@ -371,7 +371,7 @@
 }
 message NodeLabel (XOSBase) {
      required string name = 1 [max_length = 200, content_type = "stripped", blank = False, help_text = "label name", null = False, db_index = False];
-     required manytomany node->Node/NodeLabel_node:nodelabels = 2 [db_index = False, null = False, blank = True];
+     required manytomany node->Node/NodeLabel_node:nodelabels = 2 [db_index = False, blank = True];
 }
 
 policy port_validator < (obj.instance.slice in obj.network.permitted_slices.all()) | (obj.instance.slice = obj.network.owner) | obj.network.permit_all_slices >
diff --git a/xos/synchronizers/new_base/ansible_helper.py b/xos/synchronizers/new_base/ansible_helper.py
index 210fa6d..a1332cb 100644
--- a/xos/synchronizers/new_base/ansible_helper.py
+++ b/xos/synchronizers/new_base/ansible_helper.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 
 # Copyright 2017-present Open Networking Foundation
 #
@@ -13,9 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-#!/usr/bin/env python
-
 import jinja2
 import tempfile
 import os
@@ -124,7 +122,7 @@
     f = open(fqp,'w')
     f.write(buffer)
     f.flush()
-    
+
     """
     q = Queue()
     p = Process(target=run_playbook, args=(ansible_hosts, ansible_config, fqp, opts, q,))
@@ -165,7 +163,7 @@
                     pass
 
             # FIXME (zdw, 2017-02-19) - may not be needed with new callback logging
-            
+
             ofile.write('%s: %s\n'%(x._task, str(x._result)))
 
 	    if (object):
@@ -202,8 +200,6 @@
         else:
             raise
 
-    
-            
     processed_results = map(lambda x:x._result, ok_results)
     return processed_results[1:] # 0 is setup
 
@@ -226,7 +222,7 @@
 
     (opts, fqp) = get_playbook_fn(opts, path)
     private_key_pathname = fqp + ".key"
-    config_pathname = fqp + ".config"
+    config_pathname = fqp + ".cfg"
     hosts_pathname = fqp + ".hosts"
 
     f = open(private_key_pathname, "w")
diff --git a/xos/synchronizers/new_base/ansible_runner.py b/xos/synchronizers/new_base/ansible_runner.py
index b7595f2..83eee03 100644
--- a/xos/synchronizers/new_base/ansible_runner.py
+++ b/xos/synchronizers/new_base/ansible_runner.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 
 # Copyright 2017-present Open Networking Foundation
 #
@@ -13,9 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-#!/usr/bin/env python
-
 import os
 import sys
 import pdb
@@ -26,8 +24,8 @@
 constants = reload(constants)
 
 from tempfile import NamedTemporaryFile
-from ansible.inventory import Inventory
-from ansible.vars import VariableManager
+from ansible.inventory.manager import InventoryManager
+from ansible.vars.manager import VariableManager
 from ansible.parsing.dataloader import DataLoader
 from ansible.executor import playbook_executor
 from ansible.utils.display import Display
@@ -218,56 +216,97 @@
     """
     Options class to replace Ansible OptParser
     """
-    def __init__(self, verbosity=None, inventory=None, listhosts=None, subset=None, module_paths=None, extra_vars=None,
-                 forks=None, ask_vault_pass=None, vault_password_files=None, new_vault_password_file=None,
-                 output_file=None, tags=None, skip_tags=None, one_line=None, tree=None, ask_sudo_pass=None, ask_su_pass=None,
-                 sudo=None, sudo_user=None, become=None, become_method=None, become_user=None, become_ask_pass=None,
-                 ask_pass=None, private_key_file=None, remote_user=None, connection=None, timeout=None, ssh_common_args=None,
-                 sftp_extra_args=None, scp_extra_args=None, ssh_extra_args=None, poll_interval=None, seconds=None, check=None,
-                 syntax=None, diff=None, force_handlers=None, flush_cache=None, listtasks=None, listtags=None, module_path=None):
-        self.verbosity = verbosity
-        self.inventory = inventory
-        self.listhosts = listhosts
-        self.subset = subset
-        self.module_paths = module_paths
-        self.extra_vars = extra_vars
-        self.forks = forks
-        self.ask_vault_pass = ask_vault_pass
-        self.vault_password_files = vault_password_files
-        self.new_vault_password_file = new_vault_password_file
-        self.output_file = output_file
-        self.tags = tags
-        self.skip_tags = skip_tags
-        self.one_line = one_line
-        self.tree = tree
-        self.ask_sudo_pass = ask_sudo_pass
+    def __init__(self,
+                 ask_pass=None,
+                 ask_su_pass=None,
+                 ask_sudo_pass=None,
+                 become=None,
+                 become_ask_pass=None,
+                 become_method=None,
+                 become_user=None,
+                 check=None,
+                 connection=None,
+                 diff=None,
+                 flush_cache=None,
+                 force_handlers=None,
+                 forks=1,
+                 listtags=None,
+                 listtasks=None,
+                 module_path=None,
+                 new_vault_password_file=None,
+                 one_line=None,
+                 output_file=None,
+                 poll_interval=None,
+                 private_key_file=None,
+                 remote_user=None,
+                 scp_extra_args=None,
+                 seconds=None,
+                 sftp_extra_args=None,
+                 skip_tags=None,
+                 ssh_common_args=None,
+                 ssh_extra_args=None,
+                 sudo=None,
+                 sudo_user=None,
+                 syntax=None,
+                 tags=None,
+                 timeout=None,
+                 tree=None,
+                 vault_password_files=None,
+                 ask_vault_pass=None,
+                 extra_vars=None,
+                 inventory=None,
+                 listhosts=None,
+                 module_paths=None,
+                 subset=None,
+                 verbosity=None
+                 ):
+
+        if tags:
+            self.tags = tags
+
+        if skip_tags:
+            self.skip_tags = skip_tags
+
+        self.ask_pass = ask_pass
         self.ask_su_pass = ask_su_pass
-        self.sudo = sudo
-        self.sudo_user = sudo_user
+        self.ask_sudo_pass = ask_sudo_pass
+        self.ask_vault_pass = ask_vault_pass
         self.become = become
+        self.become_ask_pass = become_ask_pass
         self.become_method = become_method
         self.become_user = become_user
-        self.become_ask_pass = become_ask_pass
-        self.ask_pass = ask_pass
+        self.check = check
+        self.connection = connection
+        self.diff = diff
+        self.extra_vars = extra_vars
+        self.flush_cache = flush_cache
+        self.force_handlers = force_handlers
+        self.forks = forks
+        self.inventory = inventory
+        self.listhosts = listhosts
+        self.listtags = listtags
+        self.listtasks = listtasks
+        self.module_path = module_path
+        self.module_paths = module_paths
+        self.new_vault_password_file = new_vault_password_file
+        self.one_line = one_line
+        self.output_file = output_file
+        self.poll_interval = poll_interval
         self.private_key_file = private_key_file
         self.remote_user = remote_user
-        self.connection = connection
-        self.timeout = timeout
-        self.ssh_common_args = ssh_common_args
-        self.sftp_extra_args = sftp_extra_args
         self.scp_extra_args = scp_extra_args
-        self.ssh_extra_args = ssh_extra_args
-        self.poll_interval = poll_interval
         self.seconds = seconds
-        self.check = check
+        self.sftp_extra_args = sftp_extra_args
+        self.ssh_common_args = ssh_common_args
+        self.ssh_extra_args = ssh_extra_args
+        self.subset = subset
+        self.sudo = sudo
+        self.sudo_user = sudo_user
         self.syntax = syntax
-        self.diff = diff
-        self.force_handlers = force_handlers
-        self.flush_cache = flush_cache
-        self.listtasks = listtasks
-        self.listtags = listtags
-        self.module_path = module_path
-
+        self.timeout = timeout
+        self.tree = tree
+        self.vault_password_files = vault_password_files
+        self.verbosity = verbosity
 
 class Runner(object):
 
@@ -299,20 +338,18 @@
         self.loader = DataLoader()
         try:
             self.loader.set_vault_password(os.environ['VAULT_PASS'])
-        except KeyError:
+        except AttributeError:
             pass
 
-        # All the variables from all the various places
-        self.variable_manager = VariableManager()
-        self.variable_manager.extra_vars = {} # self.run_data
-
         # Set inventory, using most of above objects
         if (host_file):
-            self.inventory = Inventory(loader=self.loader, variable_manager=self.variable_manager, host_list = host_file)
+            self.inventory = InventoryManager(loader=self.loader, sources = host_file)
         else:
-            self.inventory = Inventory(loader=self.loader, variable_manager=self.variable_manager)
+            self.inventory = InventoryManager(loader=self.loader)
 
-        self.variable_manager.set_inventory(self.inventory)
+        # All the variables from all the various places
+        self.variable_manager = VariableManager(loader=self.loader, inventory=self.inventory)
+        self.variable_manager.extra_vars = {} # self.run_data
 
         # Setup playbook executor, but don't run until run() called
         self.pbex = playbook_executor.PlaybookExecutor(