How can I save in Ansible variable the output from a bash command?

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?


Solution 1:

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