Bash auto completion of ssh hosts from foreman
- Define GOPATH environment variable (if not already defined)
- $ go get github.com/tsliwowicz/gethosts-foreman
- $ cp $GOPATH/bin/gethosts-foreman /usr/local/bin (or some other directory in your search path)
- $ vi $GOPATH/src/github.com/tsliwowicz/gethosts-foreman/foreman-completion.sh-template (replace the placeholders and save)
- $ cp $GOPATH/src/github.com/tsliwowicz/gethosts-foreman/foreman-completion.sh-template /etc/profile.d/foreman-completion.sh
- $ source /etc/profile.d/foreman-completion.sh (required only if you want the automcomplete to be active in the existing session)