Skip to content

Instantly share code, notes, and snippets.

@aweiteka
Created April 5, 2018 15:44
Show Gist options
  • Save aweiteka/27470d278a03d3a1f513ac29a8e4b7a9 to your computer and use it in GitHub Desktop.
Save aweiteka/27470d278a03d3a1f513ac29a8e4b7a9 to your computer and use it in GitHub Desktop.
Run arbitrary playbooks from openshift-ansible against local oc cluster up environment

Goal

Hack on openshift-ansible roles against a local openshift environment. We have to use an openshift-ansible container to workaround local dependencies.

Steps

NOTE: run from base of local openshift-ansible repo.

  1. Bring up local cluster

     oc cluster up
    
  2. Run openshift-ansible container. You'll need to change this command to point to a valid playbook.

     docker run -ti --rm -u root \
     --net=host \
     -v `pwd`/test/tox-inventory.txt:/tmp/inventory \
     -v `pwd`:/usr/share/ansible/openshift-ansible \
     -e INVENTORY_FILE=/tmp/inventory \
     -e PLAYBOOK_FILE=playbooks/<some_playbook> \
     -v $HOME/.kube/config:/etc/origin/master/admin.kubeconfig \
     -e KUBECONFIG=/etc/origin/master/admin.kubeconfig \
     -e OPTS="-v -c local -e openshift_deployment_type=origin -e is_containerized=true" \
     openshift/origin-ansible
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment