Ansible - Control commands when need users input when executing -


how can control user inputs when command executing , ask me example :

sudo apt-get install mariadb-server 

when run command in ubuntu asked please enter new password mysql user root , again ask enter password again confirmation . how can pass variable example mariadbpass command because everytime ansible run hangs , failed have login servers , run manually

dpkg --configure -a 

to enter prompted password , confirmation.

thank you

this less of ansible question , bash question. i'd suggest take @ this post , tie of playbook need.

the easiest in case, using here string

tasks:   - shell: "apt-get install mariadb-server <<< $'password\otherprompts\n'"     sudo: true 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -