Using set-up facts before doing tasks

15 views
Skip to first unread message

변규섭

unread,
Aug 4, 2016, 11:45:33 AM8/4/16
to Ansible Project
Hello fellas. 

I'm new 'bout Ansible and English as well

I'v tried to use var_prompt module in my yml file. 

and now i am stuck by it.

I wanna show my remote's ip address when my prompt is shown up

but as far as i know, i can't use vars_prompt with task.

This is my yml as below.

###########################################################
---
- hosts: all
  remote_user: root

  vars_prompt:
      - name: "check_it"
        prompt: "Are you sure that you wanna update it? '{{ansible_host}}' "
        default: "Default is 'no'"
        private: no

  tasks:
     - include: "./vios.yml"
       when: check_it == "yes" 

###############################################################

and what i want to is 
##########################################################
---
- hosts: all
  remote_user: root

  tasks:
    
  vars_prompt:
      - name: "check_it"
        prompt: "Are you sure that you wanna update it? '{{ansible_host}}' "
        default: "Default is 'no'"
        private: no

     - include: "./vios.yml"
       when: check_it == "yes" 
#######################################################

is there any solution or search keyword? thank you all
Reply all
Reply to author
Forward
0 new messages