如何让ansible回答“是". sendmailconfig询问的所有内容 [英] How to let ansible answer "yes" to everything sendmailconfig asks

查看:69
本文介绍了如何让ansible回答“是". sendmailconfig询问的所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ansible设置服务器,并且我想安装和配置sendmail.为此,我首先使用apt安装它,然后我需要运行sendmailconfig并对y进行所有询问.

I'm setting up a server with ansible, and I want to install and configure sendmail. To do this I first install it using apt, and then I need to run sendmailconfig AND asnwer y to all the questions it asks.

最后一部分是我认为最难的部分. sendmailconfig没有-y标志来回答所有问题,因此如何使Ansible简单地同意它所提出的所有问题?

That last part is the hardest I think. sendmailconfig doesn't have a -y flag to answer yes to everything, so how do I get Ansible to simple agree to all questions it asks?

推荐答案

只需使用yes shell实用程序,

Just use the yes shell utility,

yes 'y' | <command-name>
#    ^^The repeated string being 'yes' as the OP had asked.

man页面上,

NAME
       yes - output a string repeatedly until killed

SYNOPSIS
       yes [STRING]...
       yes OPTION

DESCRIPTION
       Repeatedly output a line with all specified STRING(s), or 'y'.

这篇关于如何让ansible回答“是". sendmailconfig询问的所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆