Run 'setup_repositories' task on all nodes

Change-Id: I111292a6a5a1eb9038906b73e19dce90f46d60f0
Closes-Bug: #1536805
This commit is contained in:
slava 2016-01-26 19:13:43 +03:00
parent 871f388255
commit 8084c47946
3 changed files with 13 additions and 3 deletions

View File

@ -1,7 +1,7 @@
- id: setup_repositories
type: puppet
version: 2.0.0
groups: [primary-controller, controller, compute, compute-vmware, cinder, cinder-block-device, cinder-vmware, primary-mongo, mongo, ceph-osd, virt, ironic]
groups: ['/.*/']
requires: [hiera]
required_for: [fuel_pkgs]
parameters:

View File

@ -40,6 +40,9 @@ class DeploymentGraph(object):
if 'groups' in task:
for req in task['groups']:
# check if group is defined as regular expression
if req.startswith('/'):
continue
graph.add_edge(task_id, req)
if 'tasks' in task:
for req in task['tasks']:

View File

@ -57,6 +57,7 @@
import fnmatch
import os
import re
import sys
import argparse
import yaml
@ -266,7 +267,7 @@ class TaskGraph(object):
self.graph.add_edge(id_from, id_to, options)
@staticmethod
def filter_nodes(node, filter=None):
def filter_nodes(node_id, node, filter=None):
# if group is not specified accept only the group tasks
# and show only them on the graph/list
# if there is a group, filter out group tasks
@ -291,6 +292,11 @@ class TaskGraph(object):
if 'groups' in node:
if ('*' in node['groups']) or (filter in node['groups']):
return True
for group in node['groups']:
pattern = re.compile(group.strip('/'))
if pattern.match(node_id):
return True
return False
def process_data(self):
@ -340,7 +346,8 @@ class TaskGraph(object):
def filter_processed_data(self, filter=None):
for node_id in self.data.keys():
if not self.filter_nodes(self.data[node_id], filter=filter):
if not self.filter_nodes(node_id, self.data[node_id],
filter=filter):
self.data.pop(node_id)
def build_graph(self):