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

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

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -