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
Post a Comment