P
P
Peter2016-12-27 14:23:54
Command line
Peter, 2016-12-27 14:23:54

How to pass data to .yaml in shell script?

There is a deploy.sh script.
Depending on the arguments passed to it, it can form different conditions that must be passed to .yaml
For example:

export DEBUG=""

while test $# -gt 0
do
    case "$1" in
        --debug) DEBUG="-p 5858:5858"
            ;;
    esac
    shift
done

ansible-playbook deploy/deploy.yaml

How do I send data from DEBUG to deploy.yaml ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexander, 2016-12-28
@volkov_p_v

I won't ask why, but you probably need to define variables that are passed in the standard way:
ansible-playbook deploy/deploy.yaml -e "var1=value1 var2=value2"
or in this case try
ansible-playbook deploy/deploy.yaml - e "DEBUG=$DEBUG"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question