简体   繁体   English

如何在 ansible 剧本中将 USERID 和密码作为参数传递

[英]How to pass USERID & password as an argument in ansible playbook

adjoin -u <admin_account> dev.abc.plc.uk --zone Dev -s VC123.dev.abc.uk -c "OU=Computers,OU=Centrify,DC=dev,DC=abc,DC=uk"

I want to execute above command to join the server to active directory using ansible script with admin account which should prompt for the password.我想使用 ansible 脚本和管理员帐户执行上述命令以将服务器加入活动目录,该脚本应提示输入密码。

This is for a new Linux server, running RedHat 6.1, ansible 2.6.2.这适用于运行 RedHat 6.1、ansible 2.6.2 的新 Linux 服务器。

 - name: 6.Join the server to Active Directory
      shell:adjoin -u <admin_account> dev.abc.uk --zone Dev -s VC123.dev.abc.uk -c "OU=Computers,OU=Centrify,DC=dev,DC=abc,DC=uk"

You can use vars_prompt ansible module and capture the password.您可以使用 vars_prompt ansible 模块并捕获密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM