|
|
@ -19,19 +19,20 @@ from v2.playbook.base import PlaybookBase
|
|
|
|
from v2.utils import list_union
|
|
|
|
from v2.utils import list_union
|
|
|
|
|
|
|
|
|
|
|
|
class Role(PlaybookBase):
|
|
|
|
class Role(PlaybookBase):
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
def __init__(self):
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def load(self, ds):
|
|
|
|
def load(self, ds):
|
|
|
|
self.ds = ds
|
|
|
|
self._ds = ds
|
|
|
|
self.tasks = []
|
|
|
|
self._tasks = []
|
|
|
|
self.handlers = []
|
|
|
|
self._handlers = []
|
|
|
|
self.blocks = []
|
|
|
|
self._blocks = []
|
|
|
|
self.dependencies = []
|
|
|
|
self._dependencies = []
|
|
|
|
self.metadata = dict()
|
|
|
|
self._metadata = dict()
|
|
|
|
self.defaults = dict()
|
|
|
|
self._defaults = dict()
|
|
|
|
self.vars = dict()
|
|
|
|
self._vars = dict()
|
|
|
|
self.params = dict()
|
|
|
|
self._params = dict()
|
|
|
|
|
|
|
|
|
|
|
|
def get_vars(self):
|
|
|
|
def get_vars(self):
|
|
|
|
# returns the merged variables for this role, including
|
|
|
|
# returns the merged variables for this role, including
|
|
|
@ -39,13 +40,13 @@ class Role(PlaybookBase):
|
|
|
|
return dict()
|
|
|
|
return dict()
|
|
|
|
|
|
|
|
|
|
|
|
def get_immediate_dependencies(self):
|
|
|
|
def get_immediate_dependencies(self):
|
|
|
|
return self.dependencies
|
|
|
|
return self._dependencies
|
|
|
|
|
|
|
|
|
|
|
|
def get_all_dependencies(self):
|
|
|
|
def get_all_dependencies(self):
|
|
|
|
# returns a list built recursively, of all deps from
|
|
|
|
# returns a list built recursively, of all deps from
|
|
|
|
# all child dependencies
|
|
|
|
# all child dependencies
|
|
|
|
all_deps = []
|
|
|
|
all_deps = []
|
|
|
|
for dep in self.dependencies:
|
|
|
|
for dep in self._dependencies:
|
|
|
|
list_union(all_deps, dep.get_all_dependencies())
|
|
|
|
list_union(all_deps, dep.get_all_dependencies())
|
|
|
|
all_deps = list_union(all_deps, self.dependencies)
|
|
|
|
all_deps = list_union(all_deps, self.dependencies)
|
|
|
|
return all_deps
|
|
|
|
return all_deps
|
|
|
@ -53,3 +54,5 @@ class Role(PlaybookBase):
|
|
|
|
def get_blocks(self):
|
|
|
|
def get_blocks(self):
|
|
|
|
# should return
|
|
|
|
# should return
|
|
|
|
return self.blocks
|
|
|
|
return self.blocks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|