Skip to content

Use environment variables in inventory #97

@bborysenko

Description

@bborysenko

I would like to be able dynamically generate inventory based on environment variables:

# Supfile

---
env:
  GCLOUD_INSTANCE_NAME: loadtesing-template

networks:
  cloud:
    inventory:
      echo "deploy@$(gcloud compute instances describe $GCLOUD_INSTANCE_NAME | grep natIP | awk '{print $2}'):22"

But it doesn't work:

$ sup
usage: gcloud compute instances describe  NAME [optional flags]
ERROR: (gcloud.compute.instances.describe) too few arguments
Networks:
- cloud
    - deploy@:22

$ sup -e GCLOUD_INSTANCE_NAME=loadtesing-master
usage: gcloud compute instances describe  NAME [optional flags]
ERROR: (gcloud.compute.instances.describe) too few arguments
Networks:
- cloud
    - deploy@:22

Is there some way to do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions