chouseknecht / minishift-up-role Goto Github PK
View Code? Open in Web Editor NEWCreates a local OpenShift instance by installing and running minishift
License: Apache License 2.0
Creates a local OpenShift instance by installing and running minishift
License: Apache License 2.0
Hi,
following the Minishift setup guide i'm running into an error during execution of the playbook:
TASK [chouseknecht.minishift : Copy oc client] *********************************
ok: [localhost]
TASK [chouseknecht.minishift : Switch the kube config context] *****************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "/usr/local/bin/oc config use-context /$(minishift ip | tr . -):8443/developer", "delta": "0:00:00.137669", "end": "2018-10-16 09:14:03.286365", "msg": "non-zero return code", "rc": 1, "start": "2018-10-16 09:14:03.148696", "stderr": "error: no context exists with the name: \"/192-168-42-198:8443/developer\".", "stderr_lines": ["error: no context exists with the name: \"/192-168-42-198:8443/developer\"."], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/home/steffen/minishift-up.retry
PLAY RECAP *********************************************************************
localhost : ok=43 changed=13 unreachable=0 failed=1
This is the output of oc config get-contexts
:
steffen@tecra-z50:~$ oc config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* minishift 192-168-42-198:8443 developer/192-168-42-198:8443 myproject
myproject/192-168-42-198:8443/developer 192-168-42-198:8443 developer/192-168-42-198:8443 myproject
myproject/192-168-42-198:8443/system:admin 192-168-42-198:8443 system:admin/192-168-42-198:8443 myproject
Looks to me that the contexts are simply named differently, maybe because of a version change?
I'm running Ubuntu 18.04, Ansible 2.7.0 and Docker 18.06.1-ce
Cheers,
Steffen
Im trying to run, but it fails, on Ubuntu 16.10, with the following:
PLAY [Install minishift] *******************************************************
TASK [setup] *******************************************************************
ok: [localhost]
TASK [chouseknecht.minishift-up-role : Install Docker machine driver] **********
included: /etc/ansible/roles/chouseknecht.minishift-up-role/tasks/Debian_driver.yml for localhost
TASK [chouseknecht.minishift-up-role : Downlodad the KVM driver] ***************
changed: [localhost]
TASK [chouseknecht.minishift-up-role : Install packages] ***********************
changed: [localhost] => (item=[u'libvirt-bin', u'qemu-kvm'])
TASK [chouseknecht.minishift-up-role : Get current user] ***********************
changed: [localhost]
TASK [chouseknecht.minishift-up-role : Add current uer to libvirtd group] ******
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Group libvirtd does not exist"}
NO MORE HOSTS LEFT *************************************************************
[WARNING]: Could not create retry file 'minishift-up.retry'. [Errno 2] No such file or directory: ''
PLAY RECAP *********************************************************************
localhost : ok=5 changed=3 unreachable=0 failed=1
The playbook kept failing on me for some reason.
TASK [chouseknecht.minishift-up-role : Set latest_version] ************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: No last item, sequence was empty.\n\nThe error appears to have been in '/home/username/.ansible/roles/chouseknecht.minishift-up-role/tasks/copy_oc_client.yml': line 11, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set latest_version\n ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: No last item, sequence was empty."}
to retry, use: --limit @/home/username/minishiftup.retry
PLAY RECAP ************************************************************************************************************************************************
localhost : ok=39 changed=13 unreachable=0 failed=1
After a bit of digging around, I figured out that minishift was failing to start due to the Libvirt default network also not being started.
minishift start
-- Starting profile 'minishift'
-- Checking if requested hypervisor 'kvm' is supported on this platform ... OK
-- Checking if KVM driver is installed ...
Driver is available at /usr/local/bin/docker-machine-driver-kvm ...
Checking driver binary is executable ... OK
-- Checking if Libvirt is installed ... OK
-- Checking if Libvirt default network is present ... FAIL
See the 'Setting Up the Driver Plug-in' topic (https://docs.openshift.org/latest/minishift/getting-started/setting-up-driver-plugin.html) for more information
That caused the set latest_version task to fail since the $HOME/.minishift/cache/oc
path was empty.
After I manually ran sudo virsh net-start default
and minishift start
, the playbook started working.
I have not tested this on any other system, nor am I positive it is repeatable. I just wanted to leave this topic out there in case someone else has a similar issue.
ansible-playbook -i inventory --ask-sudo-pass minishift-up.yml
TASK [chouseknecht.minishift-up-role : Deleting minishift] *********************
changed: [localhost]
TASK [chouseknecht.minishift-up-role : Remove ~/.minishift] ********************
changed: [localhost]
TASK [chouseknecht.minishift-up-role : Run minishift] **************************
changed: [localhost]
TASK [chouseknecht.minishift-up-role : Login as system:admin] ******************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "oc login -u system:admin", "failed": true, "msg": "[Errno 2] No such file or directory", "rc": 2}
NO MORE HOSTS LEFT *************************************************************
[WARNING]: Could not create retry file 'minishift-up.retry'. [Errno 2] No such file or directory: ''
PLAY RECAP *********************************************************************
localhost : ok=28 changed=9 unreachable=0 failed=1
Unfortunately I cannot use this role with Ansible 2.3.x in OSX.
Ansible 2.4 is nor available in Pip.
$ pip list --format=columns | grep -e ansible -e Jinja
ansible 2.3.2.0
Jinja2 2.9.6
The problem is related to include_tasks
, I've changed it to include
and worked. Now I'm facing other problem when creating the route by using previously copied oc
in /usr/local/bin/
. I had to tweak the copy_oc_client.yml
, specifically this:
- name: Copy oc client
copy:
src: "{{ latest_version.path }}/oc"
dest: "{{ openshift_client_dest }}/oc"
remote_src: yes
mode: 0755
# become: yes
# become_user: root
Finally, I had this error:
TASK [/Users/Chilcano/1github-repo/houseknecht/minishift-up-role : Create the route] *********************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["oc", "create", "-f", "route.yml"], "delta": "0:00:00.115770", "end": "2017-09-07 11:35:33.178153", "failed": true, "rc": 1, "start": "2017-09-07 11:35:33.062383", "stderr": "error: Missing or incomplete configuration info. Please login or point to an existing, complete config file:\n\n 1. Via the command-line flag --config\n 2. Via the KUBECONFIG environment variable\n 3. In your home directory as ~/.kube/config\n\nTo view or setup config directly use the 'config' command.", "stderr_lines": ["error: Missing or incomplete configuration info. Please login or point to an existing, complete config file:", "", " 1. Via the command-line flag --config", " 2. Via the KUBECONFIG environment variable", " 3. In your home directory as ~/.kube/config", "", "To view or setup config directly use the 'config' command."], "stdout": "", "stdout_lines": []}
Any idea?
Regards.
I'm trying to deploy on RedHat 7.
I only have yum. This line force the usage of DNF.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.