Answer the question
In order to leave comments, you need to log in
Ansible. Is it possible to pass to var_prompt (for example) the target host?
When starting the playbook, you can specify the -i key with the necessary inventory, and already in the playbook itself, resolve the hosts. But somehow it looks hardcoded. Ideally I would like to use var_prompt
Answer the question
In order to leave comments, you need to log in
---
- hosts: "{{ host }}"
vars_prompt:
- name: host
prompt: "Enter hostname"
private: no
tasks:
- debug: msg="{{ host }}"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question