hosts.sh 457 B

123456789101112131415
  1. #!/bin/sh
  2. set -euo pipefail
  3. # Use a playbook to calculate the inventory dynamically from
  4. # the provided cluster variables.
  5. src="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  6. if ! out="$( ansible-playbook --inventory-file "${src}/none" ${src}/../../../playbooks/gcp/openshift-cluster/inventory.yml 2>&1 )"; then
  7. echo "error: Inventory configuration failed" 1>&2
  8. echo "$out" 1>&2
  9. echo "{}"
  10. exit 1
  11. fi
  12. source "/tmp/inventory.sh"
  13. exec ${src}/hosts.py