How to take user input in Ansible

0 votes

Hi Guys,

I have one ansible-playbook in my controller node. I want to enable user input in this playbook. So that I can pass input at the run time. How can I do that?

Aug 10, 2020 in Ansible by akhtar
• 38,260 points
3,560 views

1 answer to this question.

0 votes

Hi@akhtar,

To ask for user input, we will use the vars_prompt section in our playbook. You can follow the below playbook for better understanding.

- hosts: server
  gather_facts: no
  vars_prompt:
    - name: "Install"
      prompt: "Which software you want to install"
  tasks:
  - name: Install httpd module
    package:
      name: "{{ Install }}"
      state: present
answered Aug 10, 2020 by MD
• 95,460 points

Related Questions In Ansible

0 votes
1 answer

How to regex replace nested values in Ansible

I'm not aware of any built-in method ...READ MORE

answered Jun 17, 2018 in Ansible by shubham
• 7,340 points
5,507 views
0 votes
1 answer

devops , how to create user using ansible playbook

root doesn't need a password to switch ...READ MORE

answered Jul 16, 2018 in Ansible by Kalgi
• 2,680 points
1,138 views
0 votes
1 answer

How to configure fact caching in Ansible?

There are two cache plugins: redis and jsonfile. To ...READ MORE

answered Jan 24, 2019 in Ansible by Kennedy
4,032 views
0 votes
1 answer

How do I handle different machines needing different user accounts or ports to log in with?

Setting inventory variables in the inventory file ...READ MORE

answered Jan 31, 2019 in Ansible by Ansi
854 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,041 views
+2 votes
1 answer
0 votes
1 answer

How to install Ansible in Linux system?

Hi@akhtar, To install Ansible in your Linux system, ...READ MORE

answered Jul 28, 2020 in Ansible by MD
• 95,460 points
974 views
0 votes
1 answer

How to list down all the hosts in Ansible?

Hi@akhtar, You can use the option --list-hosts. It will ...READ MORE

answered Jul 28, 2020 in Ansible by MD
• 95,460 points
48,255 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP