On 16. nov. 2016 17:45, atrebla wrote:
Is there a way to register two or more variables echoed from shell script?
I want to do something like this:

    script.sh
      A="hello"
      B="world"
      echo $A
      echo $B

    ROLE
      shell: "{{ script }} "
      register: result
      ignore_errors: False
    - name: debug
      debug: var={{ result1 }} -->of echo 1 --> hello
      debug: var={{ result2 }} -->of echo 2 --> world


Is there some other way to do what I'm trying to do there?

Your code would not run since it has some errors.

But you can get the first line from a output like this:
  - debug: var=result.stdout_lines.0

and the second line like this:
  - debug: var=result.stdout_lines.1


--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0c449159-5381-052c-e0c0-29548eaab99c%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to