Ansible – How to Save Bash Command Output in Ansible Variable

ansibleazure

I would like to store the content of a step of my Azure pipeline into a variable:

steps:
- task: UsePythonVersion@0
  inputs:
    versionSpec: '$(python.version)'
  displayName: 'Use Python $(python.version)'
- script: |
    echo 'hi'
  displayName: 'Salute'
- name: Save output to variable
  shell: echo 'hi'
  register: salute

But what I get is:
Unexpected value 'name'.

I also tried set_fact but what I get is:

Unexpected value 'set_fact'

How can I solve this?

Best Answer

Azure Pipeline is not Ansible. Refer to Azure Pipeline documentation on how to set variables in scripts