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
• 4,630 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
• 6,914 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
• 2,333 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
• 5,226 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
• 1,862 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
• 9,057 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
• 1,941 views
0 votes
1 answer

How to install httpd web server in remote node using Ansible?

Hi@akhtar, You need to use the package module in Ansible. ...READ MORE

answered Jul 30, 2020 in Ansible by MD
• 95,460 points
• 3,698 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