diff options
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | roles/openshift_master/tasks/system_container.yml | 2 | ||||
-rw-r--r-- | setup.py | 48 |
3 files changed, 39 insertions, 23 deletions
@@ -35,12 +35,12 @@ fixes. Older branches will receive only critical fixes. Follow this release pattern and you can't go wrong: -| Origin | OpenShift-Ansible | -| ------------- | ----------------- | -| 1.3 | 3.3 | -| 1.4 | 3.4 | -| 1.5 | 3.5 | -| 3.*X* | 3.*X* | +| Origin/OCP | OpenShift-Ansible version | openshift-ansible branch | +| ------------- | ----------------- |----------------------------------| +| 1.3 / 3.3 | 3.3 | release-1.3 | +| 1.4 / 3.4 | 3.4 | releaes-1.4 | +| 1.5 / 3.5 | 3.5 | release-1.5 | +| 3.*X* | 3.*X* | release-3.x | If you're running from the openshift-ansible **master branch** we can only guarantee compatibility with the newest origin releases **in diff --git a/roles/openshift_master/tasks/system_container.yml b/roles/openshift_master/tasks/system_container.yml index 164beb256..8d343336f 100644 --- a/roles/openshift_master/tasks/system_container.yml +++ b/roles/openshift_master/tasks/system_container.yml @@ -22,7 +22,7 @@ - name: Install or Update HA controller master system container oc_atomic_container: name: "{{ openshift.common.service_type }}-master-controllers" - image: "{{{ 'docker:' if openshift.common.system_images_registry == 'docker' else openshift.common.system_images_registry + '/' }}{ openshift.master.master_system_image }}:{{ openshift_image_tag }}" + image: "{{ 'docker:' if openshift.common.system_images_registry == 'docker' else openshift.common.system_images_registry + '/' }}{{ openshift.master.master_system_image }}:{{ openshift_image_tag }}" state: latest values: - COMMAND=controllers @@ -221,27 +221,43 @@ class OpenShiftAnsibleSyntaxCheck(Command): ''' run command ''' has_errors = False + playbooks = set() + included_playbooks = set() for yaml_file in find_files( os.path.join(os.getcwd(), 'playbooks', 'byo'), None, None, r'\.ya?ml$'): with open(yaml_file, 'r') as contents: - for line in contents: - # initialize_groups.yml is used to identify entry point playbooks - if re.search(r'initialize_groups\.yml', line): - print('-' * 60) - print('Syntax checking playbook: %s' % yaml_file) - try: - subprocess.check_output( - ['ansible-playbook', '-i localhost,', - '--syntax-check', yaml_file] - ) - except subprocess.CalledProcessError as cpe: - print('{}Execution failed: {}{}'.format( - self.FAIL, cpe, self.ENDC)) - has_errors = True - # Break for loop, no need to continue looping lines - break + for task in yaml.safe_load(contents): + if not isinstance(task, dict): + # Skip yaml files which do not contain plays or includes + continue + if 'include' in task: + # Add the playbook and capture included playbooks + playbooks.add(yaml_file) + included_file_name = task['include'].split()[0] + included_file = os.path.normpath( + os.path.join(os.path.dirname(yaml_file), + included_file_name)) + included_playbooks.add(included_file) + elif 'hosts' in task: + playbooks.add(yaml_file) + # Evaluate the difference between all playbooks and included playbooks + entrypoint_playbooks = sorted(playbooks.difference(included_playbooks)) + print('Entry point playbook count: {}'.format(len(entrypoint_playbooks))) + # Syntax each entry point playbook + for playbook in entrypoint_playbooks: + print('-' * 60) + print('Syntax checking playbook: {}'.format(playbook)) + try: + subprocess.check_output( + ['ansible-playbook', '-i localhost,', + '--syntax-check', playbook] + ) + except subprocess.CalledProcessError as cpe: + print('{}Execution failed: {}{}'.format( + self.FAIL, cpe, self.ENDC)) + has_errors = True if has_errors: raise SystemExit(1) |