redhat-cop / openshift-applier

Used to apply OpenShift objects to an OpenShift Cluster
Apache License 2.0
102 stars 61 forks source link

Support arbitrary ansible args in the container image run script #96

Open etsauer opened 5 years ago

oybed commented 5 years ago

The run script in question can be found here: https://github.com/redhat-cop/openshift-applier/blob/master/images/openshift-applier/root/usr/local/bin/run

rdebeasi commented 5 years ago

Here's an example use case:

Once you've set up all the requirements, running the applier locally is pretty easy! The command is:

ansible-playbook apply.yml -i inventory/

With the docker image, getting the requirements is of course simpler, but the command gets way more complicated. Here's the Docker equivalent of the command above.

docker run -u $(id -u) \
  -v $HOME/.kube/config:/openshift-applier/.kube/config:z
  -v $HOME/src/my-inventory/:/tmp/my-inventory
  -e INVENTORY_PATH=/tmp/my-inventory
  -t redhat-cop/openshift-applier

For a new user, it's not clear how to modify this command to get it to run the local inventory/ directory. The feature proposed in this issue would (I think)! make the docker command as simple as the local ansible command.