Skip to content

Commit

Permalink
Use include_task. Fixes display of minishift start output
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Houseknecht committed Jun 9, 2017
1 parent c7533db commit 4b004fd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tasks/install_minishift.yml
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
18 changes: 9 additions & 9 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
- 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:
path: "{{ minishift_dest }}/minishift"
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(' --') }}"
Expand All @@ -25,25 +25,25 @@
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:
path: "{{ openshift_client_dest }}/oc"
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:
Expand Down
6 changes: 1 addition & 5 deletions templates/cluster_out.j2.txt
Original file line number Diff line number Diff line change
@@ -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 %}

0 comments on commit 4b004fd

Please sign in to comment.