0

Below I have the Ansible YAML file:

- name: "script1"
  command: /home/test/script1.py
  register: output

- name: "script2"
  command: /home/test/script2.py

I need script2.py to see the output of script1.

How would I pass the values from Ansible to script2?

U880D
  • 8,601
  • 6
  • 24
  • 40

1 Answers1

1

command's stdin parameter should do the trick:

- name: "script1"
  command: /home/test/script1.py
  register: output


- name: "script2"
  command: /home/test/script2.py
  args:
    stdin: "{{ output.stdout }}"
Nikolaj Š.
  • 1,457
  • 1
  • 10
  • 17