From 4b004fd90b08f2229ad0cf383f77a363a97d52dc Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Fri, 9 Jun 2017 09:25:01 -0400 Subject: [PATCH] Use include_task. Fixes display of `minishift start` output --- README.md | 1 + meta/main.yml | 2 +- tasks/install_minishift.yml | 4 ++-- tasks/main.yml | 18 +++++++++--------- templates/cluster_out.j2.txt | 6 +----- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 79e509a..811e37f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ $ docker login -u developer -p $(oc whoami -t) https://local.openshift ## Prerequisites +- Ansible 2.4+ - Prior to running the role, clear your terminal session of any DOCKER* environment variables. - sudo access is required for installing packages diff --git a/meta/main.yml b/meta/main.yml index 5b6a37b..1484610 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -16,7 +16,7 @@ galaxy_info: # - CC-BY license: Apache v2 - min_ansible_version: 2.1 + min_ansible_version: 2.4 # If this a Container Enabled role, provide the minimum Ansible Container version. # min_ansible_container_version: diff --git a/tasks/install_minishift.yml b/tasks/install_minishift.yml index f618610..94aeea2 100644 --- a/tasks/install_minishift.yml +++ b/tasks/install_minishift.yml @@ -1,12 +1,12 @@ # install_minishift.yml - name: Get the Mac asset - include: get_ms_darwin_asset.yml + include_tasks: get_ms_darwin_asset.yml with_items: "{{ assets.json }}" when: assets is defined and ansible_os_family == 'Darwin' - name: Get the Linux asset - include: get_ms_linux_asset.yml + include_tasks: get_ms_linux_asset.yml with_items: "{{ assets.json }}" when: assets is defined and ansible_os_family != 'Darwin' and ansible_os_family != 'Windows' diff --git a/tasks/main.yml b/tasks/main.yml index 751bb30..0f410b7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Install Docker machine driver - include: "{{ ansible_os_family }}_driver.yml" + include_tasks: "{{ ansible_os_family }}_driver.yml" - name: Check if minishift binary exists stat: @@ -8,14 +8,14 @@ register: minishift_client - name: Get minishift assets - include: get_ms_assets.yml + include_tasks: get_ms_assets.yml - name: Install minishift - include: install_minishift.yml + include_tasks: install_minishift.yml when: not minishift_client.stat.exists or minishift_force_install - name: Remove existing minishift instance - include: isrunning.yml + include_tasks: isrunning.yml - name: Run minishift command: "minishift start --{{ minishift_start_options | join(' --') }}" @@ -25,7 +25,7 @@ register: minishift_out - name: Give cluster-admin to developer - include: grant_admin.yml + include_tasks: grant_admin.yml - name: Check if oc binary exists stat: @@ -33,17 +33,17 @@ register: oc_client - name: Copy latest oc client from ~/.minishift - include: copy_oc_client.yml + include_tasks: copy_oc_client.yml when: not oc_client.stat.exists or openshift_force_client_copy - name: Create objects - include: create_objects.yml + include_tasks: create_objects.yml - name: Add entry to /etc/hosts - include: add_hostname.yml + include_tasks: add_hostname.yml - name: Filter start output - include: filter_output.yml + include_tasks: filter_output.yml - name: Show output debug: diff --git a/templates/cluster_out.j2.txt b/templates/cluster_out.j2.txt index 3ca8759..e61b07f 100644 --- a/templates/cluster_out.j2.txt +++ b/templates/cluster_out.j2.txt @@ -1,9 +1,5 @@ -{% set found = false %} {% for line in minishift_out.stdout_lines %} -{% if 'Provisioning' in line %} -{% set found = true %} -{% endif %} -{% if found %} +{% if 'MiB' not in line %} {{ line }} {% endif %} {% endfor %}