Uses existing minishift install and configures NGINX to be the router.
Performs the following tasks:
- Installs NGINX or NGINX Plus openshift router
- Debian
- Red Hat
- OSX
- Ansible 2.4+
- minishift installed (ideally use my minishift-up role)
- copy nginx-repo.crt and nginx-repo.key to the files directory
- run the following command prior
eval $(minishift docker-env)
none
nginx_plus: no
Enable NGINX Plus. If you select yes (you rock!!!) then make sure you drop the nginx-repo.crt and nginx-repo.key in the
/files
directory
Below is a sample playbook that includes all of the default parameters. You'll find this exact example in the root of the project tree.
---
- name: Install NGINX router for minishift
hosts: localhost
connection: local
gather_facts: yes
roles:
- role: magicalyak.minishift_nginx
nginx_plus: yes
After you install the role, copy minishift-nginx.yml to your project directory. For example:
# Install the role
$ ansible-galaxy install magicalyak.minishift_nginx
# Copy nginx-repo.crt and nginx-repo-key files
$ mkdir ${ANSIBLE_ROLES_PATH}/magicalyak.minishift_nginx/files
$ cp nginx-repo.{crt,key} ${ANSIBLE_ROLES_PATH}/magicalyak.minishift_nginx/files
# Copy the playbook from your roles path to the current working directory
$ cp ${ANSIBLE_ROLES_PATH}/magicalyak.minishift_nginx/minishift-nginx.yml .
# Create a localhost inventory file
$ echo "localhost">./inventory
# Set the minishift docker variables
$ eval $(minishift docker-env)
# Run the playbook
$ ansible-playbook -i inventory --ask-become-pass minishift-nginx.yml
To revert the changes make sure you don't delete the default-router-backup.yml file in the $HOME directory and run the following:
# Delete the NGINX Router
$ oc delete service/router dc/router clusterrolebinding/router-router-role serviceaccount/router
# Restore existing router
$ oc create -f $HOME/default-router-backup.yml
Apache v2