Re: [ansible-project] vars_prompt variables carry over into next tasks

2024-02-21 Thread Dimitri Yioulos
Walter, I tried this, which is like what I think you posted: * hosts: localhost connection: local gather_facts: false vars_prompt:- name: "domainfile" prompt: "Enter domain short name" private: no- name: "pemno" prompt: "Enter the number of

Re: [ansible-project] vars_prompt variables carry over into next tasks

2024-02-21 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
This works. The set_fact makes a global variable for the entire playbook. - hosts: localhost connection: local gather_facts: false become: false vars_prompt: - name: "pemno" prompt: "Enter the number of the created pems" private: no tasks: -

Re: [ansible-project] vars_prompt variables carry over into next tasks

2024-02-21 Thread Dimitri Yioulos
Dick, I'm not getting that to work. For now, I'm prompting again for the pemno withing the second set of tasks. That works, but isn't ideal. I'd like to see if I can "re-use" the pemno gathered from the first tasks prompt in the second set of tasks: *- hosts: localhost connection: local

Re: [ansible-project] vars_prompt variables carry over into next tasks

2024-02-20 Thread Dick Visser
I *think* the vars from vars_prompt are tied to localhost in the first play, so if you need them in any next plays, you would need to reference them as localhost's hostvars: {{ hostvars['localhost'].pemno }} (not tested) On Tue, 20 Feb 2024 at 14:10, Dimitri Yioulos wrote: > Good morning. >

[ansible-project] vars_prompt variables carry over into next tasks

2024-02-20 Thread Dimitri Yioulos
Good morning. In the following playbook, i have prompts to capture certain information. The created variables work fine in the first set of tasks in the playbook. However, they don't carry over into the second set of tasks in the playbook, based on what I've tried (as seen in the playbook,