Ansible: remove a program and say 'yes' to the command prompt? -


i trying remove system gem in ansible playbook, command i'm running requires user input before can complete:

- name: uninstall graphviz gem   command: sudo -i gem uninstall ruby-graphviz   sudo: true 

when run playbook find ansible hangs when gets code above. figure it's because user input required in order complete task.

so how can tell ansible remove gem, , 'yes' follow-up question os might have user?

from documentation:

rubygems ask confirmation if attempting uninstall gem dependency of existing gem. can use –ignore-dependencies option skip check.

so change command gem uninstall -​-ignore-dependencies ruby-graphviz.

p.s. should better use sudo or become directives instead of sudo command.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -