diff --git a/playbooks/group_vars/all/global.yml b/playbooks/group_vars/all/global.yml index f3e6a00..2437b58 100644 --- a/playbooks/group_vars/all/global.yml +++ b/playbooks/group_vars/all/global.yml @@ -4,7 +4,7 @@ run_cleanup: false run_prereqs: false setup_nested_virt: false setup_minishift: true -start_minishift: false +start_minishift: true setup_containers: true setup_helper_containers: true setup_pipelines: false diff --git a/playbooks/roles/cleanup/tasks/cleanup.yml b/playbooks/roles/cleanup/tasks/cleanup.yml index 4df93d6..a80a23b 100644 --- a/playbooks/roles/cleanup/tasks/cleanup.yml +++ b/playbooks/roles/cleanup/tasks/cleanup.yml @@ -56,7 +56,7 @@ path: "{{ item }}" state: absent with_items: - - "{{ contra_env_setup_dir }}/{{ project_dir }}" + - "{{ project_dir }}" when: - pd_is_found.stat.exists - force_repo_clone|bool == true diff --git a/playbooks/roles/cleanup/tasks/main.yml b/playbooks/roles/cleanup/tasks/main.yml index 007e06e..9c12d4c 100644 --- a/playbooks/roles/cleanup/tasks/main.yml +++ b/playbooks/roles/cleanup/tasks/main.yml @@ -1,5 +1,15 @@ --- # tasks file for cleanup +- name: "Running cleanup pre-tasks {{ cleanup_pre_hooks }}" + include_tasks: "{{ item }}" + with_items: "{{ cleanup_pre_hooks }}" + when: cleanup_pre_hooks is defined + - name: "Stop minishift if running" - import_tasks: cleanup.yml \ No newline at end of file + import_tasks: cleanup.yml + +- name: "Running cleanup post-tasks {{ cleanup_post_hooks }}" + include_tasks: "{{ item }}" + with_items: "{{ cleanup_post_hooks }}" + when: cleanup_post_hooks is defined diff --git a/playbooks/roles/create/tasks/main.yml b/playbooks/roles/create/tasks/main.yml index a0ba360..d270413 100644 --- a/playbooks/roles/create/tasks/main.yml +++ b/playbooks/roles/create/tasks/main.yml @@ -11,4 +11,4 @@ # Clone the project_repo and sample_project_repo - name: "Clone the project repo {{ project_repo }}" - import_tasks: clone_repos.yml \ No newline at end of file + import_tasks: clone_repos.yml diff --git a/playbooks/roles/minishift/tasks/init_minishift.yml b/playbooks/roles/minishift/tasks/init_minishift.yml index 16557f5..759ef16 100644 --- a/playbooks/roles/minishift/tasks/init_minishift.yml +++ b/playbooks/roles/minishift/tasks/init_minishift.yml @@ -18,13 +18,11 @@ - name: "Wait for the cluster to come up completely" pause: minutes: 3 - when: (cpu_mode_not_configured|bool) or - (start_minishift|bool == false) + when: (cpu_mode_not_configured|bool) - name: "Stop the minishift profile {{ profile }}" shell: "{{ minishift_bin }} stop --profile {{ profile }}" - when: (cpu_mode_not_configured|bool) or - (start_minishift|bool == false) + when: (cpu_mode_not_configured|bool) - name: "Update the minishift VM config" lineinfile: diff --git a/playbooks/roles/minishift/tasks/main.yml b/playbooks/roles/minishift/tasks/main.yml index 30acd8e..3e2af95 100644 --- a/playbooks/roles/minishift/tasks/main.yml +++ b/playbooks/roles/minishift/tasks/main.yml @@ -1,6 +1,11 @@ --- # setup minishift +- name: "Running minishift pre-tasks {{ minishift_pre_hooks }}" + include_tasks: "{{ item }}" + with_items: "{{ minishift_pre_hooks }}" + when: minishift_pre_hooks is defined + - fail: msg: 'setup_minishift cannot be true with a defined value for openshift_cluster_ip' when: openshift_cluster_ip != "" @@ -74,9 +79,13 @@ when: ((minishift_profile_status.stdout_lines and minishift_profile_status.stdout_lines[0]|lower == "does not exist") or (minishift_profile_status.rc != 0)) and (minishift_external_vm_ip == "") -# Start minishift on an external VM if configured +# Start minishift on an external VM if configured, then shut it down (if it was configured not to start, but we wanted the profile to exist) - name: "Initialization of minishift cluster with profile {{ profile }} on an existing VM ip {{ minishift_external_vm_ip }}" shell: "{{ minishift_bin }} start --profile {{ profile }} --openshift-version {{ oc_version }} --vm-driver generic --remote-ipaddress {{ minishift_external_vm_ip }} --remote-ssh-user {{ minishift_external_vm_user }} --remote-ssh-key {{ minishift_external_vm_ssh_key_location }}" when: ((minishift_profile_status.stdout_lines and minishift_profile_status.stdout_lines[0]|lower == "does not exist") or - (minishift_profile_status.rc != 0)) and (minishift_external_vm_ip != "") + (minishift_profile_status.rc != 0)) and (minishift_external_vm_ip != "") and (start_minishift|bool == true) +- name: "Running minishift post-tasks {{ minishift_post_hooks }}" + include_tasks: "{{ item }}" + with_items: "{{ minishift_post_hooks }}" + when: minishift_post_hooks is defined