Answer the question
In order to leave comments, you need to log in
How to parse stdout output word by word in ansible?
Good day!
There is an ansible task that launches a container in Proxmox:
- name: Запуск контейнера
proxmox:
hostname: tmp0
api_user: [email protected]
api_password: root
api_host: 192.168.254.23
state: started
msg: VM 106 started
Answer the question
In order to leave comments, you need to log in
Try like this
- name: Запуск контейнера
proxmox:
hostname: tmp0
api_user: [email protected]
api_password: root
api_host: 192.168.254.23
state: started
register: result
- name: Debug registered var
debug: {{ result.stdout_lines.split()[1] }}
Have you tried it like this?
- name: Start
proxmox container:
hostname: tmp0
api_user: [email protected]
api_password: root
api_host: 192.168.254.23
state: started
register: result
- name: Debug registered var
debug: var=result.stdout_lines
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question